Skip to Content
0
Former Member
Apr 15, 2013 at 12:29 AM

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

717 Views

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.

Attachments

wsresponse.JPG (45.2 kB)
receivedbyPI.JPG (26.1 kB)