cancel
Showing results for 
Search instead for 
Did you mean: 

Invalid content type for SOAP

Former Member
0 Kudos

Hi all,

I am doing HTTP to SOAP scenario. I am getting the following error when i execute the scenario.

Payload:

<SAP:Error><SAP:Category>XIAdapterFramework</SAP:Category><SAP:Code>MESSAGE.GENERAL</SAP:Code><SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: invalid content type for SOAP: TEXT/PLAIN</SAP:AdditionalText></SAP:Error>

Then i have tried converting the content type using MTB in receiver SOAP adapter with all possible options but in vain. The webservice is working fine if i execute the same using a webservice client. Any help on this is appreciated.

Regards,

Sudheer

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Is the response coming from back from the SOAP call a valid SOAP response?

Thanks,

Renjith

Former Member
0 Kudos

HI,

How to check that? Even i am not sure whether the error has occured before the call to webservice or after the call to webservice. This is the auditlog of the message.

Time Stamp Status Description

2007-03-07 12:05:57 Success Transform: successfully transformed

2007-03-07 12:05:57 Success MP: processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean

2007-03-07 12:05:57 Success SOAP: request message entering the adapter with user J2EE_GUEST

2007-03-07 12:05:57 Error SOAP: call failed: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN

2007-03-07 12:05:57 Error SOAP: error occured: com.sap.aii.af.ra.ms.api.RecoverableException: invalid content type for SOAP: TEXT/PLAIN: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN

2007-03-07 12:05:57 Error MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: invalid content type for SOAP: TEXT/PLAIN: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN

2007-03-07 12:05:57 Error Exception caught by adapter framework: invalid content type for SOAP: TEXT/PLAIN

2007-03-07 12:05:57 Error Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: invalid content type for SOAP: TEXT/PLAIN: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN. Setting message to status failed.

2007-03-07 12:05:57 Error The message status set to FAIL.

2007-03-07 12:05:57 Error Returning synchronous error message to calling application: com.sap.aii.af.ra.ms.api.RecoverableException: invalid content type for SOAP: TEXT/PLAIN: java.io.IOException: invalid content type for SOAP: TEXT/PLAIN.

Regards,

Sudheer

Former Member
0 Kudos

You said you checked it with XMLSPy..right ? What was the response that you got from the webservice that you saw in webservice ?....

Otherwise you can use the TCP gateway monitor tool from SAP to see the request and response....

the TCP gateway application can be downloaded from OSS note - 856597...

Thanks,

Renjith.

Message was edited by:

Renjith Andrews

stefan_grube
Active Contributor
0 Kudos

The SOAP adapter always sends with content type text/xml. This is SOAP standard. You cannot influence this behavior.

Therefore the error message is caused by the response of the web service.

Regards

Stefan

Former Member
0 Kudos

HI Stefan,

I have checked the scenario even with webservice pointed by Bhavesh. I dont think there should be any problem with the scenario with the above webservice because it accepts text\xml content and returns text\xml content. Even then it throws the same error as i mentioned above. we are using sp19. Please tell me how to debug this.

As you said above, Transform.ContentType in receiver communication channel acts on the payload that is coming as response from webservice. Am i Right?

Regards,

Sudheer

Message was edited by:

Sudheer

Former Member
0 Kudos

Download the monitoring tool from the OSS note - 856597

to monitor the soap request & soap response...

Thanks,

Renjith

bhavesh_kantilal
Active Contributor
0 Kudos

Renjith,

Have never used the TCP gateway Monitor. What is it actually used for?

The SOAP messages can be montiored from the Message Display too.

http://host:port/MessagingSystem/monitor/monitor.jsp

--> Sent Messages / Received Messages --> Synch / Aynch --> Give the valid time --> and you will get a list of messages.

Next, click on Details --> Display Message Bytes --> This will display the entire SOAP message.

Wouldnt this suffice?

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

There are always different ways to achieve the same objective.....

As long as we can see the full SOAP request and the reponse that came back..that is all what matters !

Thanks,

Renjith

