Announcement Announcement Module
Collapse
No announcement yet.
Error accessing Axis2 web service with MTOM Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Error accessing Axis2 web service with MTOM

    I am trying to access a Axis2 web service using the spring-ws webservicetemplate. The service requires that the request be sent in MTOM format. If I use the Axiom message factory then everything works but when using the Saaj message factory I get the following error: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '-' (code 45) in prolog; expected '<'
    at [row,col {unknown-source}]: [1,1]

    The messages on the wire using Saaj and Axiom are attached as text files.

    I am not sure why wireshark wasn't able to capture the whole message but things I noticed was the Saaj message is missing the "Content-ID" and "Content-Transfer-Encoding" for the SOAP part. I am not sure if that is what is causing the problems but they should probably be there anyway.

    I would like to use Saaj because I was not able to get Axiom to send my data as attachments using the JAXB2Marshaller but if there is a way to get that to work that could potentially solve my issue too. Any help would be appreciated.

  • #2
    For anyone who is interested this is actually a bug with Axis2. Axis2 expects a Content-type of "multipart/related" and Saaj sends "Multipart/Related", it is case sensitive. The MTOM spec references RFC 2387 which does show the Content-type being capitalized. Here is more information on the bug http://forum.springsource.org/showthread.php?t=46584
    http://www.mail-archive.com/axis-dev.../msg38829.html

    Comment

    Working...
    X