WEB-Services / SOAP

Moderators: None (Apply to moderate this forum)
Number of threads: 108
Number of posts: 139

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
content not allowed in prolog exception Posted by nluciano on 16 Mar 2009 at 5:22 PM
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.SAXParseException: 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:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><postSubmissi
on xmlns="http://service.arm.hud.gov/"><submissionHeader><agcHcsId>1</agcHcsId><agcName>test</agcName><systemName>123</systemName><cmsSubId>123456</cmsSubId><subFlag>0</subFlag></submissionHeader><agcType>test</agcType><submissionData>PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48dG5zOlN1Ym1pc3Npb25EYXRhIHhzaTpzY2hlbWFMb2NhdGlvbj0iaHR0cDovL2dvdi5odWQuYXJtL2FybV9kYXRhYmFnXzNfMS54c2QiIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxT......etc............................</submissionData></postSubmission></soap:Body></soap:Envelope>
Report
Re: content not allowed in prolog exception Posted by Qwik on 27 Aug 2009 at 2:07 PM
Have you found the solution to this issue? I'm getting this error as well and judging by the XML you're using, sending to the same server as you are. (ARM data for HUD).
Report
Re: content not allowed in prolog exception Posted by nluciano on 7 Feb 2011 at 6:41 PM
yes, i think we are trying to send the same data...i got it to work, but then they changed the schema on me and i created the project in vs 2008, so now i am getting that error again. did you have any luck?



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.