File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Web Services and the fly likes incorrect content-type for SOAP version Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "incorrect content-type for SOAP version" Watch "incorrect content-type for SOAP version" New topic
Author

incorrect content-type for SOAP version

amitynwa jadhav
Greenhorn

Joined: Nov 11, 2011
Posts: 3

I am trying to use the large merchant services API provided by Ebay to upload files onto ebay.

They have provided with a sample.jar file of the same. It seems to be working fine when we execute the .jar file on the command prompt, but when i am trying to integrate its source in my web app its giving me this error. Also i tried to create a web service client using netbeans and tried to use it, but still it gave me the same error. I also changed the SOAP version from 1.1 to 1.2 but that too doesn't seem to work. The following is the complete stack trace.


Nov 11, 2011 2:59:41 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl init
SEVERE: SAAJ0533: Cannot create message: incorrect content-type for SOAP version. Got text/xml; charset=UTF-8, but expected application/soap+xml
Nov 11, 2011 2:59:41 PM com.sun.xml.internal.messaging.saaj.soap.MessageImpl init
SEVERE: SAAJ0535: Unable to internalize message
Exception in thread "main" javax.xml.ws.WebServiceException: Couldn't create SOAP message due to exception: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:83)
at com.sun.xml.internal.ws.encoding.soap.client.SOAPXMLDecoder.toSOAPMessage(SOAPXMLDecoder.java:102)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.receive(SOAPMessageDispatcher.java:440)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.doSend(SOAPMessageDispatcher.java:260)
at com.sun.xml.internal.ws.protocol.soap.client.SOAPMessageDispatcher.send(SOAPMessageDispatcher.java:139)
at com.sun.xml.internal.ws.encoding.soap.internal.DelegateBase.send(DelegateBase.java:86)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.implementSEIMethod(EndpointIFInvocationHandler.java:174)
at com.sun.xml.internal.ws.client.EndpointIFInvocationHandler.invoke(EndpointIFInvocationHandler.java:108)
at $Proxy28.createUploadJob(Unknown Source)
at com.SwiftConnectV1.fileprocess.LMS.BulkDataExchangeActions.createUploadJob(BulkDataExchangeActions.java:138)
at com.SwiftConnectV1.fileprocess.LMS.LMSClientJobs.createUploadJob(LMSClientJobs.java:154)
at com.SwiftConnectV1.fileprocess.LMS.LMSSample.main(LMSSample.java:74)
Caused by: Couldn't create SOAP message due to exception: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
at com.sun.xml.internal.ws.util.SOAPUtil.createMessage(SOAPUtil.java:154)
at com.sun.xml.internal.ws.util.SOAPConnectionUtil.getSOAPMessage(SOAPConnectionUtil.java:78)
... 11 more
Caused by: com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Unable to internalize message
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:475)
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.<init>(MessageImpl.java:278)
at com.sun.xml.internal.messaging.saaj.soap.ver1_2.Message1_2Impl.<init>(Message1_2Impl.java:61)
at com.sun.xml.internal.messaging.saaj.soap.ver1_2.SOAPMessageFactory1_2Impl.createMessage(SOAPMessageFactory1_2Impl.java:62)
at com.sun.xml.internal.ws.util.SOAPUtil.createMessage(SOAPUtil.java:152)
... 12 more
Caused by: com.sun.xml.internal.messaging.saaj.soap.SOAPVersionMismatchException: Cannot create message: incorrect content-type for SOAP version. Got: text/xml; charset=UTF-8 Expected: application/soap+xml
at com.sun.xml.internal.messaging.saaj.soap.MessageImpl.init(MessageImpl.java:356)
... 16 more
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
So what exactly does "integrate its source in my web app" mean?
Are you trying to create SOAP requests yourself, using SAAJ?
Best wishes!


My free books and tutorials: http://www.slideshare.net/krizsan
amitynwa jadhav
Greenhorn

Joined: Nov 11, 2011
Posts: 3

Hi Ivan,
Well what i have with me is a Large merchant services API which consists of a .Jar which is just a sample and .java files which has the complete functionality in them.
Now i am trying to use these source files in my application, i am not trying to create SOAP requests using SAAJ, when i run the .jar from the command prompt its working fine, but when i try to get same through these source files from my application i am getting this error.
They have also given a WSDL, i have used it to create a web service client in my netbeans(creating a different sample project just to get this to work) but by using the methods generated by the stubs i am still getting the same error.

Thanks.
amitynwa jadhav
Greenhorn

Joined: Nov 11, 2011
Posts: 3

Got it to work, upgraded to Java 7 and it worked.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: incorrect content-type for SOAP version