cancel
Showing results for 
Search instead for 
Did you mean: 

Empty namespace in XML automatically removed in SAP MII

Former Member
0 Kudos

Hi,

I need to built up a SOAP XML with empty namespaces for specific elements (structure SOAP, see attachment 1). For the dynamic part of this SOAP (nonConformance1 tags) I use an MII repeater to append the main XML SOAP with local XMLs (attachment 2), because the number of nonConformance1 tags is dyncamic (0 to multiple in one SOAP message). These nonConformance1 tags need to have a namespace which is empty (required by the target destination which is an automatic warehouse application) => xmlns="". I tried to make a local XML with default an empty namespace, but for some kind of reason an empty namespace is removed by SAP MII. I use version 12.2. Does anyone have an idea why empty namespaces are removed automatically or knows if there is a setting in MII or Netweaver to switch this off?

I also tried a different approach by using an XSLT transformation which should add the empty namespaces to the SOAP XML. I've tested this in other environments (ex. Notepath++) and in these environments I got the correct output required. However, when I implemented the logic in SAP MII, the empty namespaces were removed again. I tried with a filled in namespace as well, and this was created correct in MII, only the empty ones Always dissapear.

Any suggestion how to solve this? How can I force MII to keep empty namespaces in place?

For the XSLT scenario the input XML, output XML and XSL script can be found in attachment 3

Kr,

Accepted Solutions (1)

Accepted Solutions (1)

former_member185280
Active Contributor
0 Kudos
Former Member
0 Kudos

Hi Christian,

I tried with the AutoAppendBlankNameSpaces attribute of the transaction. Originally it was already set to true, but I tried with false as well. No difference unfortunately

Kr,

former_member185280
Active Contributor
0 Kudos

Ok. Make sure you are at SP 7 or greater if you haven't already.

Regards,
Christian

Former Member
0 Kudos

Good to know. Currently we are at MII 12.2 SP6. For now I've made a workaround to be able to continu in production. Upgrading to MII 15 is planned this year

Thanks

Answers (1)

Answers (1)

swaroop_anasane
Active Contributor
0 Kudos

Hi Bram,

Below is what has worked for me.

- A transaction with xml property, master = xml in attach1.

- Another aml property, conf = <nonConformance1 xmlns=""/>

- Repeater(a have used for loop for test) and

- Assignment logic:

          Local.master Append XML Local.conf

The output is:

    

<?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

  <soap:Body>

    <ReelData xmlns="AutostoreSOAPInterface">

      <rollNumber xmlns=""/>

      <materialCode xmlns=""/>

      <materialDescription xmlns=""/>

      <batch xmlns=""/>

      <plant xmlns=""/>

      <grade xmlns=""/>

      <substance xmlns=""/>

      <subgrade xmlns=""/>

      <substandard xmlns=""/>

      <width xmlns=""/>

      <diameter xmlns=""/>

      <diameterPlanned xmlns=""/>

      <diameterMin xmlns=""/>

      <diameterMax xmlns=""/>

      <weight xmlns=""/>

      <salesOrder xmlns=""/>

      <salesOrderItem xmlns=""/>

      <stockCategory xmlns=""/>

   <nonConformance1/>

  </ReelData>

  </soap:Body>

<nonConformance1 xmlns=""/>

    <nonConformance1 xmlns=""/>

    <nonConformance1 xmlns=""/>

</soap:Envelope>

Is this only what you need?

Let me know how are you trying to assign xml to main xml. A screen shot of transaction would be more helpful.

Thanks and Regards,

Swaroop

Former Member
0 Kudos

Hi Swaroop,

the nonConfomance1 tags should come within the ReelData tag. In the SOAP there is only one mentioned, but in the transaction this one is not in, but the nonConformance 1 tags are indeed appended inside the ReelData with a repeater.

The issue I have is that when defining a local XML for the nonConformance1 part to append, and I add an empty namespace xmlns="" (<nonConformance1 xmlns="" />), when saving and opening the local XML property again, the namespace was deleted automatically from the local XML. Apparently for you this local property assignment with empty namespace does work?

Below some screenshots of the transaction

swaroop_anasane
Active Contributor
0 Kudos

Hi Bram,

Yes, this local property with empty namespace did worked for me. As Christian suggested, it should be something to do with your SP version.

Anyways, great that you have a work around and yah you have 15.0 coming your way as well.

Warm Regards,

Swaroop