Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Content is not allowed in prolog

 
Mike Whelihan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All,

I have been a long time reader at this forum, but this is my first time posting. I am attempting to write some java code for making a SOAP web services call with an attachment. I think I am pretty close to getting it to work, but the server is throwing an error on my request: "SystemId Unknown; Line #1; Column #1; Content is not allowed in prolog." I am getting a response, but it is a generic failure message.

Here is my code:



I looked at the two files, test-ccd-1 and new-xds-metadata-template with a hex editor and there are no weird characters at the beginning of the file. If I copy and paste the text from new-xds-metadata-template into a SoapUI request and attach the test-ccd-1 file it works fine (as long as I set Type to "XOP" and enable MTOM). I'm thinking that it might have something to do with the way I'm creating the prepMsg and prepAttachment StreamSource variables. Any ideas on what the problem could be? I've been searching the web for a few days without much luck.

Thanks!
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13074
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only time I have seen that message, there really was something odd about the first line of the document.

Bill
 
Mike Whelihan
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
After scouring through some logs, I think it may be an encoding issue. I noticed that when I send the request through SoapUI the "Content-Transfer-Encoding" is set to "8bit" and when I'm sending it through my java app it is listed as "binary". I tried added this line of code but it doesn't seem to change anything:



I am also trying to set the attachment part mime header to match SoapUI:



neither of these calls seem to work. Any thoughts/ideas?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic