cancel
Showing results for 
Search instead for 
Did you mean: 

Webservice hell - invalid content type for SOAP: TEXT/HTML

Former Member
0 Kudos

Hi All

I'm trying to call a webservice in XI and getting the dreaded "invalid content type for SOAP: TEXT/HTML" error.

Running it in XMLSpy it works perfectly well, but not in XI.

Here are some screenshots:

1) The Request sent from XMLSpy

[XMLSpy Request - Successful|http://www.host-images.com/u/files/3spjf72drc9ncjhtiovo.jpg]

2) The successful response to XMLSpy

[XMLSpy response|http://www.host-images.com/u/files/c3u8k9bplpzu8z6il61a.jpg]

3) Here is the error in XI in RWB, together with the XML payload

[XML and RWB error|http://www.host-images.com/u/files/9ex5dhqua9y07lhpja09.jpg]

4) Here is the SOAP Comms Channel

[Comms channel|http://www.host-images.com/u/files/w6pa90yy0nkly628535i.jpg]

Note:

1. The 'Target URL' and the 'SOAP Action' are taken directly from the parameters used successfully in XMLSpy

2. I have already added 'localejbs/AF_Modules/MessageTransformBean' / 'Transform.ContentType' / text/xml;charset=utf-8

I woul really appreciate some help with this, as I'm getting kind of desparate.

Thanks in advance.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

Your target webservice is clearly using SOAP 1.2 as specified by this request namespace:

xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope"

But standard SOAP Receiver only natively supports SOAP 1.1

For more information between the differences between the two, see this link:

http://www.herongyang.com/Web-Services/Perl-SOAP-1-2-Request-Differences-SOAP-1-1-and-1-2.html

You can use the SOAP Axis Receiver Adapter or you can try modifying the SOAP Request by:

1.) Creating the SOAP Envelope according to SOAP 1.2 specs via Java Mapping (check Do Not Use SOAP Envelope)

2.) Change the content type to application/soap+xml;action="yourSOAPAction"

Let us know if this worked for you (worked for me).

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark / All

Thanks for the info. I have some additional questions please:

1. Regarding SOAP 1.2

It apears that the WSDL provided allows for both 1.1 and 1.2. Infact, when I sent the SOAP request in XMLSpy, the first thing I see if a pop-up window asking me to select 1) OrderServiceSoap or OrderServiceSoap12 ...

[XMLSpy|http://www.host-images.com/u/files/g50y9xohakbhb7j5v3w4.jpg]

However I don't see this option when I use the WSDL in XI, only a list:

[XI|http://www.host-images.com/u/files/230urvn7okvb4jbad1o8.jpg]

How can I emulate selecting the the non-1.2 version in XI?

2. Probably irrelevant but, If I tick 'Do not use SOAP envelope' option on the CC I get:

MP: exception caught with cause com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 407 Proxy Authentication Required ( The ISA Server requires authorization to fulfill the request. Access to the Web Proxy filter is denied. )

Can anyone confirm if this is a consequence of ticking ''Do not use SOAP envelope', or if it indicates a underlying problem with the Proxy credentials I have entered.

Thanks again.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

1. Regarding SOAP 1.2

It apears that the WSDL provided allows for both 1.1 and 1.2. Infact, when I sent the SOAP request in XMLSpy, the first thing I see if a pop-up window asking me to select 1) OrderServiceSoap or OrderServiceSoap12 ...

However I don't see this option when I use the WSDL in XI, only a list:

How can I emulate selecting the the non-1.2 version in XI?

If you open your external definition, you will see under the Imported Document tab the wsdl definition. Now, if you go to the WSDL tab you will see that the namespace declared is similar to this one xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/", so I guess in ESR, only SOAP 1.1 messages can be seen.

Can anyone confirm if this is a consequence of ticking ''Do not use SOAP envelope', or if it indicates a underlying problem with the Proxy credentials I have entered.

This is probably because of the proxy credentials. If the Do Not Use SOAP Envelope is unticked, PI will construct the SOAP envelope based on the SOAP 1.1 schema. Ticking this, allows you to override the SOAP Envelope (in case of SOAP 1.2) or simulate a Plain HTTP Receiver Adapter.

Hope this helps,

Mark

Former Member
0 Kudos

Ok, thanks Mark

So, if in ID, only SOAP 1.1 messages can be seen, and also "Do Not Use SOAP Envelope" is unticked, then I can be condifent that it is a 1.1 request is being sent. Back to square 1 then

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

So, if in ID, only SOAP 1.1 messages can be seen, and also "Do Not Use SOAP Envelope" is unticked, then I can be condifent that it is a 1.1 request is being sent. Back to square 1 then

I think you meant ESR/IR, but yup, that is correct, it is a SOAP 1.1 request by default.

You can try using the workaround I mentioned by using Java Mapping to construct the SOAP Envelope or by using the SOAP Axis Receiver.

To Use the SOAP Axis Receiver, edit your SOAP Receiver CC then click on the transport protocol (HTTP by default) and then select HTTP (Axis). Note that this is only possible if Axis is deployed.

Hope this helps,

Mark

Former Member
0 Kudos

what I'm finding strange is, If I remove the proxy setting completely, I still get

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/HTML: java.io.IOException: invalid content type for SOAP: TEXT/HTML.

If I provide proxy server but a deliberately false user/Password, I still get exactly the same,

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/HTML: java.io.IOException: invalid content type for SOAP: TEXT/HTML.

Is there anywhere /anyway I can see the actual details of this TEXT/HTML message?

markangelo_dihiansan
Active Contributor
0 Kudos

Hello,

The correct content-type should be application/soap+xml;charset=UTF-8. However, the request still needs the correct namespace "http://www.w3.org/2003/05/soap-envelope" instead of the default "http://schemas.xmlsoap.org/soap/envelope/"(that XI constructs) inside the soapenvelope for the transaction to work.

Hope this helps,

Mark

Edited by: Mark Dihiansan on Jul 21, 2011 11:35 AM

former_member854360
Active Contributor
0 Kudos

Hi,

Please check your servers FIREWALL and Port enablement.

Former Member
0 Kudos

Hi Mark

In XMLSpy, if I select the non-1.2 option, I get success by sending this:

[XMLSpy_non1.2|http://www.host-images.com/u/files/yd5w61geq39ltxdy4dqe.jpg]

Since this works in XMLSpy using "SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"

, does this suggest that the default used by XI is ok?

Regards

Former Member
0 Kudos

I have just followed this tutorial [RFC to WS tutorial|http://www.saptechnical.com/Tutorials/XI/RFC2WebService/Page1.htm] exactly, and the response coming back is the same:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Call Adapter

-->

- <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/" SOAP:mustUnderstand="1">

<SAP:Category>XIAdapterFramework</SAP:Category>

<SAP:Code area="MESSAGE">GENERAL</SAP:Code>

<SAP:P1 />

<SAP:P2 />

<SAP:P3 />

<SAP:P4 />

<SAP:AdditionalText>com.sap.aii.af.ra.ms.api.DeliveryException: invalid content type for SOAP: TEXT/HTML</SAP:AdditionalText>

<SAP:ApplicationFaultMessage namespace="" />

<SAP:Stack />

<SAP:Retry>M</SAP:Retry>

</SAP:Error>

Former Member
0 Kudos

Can anyone please confirm if they have ben able to get this tutorial [tutorial|http://www.saptechnical.com/Tutorials/XI/RFC2WebService/Page1.htm] to work please?

For me, I am getting exactly the same error as I am seeing when I am trying to implement my real scenario:,

Returning synchronous error message to calling application: com.sap.aii.af.ra.ms.api.RecoverableException: invalid content type for SOAP: TEXT/HTML: java.io.IOException: invalid content type for SOAP: TEXT/HTML.

I have followed the tutorial EXACTLY, so if someone would be so kind as to confirm if the tutorial works for them, without getting the SOAP: TEXT/HTM error, it would be really useful. Thanks in advance.

former_member854360
Active Contributor
0 Kudos

please check your pi servers firewall and port enablement

Former Member
0 Kudos

looking like it's firewall issue. I recreated my scenario's on a personal PI7.1 system, with no proxy or firewall involved, and it works perfectly.

former_member854360
Active Contributor
0 Kudos

Hi Andy,

happpy to hear from you.

From First reply itself i was telling you to check your pi servers firewall and port enablement

Why you were getting that error Message?

Because due to firewall issue PI was getting some HTTP response in HTML and SOAP adapter was unable to parse those HTML response.

Answers (3)

Answers (3)

0 Kudos

Is this a sync call, if so, are you sure this isn't some response coming back in html format.

Former Member
0 Kudos

Hi Andy,

Can you please give the screenshot for:

I have already added 'localejbs/AF_Modules/MessageTransformBean' / 'Transform.ContentType' / text/xml;charset=utf-8

Regards,

---Satish

Former Member
0 Kudos

As requested

[Module|http://www.host-images.com/u/files/c3m26m2t18kpcp3iv9du.jpg]

Former Member
0 Kudos

Hi Andy,

Since you are using in receiver comm. channel try to put this module after the standard module. So put number 2 first and number 1 as 2nd and give a try.

Also try with this more module configuration as per sap help:

Transform.Class com.sap.aii.messaging.adapter.Conversion

Transform.ContentType text/xml;charset=utf-8

http://help.sap.com/saphelp_nw04/Helpdata/EN/24/4cad3baabd4737bab64d0201bc0c6c/content.htm

Regards,

---Satish

Former Member
0 Kudos

chk this

/people/shabarish.vijayakumar/blog/2008/01/08/troubleshooting--rfc-and-soap-scenarios-updated-on-20042009

Former Member
0 Kudos

HI

I have confirmed the Target URL http://webservices.oxatis.com/webservices/HttpServices/SOAP/OrderServices.asmx

is the same as is sugested by XMLSpy.

I confirm that the SOAP action "OrderGetList" is the same as XMLSpy suggests.

I confirm that Transform.ContentType text/xml is set, as suggested.

Unfortunately in XI I am still getting:

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/HTML: java.io.IOException: invalid content type for SOAP: TEXT/HTML

The same parameters in XMLSpy work perfectly.

Former Member
0 Kudos

Hi Andy,

We faced similar problem & found alternative.

Try out, if it works for u as well.

1) Use HTTP Adapter instead of SOAP.

Transport Protocol : HTTP 1.0

Message Protocol : XI Payload in HTTP Body

Adapter Engine : Integration Server

Addressing type : URL Address.

Target Host:

Service Number :

Path Prefix:

Authentication type : we hv used Ananymus login, as our login details in payload header.

Content Type : application/soap+xml;charset=UTF-8( this is IMP).

Header Fields.

Name value

Host target host

XI Payload Manipulation

XML Code : UTF-8

Hope, this helps...

-santosh.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Even if your soapaction is wrong or target url is invalid , you have chance to get this error. Please test with blank in action and see the result. This is my few cents..