cancel
Showing results for 
Search instead for 
Did you mean: 

ns0 in xml payload

Former Member
0 Kudos

Hi,

I have a file that SAP PI has to pick, which doesnt have namespace prefix in payload, that gives me mapping error; target can not be created

<?xml version="1.0" standalone="yes" ?>  

<SLL_SPL_DATA_FILE xmlns="http://sap.com/xi/GTS">

  <SLL_SPL_DATA_FILE>

but if put nsO as below the file works fine and mapping generates target structure.

<?xml version="1.0" standalone="yes" ?>

<ns0:SLL_SPL_DATA_FILE xmlns:ns0="http://sap.com/xi/GTS">

  </ns0:SLL_SPL_DATA_FILE>

is there a config settings in PI, or i have to ask sender to send the file with namespace prefix?

Thanks.

Prema

Accepted Solutions (1)

Accepted Solutions (1)

Ryan-Crosby
Active Contributor

Hi Prema,

Another thing you can do would be to add the designation elementFormDefault="unqualified" inside the xsd:schema node of the WSDL after exporting and re-importing it as an External Definition.  If you use the External Definition as the source then it will accept the incoming message without the prefix tag and you shouldn't see the error.

Regards,

Ryan Crosby

Former Member
0 Kudos

Hi Ryan,

I tried this option, stil PI not accepting the file without prefix. any inputs?

Thanks!

Former Member
0 Kudos

Thanks Ryan, instead using "qualified" for elementFormDefault solved the problem.

former_member184948
Active Participant
0 Kudos

This was helpful

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi Prema,

Use XMLAnonymizerBean in sender file adapter to add namespace prefix in payload but this will add prefix to all nodes or else use java/xslt mapping to add prefix for namespace alone. Please check this link http://scn.sap.com/thread/3202784

Regards,

Praveen

Former Member
0 Kudos

Thanks Praveen,

i tried adding bean in sender file adapter, yes it adds prefix to all nodes, but in the help it just adds where it is required, any inputs?

http://help.sap.com/SAPhelp_nw04/helpdata/en/45/d169186a29570ae10000000a114a6b/frameset.htm

Example

The anonymizer.acceptNamespaces parameter has the following value:

urn:sap-com:document:sap:rfc:functions rfc urn:sap-com:document:sap:soap:functions:mc-style rfc

●      Payload before using the XMLAnonymizerBean:

<Z_PAYMITEM_GET_LIST

  xmlns="urn:sap-com:document:sap:rfc:functions"

  xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/"

  xmlns:xsd="http://www.w3.org/2001/XMLSchema"

  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"

  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <I_ACCOUNTIDENT xmlns="">

    <ACCOUNT_NUMBER>0080000094</ACCOUNT_NUMBER>

    <BANK_COUNTRY>DE</BANK_COUNTRY>

    <BANK_COUNTRY_ISO>DE</BANK_COUNTRY_ISO>

  </I_ACCOUNTIDENT>

</Z_PAYMITEM_GET_LIST>

●      Payload after using the XMLAnonymizerBean:

<?xml version='1.0' encoding='utf-8'?>

<rfc:Z_PAYMITEM_GET_LIST

  xmlns:rfc='urn:sap-com:document:sap:rfc:functions'>

  <I_ACCOUNTIDENT>

    <ACCOUNT_NUMBER>0080000094</ACCOUNT_NUMBER>

    <BANK_COUNTRY>DE</BANK_COUNTRY>

    <BANK_COUNTRY_ISO>DE</BANK_COUNTRY_ISO>

  </I_ACCOUNTIDENT>

</rfc:Z_PAYMITEM_GET_LIST>

Harish
Active Contributor
0 Kudos

Hi Prema,

I would suggest to use xslt or java mapping to add the required prefix on particular node. refer the below blog

regards,

Harish

former_member207892
Participant
0 Kudos
Muniyappan
Active Contributor
0 Kudos

This can help you to achieve in pi.