Why did I get this error?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Sean_Xue
Posted On:   Tuesday, March 5, 2002 02:56 PM

javax.xml.soap.SOAPException: Unable to get header stream in saveChanges: SOAP exception while trying to externalize: Unable to create envelope from given source: PIs are illegal in a SOAP document Above is error message and following is part of my code. URLEndpoint endpoint = new URLEndpoint(SIMPLE_SAMPLE_URI); SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance(); SOAPConnection connection = scf.createConnection(); MessageFactory mf = MessageFactory.newInstance(); SOAPMessage msg = mf.createMessage(); SOAPPart soapPart = msg.getSOAPPart(); DOMParser parser = new DOMParser(); URL url = createURL("financialtransaction00.xml");    More>>

javax.xml.soap.SOAPException:
Unable to get header stream in saveChanges:
SOAP exception while trying to externalize:
Unable to create envelope from given source:
PIs are illegal in a SOAP document

			Above is error message and following is part of my code.
			
URLEndpoint endpoint = new URLEndpoint(SIMPLE_SAMPLE_URI);
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection connection = scf.createConnection();
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
SOAPPart soapPart = msg.getSOAPPart();
DOMParser parser = new DOMParser();
URL url = createURL("financialtransaction00.xml");
parser.setErrorStream(System.err);
parser.setValidationMode(true);
parser.showWarnings(true);
parser.parse(url);
XMLDocument doc = parser.getDocument();
DOMSource domSource = new DOMSource(doc);
soapPart.setContent(domSource);
msg.saveChanges();
SOAPMessage reply = connection.call(msg, endpoint);
   <<Less

Re: Why did I get this error?

Posted By:   Sharath_Jonnalagadda  
Posted On:   Wednesday, March 6, 2002 02:35 AM

can u tell me the content of the financialtransaction00.xml

when one uses the SOAPPart.setContent it expects a SOAPEnvelope to be added as content.
But it does not allow raw XML as content,
try adding the XML as the attachment to the SOAPMessage.
About | Sitemap | Contact