cancel
Showing results for 
Search instead for 
Did you mean: 

Sap pi udf to accept the external namespace

Former Member
0 Kudos

Hi All,

we have a scenario of JMS to IDOC. In which the source xml is of format

Actual xml

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

-<XTB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Namespace in PI">

<element>

</element>

</XTB>

The above xml is to be changed to the below format

Expected xml

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

<ns0:MT_XTB xmlns:ns0="Namespace in PI">

<element>

</element>

</ns0:MT_XTB>

Please help me in handling the above scenario.Do we need any udf ?If udf is to be used please provide the udf.I am new to SAP PI.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

What's ur exact issue? Message type name (hope it's not a typo) or is it namespace which is causing issue?

BTW, to adjust namespace and make it according as per ur request message u can delete the "XML Namespace" from the Message type. And regarding ur message type name u have to make it as per ur request message - No other simple alternative.

Thanks

Amit Srivastava

Former Member
0 Kudos

Hello All,

Exact issue is the xml from MQ is coming with namespace

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

-<ELB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="Namespace in PI">

When it comes to PI it throws runtime exception.The xml expected is

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

<ns0:MT_ELB xmlns:ns0="Namespace in PI">.

If I change the message type name still the issue persists .I am facing the issue with namespace.please help

Former Member
0 Kudos

Hello,

Did u read my reply?

Try to delete the "XML Namespace" section from the Message type and then check?

Thanks

Amit Srivastava

Answers (1)

Answers (1)

former_member184720
Active Contributor
0 Kudos

MT_XTB  is the message type name. I don't think you can change it dynamically(unless you go for java mapping).


You can just create the message type name as "XTB"


Why don't you create your source structure according to the source xml from JMS system. There are many tools which can create xsd based on xml?



Former Member
0 Kudos

Hi Hareesh,

How we can adjust the namespace as per the source xml.

Thanks in advance.

Ramyaswetha

former_member184720
Active Contributor
0 Kudos

Just search for "xml to xsd" in google and upload your xml which will generated xsd for you.

You just need to import it into PI.

Former Member
0 Kudos

Thanks Amit and Hareesh.

After removing the xml Namepsace in Message Type it is passing through PI.