cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with xml file without namespace

Former Member
0 Kudos

Hi experts,

hope i have an easy question 4 you.

PI 7.1, i'm trying to bring a simple scenario to run: XML file -> (File Adapter) -> PI -> (File Adapter) -> csv file.

My Problem is that the xml file has no namespace and this produces an error in PI:

Runtime exception occurred during application mapping com/sap/xi/tf/_MM_BlaBla_; com.sap.aii.mappingtool.tf7.IllegalInstanceException: Cannot create target element /ns0:MT_BlaBla_TGT. Values missing in queue context. Target

If I put namespace manually in the xml file, the scenario works fine.

After search for help, i had removed the namespace from the message type in the IR/ESB but this had no postive effect. I'll get an error without namespace in the file and it work's with the namespace.

Thanks for advice!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

HI ,

in File Sender communication channel.. on Content Conversion tab have you provided namespace to field "Document namespace"..

Thanks,

Bhupesh

Answers (5)

Answers (5)

Former Member
0 Kudos

Although the problem is already solved, here comes the clean solution:

In message type definition right below the data type specification there is a field called target namespace. this is filled by default. If your xml comes w/o namespace empty the field and it works.

Former Member
0 Kudos

Hi Andreas,

After search for help, i had removed the namespace from the message type in the IR/ESB but this had no postive effect. I'll get an error without namespace in the file and it work's with the namespace.

deleting standard xml namespace in message type was my first try but it doesn't worked. So i must took the "dirty" way because running out of time...

Former Member
0 Kudos

Not a really clean solution, working without Data and Message Types but it was a quick solution.

Former Member
0 Kudos

Hi,

Write a small xsl mapping for adding the xml namespace tag, before the graphical mapping being executed.

please follow below for the code..assuming the namespace as "MT_Source"

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

<xsl:stylesheet version="1.0"

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

<xsl:output method="xml" encoding="UTF-8"/>

<xsl:template match="/">

<ns0:MT_Source xmlns:ns0="um:sap.com">

<xsl:copy-of select="." />

</ns0:MT_Source>

</xsl:template>

</xsl:stylesheet>

Thanks,

Ramana

Former Member
0 Kudos

Thank you all for your suggestions. I'll got an tip from another PI Developer that works.

In Message Mapping where you can choose your Source Message Type you can also import XSD or XML-Files. So i select one of my example-xml-files without any namespace, complete the mapping and it works.

Not a really clean solution, working without Data and Message Types but it was a quick solution.

Regards,

Kay

Former Member
0 Kudos

Hi,

Please check if you have "No validation" option selected in your sender agreement.

If it still dosen't work, either you need to convince the sender to include the namespace in the xml or go for a custom adapter module in the sender adapter where you can include the namespace in the payload.

In the custom module, search for the start tag of your xml and include the namespace definition after the start tag.

Regards

former_member472138
Active Contributor
0 Kudos

How does your input comes, with namespace or without namespace?

If your input comes without namespace then edit your input structure and use it as external definition.

Regards

Pothana