You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to parse both SOAP 1.1 and 1.2. So if I use
DYNAMIC_SOAP_PROTOCOL I must use createMessage(MIMEHeaders, InputStream).
But I don't have MIMEHeaders or an InputStream, I only have the string,
pXml.
So is the only way to do this to get the uri of the namespace associated
with the Envelope and put an 'if'? IOW:
if (uri.equals('http://www.w3.org/2003/05/soap-envelope/')
factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
else factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
This seems kind of kludgy. What happens when SOAP 1.3 comes out? I would
think that the existence of a DYNAMIC_SOAP_PROTOCOL constant would indicate
that it recognizes the document ... you know, dynamically?
Anything other than this kludgy 'if' that I can do?
Thanks,
Bob
V B Kumar Jayanti wrote:
If you need a message Factory that should work for both SOAP 1.1 and 1.2
envelopes then you need to do the following :
factory.createMessage(null, InputStream) could be handled in such a way that the
content-type is detected from the inputstream. It may require InputStream to
support mark and reset (not sure about this at the moment, need to investigate
more into the RI).
Email discussion of the issue :
I would like to be able to parse both SOAP 1.1 and 1.2. So if I use
DYNAMIC_SOAP_PROTOCOL I must use createMessage(MIMEHeaders, InputStream).
But I don't have MIMEHeaders or an InputStream, I only have the string,
pXml.
So is the only way to do this to get the uri of the namespace associated
with the Envelope and put an 'if'? IOW:
if (uri.equals('http://www.w3.org/2003/05/soap-envelope/')
factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL);
else factory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
This seems kind of kludgy. What happens when SOAP 1.3 comes out? I would
think that the existence of a DYNAMIC_SOAP_PROTOCOL constant would indicate
that it recognizes the document ... you know, dynamically?
Anything other than this kludgy 'if' that I can do?
Thanks,
Bob
V B Kumar Jayanti wrote:
User Code :
This is my code:
StringReader sr = new StringReader(pXml);
StreamSource ss = new StreamSource(sr);
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage soapMessage = mf.createMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
soapPart.setContent(ss);
SOAPEnvelope env = soapPart.getEnvelope();
pXml is a String containing the uploaded SOAP document, whose Envelope
section has the SOAP 1.2 uri (http://www.w3.org/2003/05/soap-envelope/).
When I use the SOAP 1.1 uri (http://schemas.xmlsoap.org/soap/envelope/) it
works fine. It also used to work fine on Java 1.5.
Environment
Operating System: Windows XP
Platform: All
Affected Versions
[current]
The text was updated successfully, but these errors were encountered: