cancel
Showing results for 
Search instead for 
Did you mean: 

Namespace prefix issue in message mapping in PO 7.5

former_member305064
Participant
0 Kudos

HI Experts,

I'm facing namespace prefix issue in B2B Inbound scenario.

In my first flow message is splitting specific to interfaces and sending to EDI Separator sender channel.

In My second flow EDI Separator sender channel is converting the ANSI X12 to ANSI XML file and passing the data to message mapping and here the namespace prefix is ns only, but in the message mapping default instance it is showing as ns0. Bcz of this reason mapping is failing.

My observation is this error happend when my external definition is in different SWCV(Eventhough i have maintained the dependency in SLD). But when i place the same external definition in the same SWCV where my Service interface and mapping objects reside then mapping is executing perfectly(Even now i'm receiving prefix as ns from source and in the mapping it is ns0 but mapping executing without any errors).

Now i know how to fix the issue but my doubt is why it is failing when i'm referring different SWCV external definition?

Thanks,

Satish.

Accepted Solutions (1)

Accepted Solutions (1)

former_member305064
Participant

HI Experts,

Issue Resolved.

When i'm generating the XSD from the B2B cockpit, initially i gave the namespace under which i have to store in PI. But now when i'm generating the XSD i gave my Service interface namespace and stored in the different namespace which i mentioned above.

Thank you very much for your inputs.

Thanks,

Satish.

Answers (4)

Answers (4)

former_member305064
Participant
0 Kudos

HI Experts,

After closely comparing i found one more thing. My service interface, Message mapping and Operation mapping resides under this namespace http://test.com, SWCV A and my external definition resides under this namespace http://Unilver.com/XI/ANSI_X12, SWCV B.

In my incoming payload i can see the namespace as http://test.com but in the message mapping default instance in the test tab namespace is http://Unilver.com/XI/ANSI_X12. Because of this reason mapping is failing not with the prefix.

1) Now why the incomoing payload not taking the External definition namespace instead it is taking Service interface namespace, but in the service interface i'm maintaining the external definition only with the namespace http://Unilver.com/XI/ANSI_X12.

2) If the point 1 is as per PI pipelines then i have to go to XSLT mapping or XMLAnnomizer bean to change the Service interface namespace to my external definition namespace .

marksmyth
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Satish,

SAP note 2350224 SAP JVM 8.1 Patch Collection 23 (build 8.1.023), documents a change to how namespace values are handled. I suspect this is related to the issue you have mentioned here.

This change comes to fix this official JDK bug: https://bugs.openjdk.java.net/browse/JDK-8162598. After this change, the default namespace of XSL templates is handled correctly (previously it was not!). According to the w3.org documentation, an empty string cannot be used as a namespace name (see http://www.w3.org/TR/xml-names/#iri-use).

In this case, you may need to add xmlns="http://<your_namespace>" to the xsl's xsl:stylesheet tag, e.g. like this:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://<your_namespace>"

Regards
Mark

former_member305064
Participant
0 Kudos

Hello Mark,

Thanks for the reply. Here my JVM version is 8.1.029.

However i want to try your suggestion but where is need to add this xmlns="http://<your_namespace>" to the xsl's xsl:stylesheet tag, e.g. like this:

http://www.w3.org/1999/XSL/Transform"; xmlns="http:// ".

Do i need to write the XSLT code to change the namespace and there i have to use this or in the External definition(XSD File) itself i have to add this?. Below is my XSD structure. In the below structure i can see after target namespace there is one more tag that you mentioned. Do i need to remove the target namespace and keep only the xmlns tag?

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

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://sap.com/xi/ProcureToPayInt/IC" xmlns:x12="http://sap.com/xi/ProcureToPayInt/IC"> <xsd:complexType name="ASC944_005010">

---

--

<xsd:element name="ASC944_005010" type="x12:ASC944_005010"/>

</xsd:schema>

Thanks,

Satish.

Former Member
0 Kudos

What is the error message?

former_member305064
Participant
0 Kudos

I have mapped the source main segment to the idoc main segment. below is the error . But i can see source field coming from the payload.

Cannot create target element /MBGMCR03. Values missing in queue context. Target XSD requires a value for this element, but the target-field mapping does not create one. Check whether the XML instance is valid for the source XSD, and whether the target-field mapping fulfils the requirement of the target XSD,

Former Member
0 Kudos

Hi Satish,

I believe it could not be due to the namespace prefix, just because it is irrelevant what is the prefix, important is the namespace. Prefix is just its shortcut...

So If I understand correctly, you have defined a Service Interface in a Software Component A and would like to use a external definition for this Service Interface from Software Component B... Perhaps just check if your dependency in ESR are maintain, like here for C4C Content...

Here you should be able to use in COD_ERP_INT_IC External Definition from COD_ERP_INT...

Best regards,

Milan

former_member305064
Participant
0 Kudos

HI Milan,

Thanks for the reply. Here i'm maintaining the dependency correctly. Please find the below screenshot. My external definition is in Common SWCV and my Service interface and mapping objects are in UPS SWCV. Please share some more thoughts on this..