none
Error "expected 'application/soap+xml'" when calling the java web servcie RRS feed

  • Question

  • I am trying to call the web service in java. I did the web reference to the web service and tried to call the web service and got the below exception.

    Client found response content type of 'multipart/related; boundary="MIMEBoundary_54dcceda05948fc6d7a5524a394222831693c0922b7354fd"; type="application/xop+xml"; start="

    <0.44dcceda05948fc6d7a5524a394222831693c0922b7354fd@apache.org>


      "; start-info="application/soap+xml"; action="*********', but expected 'application/soap+xml'.

      The request failed with the error message:

      --

      --MIMEBoundary_54dcceda05948fc6d7a5524a394222831693c0922b7354fd

      Content-Type: application/xop+xml; charset=utf-8; type="application/soap+xml"

      Content-Transfer-Encoding: binary

      Content-ID:

    <0.44dcceda05948fc6d7a5524a394222831693c0922b7354fd@apache.org>


    Note: I got the expected response from the web service along with the above error message which caught in the Exception block.
    • Edited by priyanjoe20 Thursday, October 6, 2016 4:07 PM
    Thursday, October 6, 2016 4:06 PM

Answers

  • Hello priyanjoe20,

    Did you Add a Service Reference or Web Reference?  If you added a Web Reference try Service Reference as it might be able to handle the wsdl better.

    If you are already using WCF then check the message encoding is set to Mtom; i found a post suggesting this was the issue:

    messageEncoding="Text" to messageEncoding="Mtom"

    http://stackoverflow.com/questions/10496186/error-consuming-webservice-content-type-application-xopxml-does-not-match-ex


    Cheers, Jeff

    Thursday, October 6, 2016 7:22 PM

All replies

  • Hello priyanjoe20,

    Did you Add a Service Reference or Web Reference?  If you added a Web Reference try Service Reference as it might be able to handle the wsdl better.

    If you are already using WCF then check the message encoding is set to Mtom; i found a post suggesting this was the issue:

    messageEncoding="Text" to messageEncoding="Mtom"

    http://stackoverflow.com/questions/10496186/error-consuming-webservice-content-type-application-xopxml-does-not-match-ex


    Cheers, Jeff

    Thursday, October 6, 2016 7:22 PM
  • Thanks Jeff.

    Do I need to add this I client side or server side...As i'm calling the java web service, I dot have control over the service.

    Friday, October 7, 2016 7:09 AM
  • Hi priyanjoe,

    I think you could set messageEncoding with Mtom at client side.

    If it did not work for you, it would be helpful if you could share us how you call service from client.

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, October 10, 2016 6:33 AM