btw..thanks for this link....i have not used this....

Message was edited by:

Renjith Andrews

stefan_grube
Active Contributor
0 Kudos

From the error message I would say, that the response of your web service has not the obligatory content type. When the error occurs with the web service mentioned by Bhavesh as well, then I have no idea for the reason.

Use the TCP-Monitor mentioned by Renjith, this should show, whether the request and response messages are correct or not.

Regards

Stefan

Former Member
0 Kudos

HI,

The problem is not yet solved.

Bhavesh

>> I am not able to see the payload. It says the contents of the message are deleted to save memory. I went to sxmb_adm and set the neccessary parameters to log the messages. Are you sure we can check the entire content with SOAP envelop in the MDT?

Stefan

>>Could you please confirm me whatever modules we give in the receiver channel

will act on the response from webservice and not on the request to webservice?

Someone with any guesses on this can help me out to resolve the issue. Thanks in advance.

Regards,

Sudheer

bhavesh_kantilal
Active Contributor
0 Kudos

><i>Bhavesh

>> I am not able to see the payload. It says the contents of the message are deleted to save memory. I went to sxmb_adm and set the neccessary parameters to log the messages. Are you sure we can check the entire content with SOAP envelop in the MDT?</i>

Sudheer,

This is a known problem. Synch Messages are not saved by default. You will need to make a change in the Visual Admin to be able to see the SOAP messages. We faced similar issues and then turned of this setting in the VA and we were able to see the entire SOAP payload. You can be sure of that.

Make the setting <b>messaging.syncMessageRemover.removeBody</b> as <b>false</b> in the <b>Messaging System</b> in the visual admin and then you will be able to see the entire payload like I pointed out.

Regards

Bhavesh

Former Member
0 Kudos

HI,

To find out if the above problem is really with the webservice i am connecting i did a small work around. I did two scenarios SOAP to jdbc which is executing fine with webservice client and a HTTP to SOAP and tried to consume the first webservice exposed by XI. Now when i execute the scenario still iam getting the same invalid content type for SOAP: TEXT/PLAIN error. To my surprise i am able to see only two messages in MONI instead of four messages. From this i am able to infer that the receiver webservice is not being triggered by the SOAP receiver adapter. I think there are no network issues because it is trying to trigger a webservice exposed by XI. I feel that XI receiver SOAP channel is sending the content to webservice in text/plain fornat to which the webservice is not able to respond. If someone has any ideas let me know.

Regards,

Sudheer

bhavesh_kantilal
Active Contributor
0 Kudos

Sudheer,

1. Might sound stupid, but is Synch Logging been truned on? Only if Synch Logging is turned on Successful Synch messages can be seen in MONI.

2. Did you check the SOAP payload in the message Display Tool? Just make the change in the Visual Admin as pointed in my previous reply and thereafter you should be able to see the entire SOAP payload and this will surely enable you to confirm what is the content type being triggered from XI when you are making the SOAP call using the receiver SOAP adapter.

If you have already explored these 2 options, kindly ignore this reply.

Regards

Bhavesh

Former Member
0 Kudos

HI Bhavesh,

It is turned on. As you pointed out i am able to see the SOAP message in the MessagingSystem but that message is XI SOAP message. It is not the SOAP message that is going to the webservice. As far as my understanding the receiver SOAP adapter is converting the message to TEXT\PLAIN instead of TEXT\XML. As Stefan pointed out the message to webservice should be always TEXT\XML.I tried to convert the same using MesageTransform Bean but in vain. I feel that this is the problem due to SOAP adapter. Does anyone know where can i set the values related to SOAP adapter because i am not able to find any service related to SOAP in visualadmin.

Regards,

Sudheer

bhavesh_kantilal
Active Contributor
0 Kudos

Sudheer,

As far as I know, the message that you see in MDT is the message that is actually posted to the webservice.

You might also consider using the TCP gateway as pointed by Renjith. Am actually trying to also figure out how to use this utility tool , the moment i get a hang of it, i will let you know if it helps as well.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Tried a HTTP SOAP.

