cancel
Showing results for 
Search instead for 
Did you mean: 

RFC to SOAP Interface - Problem in Request Message Mapping

Former Member
0 Kudos

Dear All,

We are working on RFC to SOAP Scenario i.e. pulling out data from an WebService from SAP via PI.

In Request Message Mapping, when the wsdl file is uploaded as Target Message, the wsdl request shows the nested elements like below.

<Request>

<Request_New>

<PAR1>xyz</PAR1>

<PAR2>123</PAR2>

</Request_New>

</Request>

But the desired Request should go like below.

<Request>

<PAR1>xyz</PAR1>

<PAR2>123</PAR2>

</Request>

Hence it gives an error saying that the tag Request_New does not exist.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

I am assuming you are at 7.1. Try this, add a new Message mapping where you load your webservice request message in both the source and target. disable all nodes in the target except root node. Now, for the target root node mapping , select the source root node , rt clk return as XML , now pass this to an UDF , Inside the UDF, the entire XML will be available as a string . Use String.replace method to replace all occurence of the unwanted header node with empty(""). In your Operation Mapping, call this mapping after your actual mapping. shud solv e ur issue.

Thanks

Saravana

Former Member
0 Kudos

Hi Al,

Since I am an beginner in SAP PI, I unable to cope up with UDF.

Can anybody help me to create UDF in this case?

Also what actually has to be written in UDF?

Thanks,

Amit

Former Member
0 Kudos

Hi Experts,

The problem got solved after doing necessary/appropriate changes in web-service/SOAP signature at the 3rd party end.

Regards,

Amit Patil

Answers (2)

Answers (2)

Former Member
0 Kudos

1. export this WSDL

2. exclude the tag causing conflict.

3.re upload and test.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

if you are using target system's latest WSDL as target mesg then you should not have conflict. You are trying to consume the target system mesg. So you need to use their latest or updated WSDL. Talk to them.

another possible way is construct target structure based on the requirement or if that is not possible use XSLT mapping.

Former Member
0 Kudos

Dear All,

I'm using proper n latest wsdl file.

The elements in Request & Response in wsdl file have exactly same definitions.

But when the wsdl flie is uploaded in target message while request message mapping, it shows below structure with header tag.

<Request_New>

<PAR1>xyz</PAR1>

<PAR2>123</PAR2>

</Request_New>

Also when the wsdl file is uploaded in source message while response message mapping, it shows below structure without header tag.

<Message>False</Message>

I dont understand, how this conflict occurs although both request n response have same kind of declarations n definitions in the wsdl file.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Test the WSDL outside PI using soapui or altova xmlspy and see what you get in the request mesg structure and test. If you notice same thing then either you dont maintain the latest version or your target system does not update their changes to you. Talk to them. Editing the external system's WSDL is not the best practice.

If it is minor change then you might can edit the file and reimport and go forward.

Former Member
0 Kudos

Dear All,

Our target webservice cotains multiple methods.

The every method contains its corresponding request, response and SQL ecxeption as messages.

In case of request structures, every method (except crmPaymentReceived) contains more than 1 root element.

So while calling those methods having more than 1 root element, the additional header tag will always appear(not avoidable) in the request coming from SAP PI.

For Example,

Request Structure for method u2018isLoginIdExistu2019 (having more than 1 root element)

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

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<soap:Body>

<ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing"> -


>>>>> u201CThis Header tag will always appear u201D

<isLoginIdExistin0>asp</isLoginIdExistin0>

<isLoginIdExistin1>1</isLoginIdExistin1>

</ns1:isLoginIdExistRequest>

</soap:Body>

</soap:Envelope>

For this method, we get the error(saying that ns1:isLoginIdExistRequest xmlns:ns1="http://netpricing" does not exists).

Request Structure for method u2018crmPaymentReceivedu2019 (having only 1 root element)

<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd=http://www.w3.org/2001/XMLSchema-instance xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<soap:Body>

<ns1:crmPaymentReceivedin0 xmlns:ns1="http://netpricing">false</ns1:crmPaymentReceivedin0>

</soap:Body>

</soap:Envelope>

For this method, we get the success response.

I tested their wsdl URL in XMLspy and wizdal(a wsdl testing tool), it shows request in the format having only root elements and not the header tags.

But header tags will always appear when header tag contains more than 1 root element.

Can anybody suggest me how do I tackle this?

Thanks in Advance.

Former Member
0 Kudos

Dear All,

Can anybody help me out in this issue?

I want to reolve this at the earliest.

Thanks,

Amit

former_member207622
Contributor
0 Kudos

Have you imported this wsdl in external definitions and then adding that external definition to the mapping ?

if you are saying you have multiple methods while selecting your target structure in mapping you have to select the relevant method which would be visble in external definition

thanks

Ninad

Former Member
0 Kudos

Dear All,

Everythng I did is correct including design and configuration objects.

The only problem is of the header tag generated automatically(for the methods/actions having more than 1 child element) in the request which goes to SOAP receiver which they dont want.

How to avoid this?

Thanks,

Amit

baskar_gopalakrishnan2
Active Contributor
0 Kudos

SAP creates header tag which the end system does not accept. Check "do not use soap envelope" option and send and see how that goes. If still problem, use the above option plus customize header using XSLT mapping before you send.