Skip to Content
avatar image
Former Member

Empty namespace in XML automatically removed in SAP MII

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,

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jan 06, 2015 at 02:53 PM
    Add comment
    10|10000 characters needed characters exceeded

    • Former Member christian libich

      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

  • Jan 06, 2015 at 01:33 PM

    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

    Add comment
    10|10000 characters needed characters exceeded

    • 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