I am trying to send xml to a java-based web service given to me by a thrid party via a c#.NET application, and I get the "org.xml.sax.SA XParseException : Content is not allowed in prolog" error.
I have verified the xml against the schema, and I passed the memorystream I am using to hold the xml to an .xml file, then opened the file with a hex editor to make sure that there were no undesired characters in the prolog, and there are none. When opened, the first characters in the file are
<?xml version="1.0" encoding="utf-8"?>
The class I was given to use to send the xml data to the web service accepts a byte array. I figure that creating the xml using an XmlTextWriter to a utf-8 encoded memorystream, then sending the contents of the stream to a byte array is the most direct method.
I have done a lot of research and tried all the possbilities around this issue that I could find, but nothing works. Could someone please help? Thanks in advance.
By the way, here is a portion of what the web service returns to me. In the payload of the SOAP message, should the data after the <submissionData > element look like that, or be readable xml like the content before it?
Messages:
Message:
Payload: <?xml version="1.0" encoding="utf-8"?><soap:Envel ope xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema
-instance" xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body><postSub mission xmlns="http://service.arm.hud .gov/"><submissionHe ader><agcHcsId> 1</agcHcsId><agcNa me>test</agcName><system Name>123</systemName><cms SubId>123456</cmsSubId><subFl ag>0</subFlag></submissionHeade r><agcType>test </agcType><submis sionData>PD94bW wgdmVyc2lvbj0iM S4wIiBlbmNvZGlu Zz0idXRmLTgiPz4 8dG5zOlN1Ym1pc3 Npb25EYXRhIHhza TpzY2hlbWFMb2Nh dGlvbj0iaHR0cDo vL2dvdi5odWQuYX JtL2FybV9kYXRhY mFnXzNfMS54c2Qi IHhtbG5zO
nhzaT0iaHR0cDov L3d3dy53My5vcmc vMjAwMS9YTUxT.. ....etc........ ............... .....</submissionData> </postSubmission> </soap:Body></soap:Envelope>
I have verified the xml against the schema, and I passed the memorystream I am using to hold the xml to an .xml file, then opened the file with a hex editor to make sure that there were no undesired characters in the prolog, and there are none. When opened, the first characters in the file are
<?xml version="1.0" encoding="utf-8"?>
The class I was given to use to send the xml data to the web service accepts a byte array. I figure that creating the xml using an XmlTextWriter to a utf-8 encoded memorystream, then sending the contents of the stream to a byte array is the most direct method.
I have done a lot of research and tried all the possbilities around this issue that I could find, but nothing works. Could someone please help? Thanks in advance.
By the way, here is a portion of what the web service returns to me. In the payload of the SOAP message, should the data after the <submissionData > element look like that, or be readable xml like the content before it?
Messages:
Message:
Payload: <?xml version="1.0" encoding="utf-8"?><soap:Envel ope xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/" xmlns:xsi="http ://www.w3.org/2001/XMLSchema
-instance" xmlns:xsd="http ://www.w3.org/2001/XMLSchema"><soa p:Body><postSub mission xmlns="http://service.arm.hud .gov/"><submissionHe ader><agcHcsId> 1</agcHcsId><agcNa me>test</agcName><system Name>123</systemName><cms SubId>123456</cmsSubId><subFl ag>0</subFlag></submissionHeade r><agcType>test </agcType><submis sionData>PD94bW wgdmVyc2lvbj0iM S4wIiBlbmNvZGlu Zz0idXRmLTgiPz4 8dG5zOlN1Ym1pc3 Npb25EYXRhIHhza TpzY2hlbWFMb2Nh dGlvbj0iaHR0cDo vL2dvdi5odWQuYX JtL2FybV9kYXRhY mFnXzNfMS54c2Qi IHhtbG5zO
nhzaT0iaHR0cDov L3d3dy53My5vcmc vMjAwMS9YTUxT.. ....etc........ ............... .....</submissionData> </postSubmission> </soap:Body></soap:Envelope>
Comment