cancel
Showing results for 
Search instead for 
Did you mean: 

PI 7.31 AEX (SP05): Handle xsi:nil="true" in SOAP response

Former Member
0 Kudos

Hi

I'm currently working on sync-proxy to SOAP scenario.

Target webservice expects xsi:nil="true" for a few null fields in the request and in the response also it sends the same for some of the null fields. Source system (ECC) wants blank whereever xsi:nil="true" is present in the response message.

I'm using the constant function xsi:nil in message mapping (graphical) and able to send xsi:nil="true" in the request to WS.

In the response mapping, I'm using isNil boolean function. But the SOAP response mapping is failing because webservice sends the namespace associated with xsi (xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance") in the SOAP envelope and PI discards the envelope message.

Below is the response sent by webservice.

  Below is the SOAP response received by PI at mapping step. As xsi namespace is missing in the payload, PI throws mapping error:

Error: The prefix "xsi" for attribute "xsi:nil" associated with an element type "errorField" is not bound.

  • I've also tried creating an xslt mapping to insert xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" at the root node createWorkOrderResponse. But as the message fails before executing the mapping (while parsing the response xml), it didnt work.
  • I've also used "Do not use SOAP envelope" option and xmlanonymizerbean but nothing worked. The message fails at adapter level.

Please let me know my options to resolve this issue. As it's a sync-scenario, I'm trying to implement a simple solution to handle this error.

Regards

Praveen.

Accepted Solutions (1)

Accepted Solutions (1)

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Praveen,

Can you try applying SAP Note 1786611 - Namespace Definitions Missing in Payload? What do you mean it is not working when using Do Not Use SOAP Envelope? Have you tried removing the Software Component Version reference in your receiver agreement?

Hope this helps,

Mark

Former Member
0 Kudos

Hi Mark

I've used "Do not use SOAP envelope" and found the error in the SOAP channel.

SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Internal Error

I couldnt proceed forward after getting above error as I dont see the webservice response in the SOAP channel.

I believe PI SOAP adapter by default discards SOAP envelope. So, will SAP note 1786611 gets the SOAP envelop back to the payload? I see that the note is for SOAP sender, but mine is a SOAP receiver scenario.

In 7.31 AEX, I've only Integrated config. So, I dont see anywhere to remove SWCV.

Regards

Praveen.

markangelo_dihiansan
Active Contributor
0 Kudos

Hello Praveen,

It should also be applicable for the SOAP Receiver. The real issue is not in the adding/removal of the SOAP envelope but rather in the retaining of the namespaces e.g xsi .

Regards,

Mark

Former Member
0 Kudos

Wow!!! It worked. Thanks a lot Mark! I was banging my head from past 1 week. Atlast the issue got resolved today. Very happy

I've asked basis to implement the SAP note today and after implementing the note 1786611, I found that the xml message now contains all the related namespaces which are missing earlier. Hence the response message mapping is now successfull and the webservice response message reached the sender.

FYI - Below is the response xml at mapping step after implementing the note.

Regards

Praveen.

Answers (1)

Answers (1)

baskar_gopalakrishnan2
Active Contributor
0 Kudos

>  Below is the SOAP response received by PI at mapping step. As xsi namespace is missing in the payload, PI throws mapping error:

Are you using xslt mapping as the first mapping in the operation mapping and then message mapping  in  the response?

Former Member
0 Kudos

Yes. I've tried using xslt mapping to insert xsi namespace and graphical mapping to map the structures.