Used the TCP gateway between HTTP Client and XI server. Was able to see the SOAP Messge as it moved from Http Client --> TCP Gateway --> XI --> SOAP.

Not able to use it between XI and Webservice as there is a proxy server between by local machine and the webservice and the TCP Gateway does not allow for proxy server entries.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Sudheer,

The TCP gateway actaully is quite useful.

I have been able to see the SOAP message which was supposed to be posted from XI to the webservice usccessfully using the TCP gateway.

In case you need inputs on how to use this , let me know.

Renjith~ Special Thanks to you, for letting us know that such a utility exists.

Regards

Bhavesh

Former Member
0 Kudos

Hi Bhavesh,

Do you have any information on the module XISOAPAdapterBean in receiver communication channel? I think this module should definitely have one parameter to set the content type that is being set by the standard SOAP adapter. Also please let me know how to use tcpgateway.

Regards,

Sudheer

Message was edited by:

Sudheer

bhavesh_kantilal
Active Contributor
0 Kudos

Sudheer,

I have used the MessageTransformBean to set the SOAP Content type and it worked absolutely fine.

Regarding the TCP gateway~

1. You will find the TCP gateway as an attachment in the SOAP adapter FAQ on service market place. Down load the .jar and extract the same.

2. Now, after extracting the same, as shown in the <b>index.html</b> of this attachment , run the command to start the tcp gateway.

3. In your TCP Gateway, give the port as "50081" and the host and port values as 127.0.0.1 and 50082

4. Create another connection with port as "50082 " and host and port values as some dummy values.

5. In your receiver SOAP adapter, give the SOAP URL as <b>http : / /your local machine ipaddress:50081</b> ( withot these spaces )

Now, when you run the scenario, you will be able to see the SOAP payload in this utitlity as it is sent from XI to the webservice.

Though your scenario will not run you will be able to see the SOAP message that comes out of XI.

Regards

Bhavesh

PS : If it sounds confusing, just extract the SAPGW.jar and read the index.html . It just took me an hour to figure out how to use the tool and so it wouldnt take long for you as we.ll

stefan_grube
Active Contributor
0 Kudos

My idea was, that the response of your webservice has content type text/plain, not the SOAP adapter request.

Regards

Stefan

stefan_grube
Active Contributor
0 Kudos

Hi Bhavesh,

When you have an internet proxy in your SOAP/HTTP adapter channel, replace the proxy server address with the TCP Gateway address. In the TCP Gateway you put the proxy server as target address.

Regards

Stefan

Message was edited by:

Stefan Grube

Former Member
0 Kudos

HI,

it is fine , the said TCP gateway actaully is quite useful to configure as proxy as target.

Thanks

Chilla

bhavesh_kantilal
Active Contributor
0 Kudos

Stefan ,

Great tip. Did not think of it at all

Should work fine.

Regards

Bhavesh

bhavesh_kantilal
Active Contributor
0 Kudos

Stefan,

Gave it a shot and it worked :-). Great tip!

Thanks.

Regards

Bhavesh

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Sudheer,

Create a virtual directory in IIS and place your web service in it.

Use your web service address in XI with port number.

http://<IIS_Host>:<port>/<WebService>/<Web Method>name.asmx

bhavesh_kantilal
Active Contributor
0 Kudos

Sudheer,

1. Try contacting the webservice team and finding out the Content Type expected by them.

For example , if you check this webservice, http://www.webservicex.net/CurrencyConvertor.asmx?op=ConversionRate

You can see the various SOAP formats expected by the Webservice and it also provides the SOAP Content Type expected. Likewise find out from the Webservice what the content type is.

2. Use the Message Display Tool to view the entire SOAP Payload and check if the SOAP payload ( the entire SOAP envelope ) is correct and what the Webservice expects.

Regards

Bhavesh

Former Member
0 Kudos

Hi Sudheer,

It can be that the data for the fields which you are sending to SOAP is not the valid data for that particular field. Just check if you are sending the Valid Data in Payload.

You can just give it a try ..

Regards

Abhi