cancel
Showing results for 
Search instead for 
Did you mean: 

How to change content-type (text/xml;charset=utf-8) in SOAP receiver?

Former Member
0 Kudos

Hi,

How can I change the content-type (text/xml;charset=utf-8) sent by the SOAP adapter to an external webservice?

I need to sent text/xml as content-type to the webservice, otherwise I get an error.

I have tried with different adapter modules but so far no positive results.

Thanks.

Edited by: Roberto Viana on Mar 26, 2009 2:02 PM

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use Message Transfrom Bean for doing the same

http://help.sap.com/saphelp_nw04/helpdata/en/57/0b2c4142aef623e10000000a155106/content.htm

MessageTransformBean parameters contentType will do this

Rajesh

Former Member
0 Kudos

I have added the localejbs/AF_Modules/MessageTransformBean as first module in the SOAP receiver adapter but the receiver stiil getting the same Content-Type (text/xml;charset=utf-8).

I need to find a way to supress/eliminate the charset parameter in the Content-Type.

Do I need to build an own module for that purpose?

Thanks

Shabarish_Nair
Active Contributor
0 Kudos

what happens when u give Transform.ContentType and value only text/xml

stefan_grube
Active Contributor
0 Kudos

It is not possible to change the content-type of SOAP adapter. Even not with adapter modules.

When your web service provider does not accept text/xml;charset=utf-8, then you should consider on finding a solution there, as this is a standard and all web service provider should follow the standard.

Regards

Stefan

Former Member
0 Kudos

Hi Stefan, many thanks for your answer.

According to your answer it is not possible to manipulate/change the way PI fills the content-Type.

I was hoping to solve the issue with a custom built adapter module that sets the HTTP header content-type to text/xml without the charset entry, but I understand that's not the case.

Regards,

Roberto Viana

stefan_grube
Active Contributor
0 Kudos

The only way I know:

Set parameter "Do not use SOAP envelope", add the SOAP envelope in mapping (e.g with a simple XSLT), remove the SOAP envelope of the response in mapping as well.

Now you can set the Content-Type with the MessageTransformBean.

As this is a lot of effort, you should check the possibility to have a fix in the webservis provider first.

Regards

Stefan

Former Member
0 Kudos

Ok, that sounds reasonable to me. I'll try that right away.

Thanks again.

Former Member
0 Kudos

Gents,

Problem solved.

I have an XSLT of both sides request/response with the option do no use SOAP envelope and the MessageTransformBean in the receiver SOAP communication channels and it works fine.

Many thanks for your support.

stefan_grube
Active Contributor
0 Kudos

There is one point I want to mention:

If your message is big (> 1MB), an XSLT might be a perfomance issue.

A simple Java Mapping could help then.

Regards

Stefan

Answers (1)

Answers (1)

Shabarish_Nair
Active Contributor
0 Kudos

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