• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Content is not allowed in prolog

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Warning! Way too comfortable! Do not sit! Try reading this tiny ad instead:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic