cancel
Showing results for 
Search instead for 
Did you mean: 

Changing "content-Type" header parameter for inbound SOAP structure

former_member440061
Participant
0 Kudos

Hi,

We have an IDOC to SOAP scenario and we are using PI 7.1. The target system is using SOAP 1.2 protocol. So we got all the necessary components necesssary for AXIS framework as suggested by SAP support team. We are now using Axis message protocol with SOAP version 1.2. Now when we try to send the data we get the following error message in RWB Message monitoring:

Delivering the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: org.xml.sax.SAXParseException: Premature end of file..

After sending the above error message along with the TCP Gateway trace to SAP Support team, the reply from SAP Support team was as follows :

thank you for the collected trace. This reply from the target server
is important:
"HTTP/1.1 415 Cannot process the message because the content type
'application/soap+xml; charset=UTF-8; action=""' was not the expected
type 'text/xml; charset=utf-8'."

(As you can see the content type what was sent in the message header
can not be accepted on the receiver system. This is the header of the
sent data:

POST /LNTAXSAPServiceEngine.svc?wsdl HTTP/1.0
Content-Type: application/soap+xml; charset=UTF-8; action=""
Accept: application/soap+xml, application/dime, multipart/related, text/User-Agent: Axis/1.4
Host: poeesmstest.lntroot.com:88
Cache-Control: no-cache
Pragma: no-cache
Content-Length: 3759

You have two possibilities now:
1.) Discuss this with the administrator of the receiver system, if they
can change their configuration to accept the currently used content type.

2.) Or set "Content-Type" header parameter to 'text/xml; charset=utf-8'
as it is described in this document:
"how to set http header parameters using the axis.pdf"
I attached it to this ticket.)

the document referred here can be found at : http://scn.sap.com/docs/DOC-16148

So, going with the 2nd option, we are trying to change the header type as explained in the pdf attached. I have created/ added the module in ID and UDF in IR.

Now I am stuck with the mapping part. Can someone please explain what "Item" are they referring to. Is it a new field/node that I need to get added in the receiver SOAP structure. Any help would be appreciated.

thanks in advance.

Accepted Solutions (0)

Answers (2)

Answers (2)

stefan_grube
Active Contributor
0 Kudos

There is nothing to do besides changing your protocol to SOAP version 1.1

just ignore the poor answer of sap support 😉

former_member440061
Participant
0 Kudos

Hi Stefan,

I have already been using SOAP version 1.1 with Axis protocol in the channel. And I cannot change it tp plain HTTP SOAP 1.1 since the target Web service system is using SOAP 1.2.

Please advise how to proceed.

stefan_grube
Active Contributor
0 Kudos

when your webservice pesponse like this:

"HTTP/1.1 415 Cannot process the message because the content type

'application/soap+xml; charset=UTF-8; action=""' was not the expected

type 'text/xml; charset=utf-8'."

Then in fact the web service expects SOAP 1.1 protocol.

Note:

content type 'application/soap+xml; is SOAP 1.2

content type 'text/xml; is SOAP 1.1.

check with webservice guys, what they really have and expect.



former_member440061
Participant
0 Kudos

Hi Stefan,

Thanks for your reply.

I have confirmed with the webservice guys and they are using SOAP 1.2 at their end. This is quite weird as the TCPGateway_Trace returned the error according to which the expected content type should be

'text/xml; charset=utf-8' which is generally supported by SOAP 1.1.

Is it possible that SAP support team wants me to change the content type to

'text/xml; charset=utf-8' from 'application/soap+xml; charset=UTF-8; action=""' while still using SOAP 1.2.

If yes, then please suggest me how do I proceed with the mapping part in the document mentioned. As of now, i have mapped the output of "getHeaderParameter" UDF to the very root node of the target structure. now if I try to send the data i get the following error in moni:

Runtime exception occurred during application mapping com/sap/xi/tf/_FIDCC1FIDCCP02_To_WebService_IES_w~; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:postLedgerJournalTable. Values missing in queue context. Targ~

And the following error when I try to test the mapping using the incoming payload:

Runtime exception when processing target-field mapping /ns0:postLedgerJournalTable; root message: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FIDCC1FIDCCP02_To_WebService_IES_withModule_ method getHeaderParameter[SetCookie, http://sap.com/xi/System/HTTP SetCookie, com.sap.aii.mappingtool.tf7.rt.Context@4f384b16]

stefan_grube
Active Contributor
0 Kudos

If webservice requests SOAP 1.2, the content type must be "application/soap+xml"

You find this on w3c.org and here:

http://www.ietf.org/rfc/rfc3902.txt

You cannot change content type in any way.

What happens, when you choose SOAP 1.1 protocol?

Have you tried SOAPUI client to test the web service?

I have a bad feeling about your scenario. When web service developers ignore standards, you have no chance to do a smooth integration.

former_member440061
Participant
0 Kudos

Stefan,

you are probably right. i checked the WSDL url through Web Service navigator and got the following error:

Missing wsdl portType entity with (q)name (http://schemas.microsoft.com/dynamics/2008/01/services/AXSAPService)IService

Now, i have written back to the Web service guys to chek the format of the WSDL and provide us with the updated one.

Will update you of the outcome.

Thanks for help.

former_member440061
Participant
0 Kudos

Hi Stefan,

I had a word with the guy who developed the web service and told him about th error we are getting while testing the WS using web service navigator tool :

Missing wsdl portType entity with (q)name (http://schemas.microsoft.com/dynamics/2008/01/services/AXSAPService)IService

But unfortunately, he has never used this tool and is totally not sure about what could be the reason for this error.

Can you please shed some light on this.. as I am also clueless. What needs to be done to rectify this. Does it have something to do with the wsdl or some changes needs to be done in that.

Thanks in advance.

Former Member
0 Kudos

Hi,

          Item can be any field in the response message mapping target structure. Since in your case you only need to set the ASMA property "http://sap.com/xi/XI/System/SOAP THeaderSOAPACTION" with the specific SOAP action, in your case, the target field of your dynamic config UDF can also point to any node in the target payload.

Regards

former_member440061
Participant
0 Kudos

Hi Shiladitya,

Thanks for your reply.

As per your suggestion, I mapped the output of the UDF to one of the unmapped field in the receiver structure, after adding the module in ID as mentioned in the point 3.2 of the PDF doc (how to set the header parameter using Axis).

When tried sending the IDOC again , got te following error in moni:

Runtime exception occurred during application mapping com/sap/xi/tf/_FIDCC1FIDCCP02_To_WebService_IES_w~; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:postLedgerJournalTable. Values missing in queue context.

I tested the mapping being used with the payload and got following error:

Runtime exception when processing target-field mapping /ns0:postLedgerJournalTable; root message: Exception:[java.lang.NullPointerException] in class com.sap.xi.tf._FIDCC1FIDCCP02_To_WebService_IES_withModule_ method getHeaderParameter[SetCookie, http://sap.com/xi/System/HTTP SetCookie, com.sap.aii.mappingtool.tf7.rt.Context@1b0003dd].

Please advise what needs to be done next or where am I wrong.

Also, I would like to point that I am using SOAP 1.2 in the receiver channel. therefore, I am unable to set the ASMA properties as there is no "Advance" tab there.