cancel
Showing results for 
Search instead for 
Did you mean: 

XML validation in SAP MII Workbench alters XML structure

Former Member
0 Kudos

Working with MII 14 SP5 Patch 3 we found that if we check the “Validate XML on execution” ONLY for outputs the xml created is the same as MII 12. The inputs does not matter if you check the validation or not. But, what we found is that if this validation give us an error if we run the web service with SoapUI or directly with the external application that was using the web service using MII 12, this is the error:

<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>

      <soap:Fault>

<faultcode>soap:Client</faultcode>

         <faultstring>Transaction threw an unrecoverable exception:</faultstring>

      </soap:Fault>

   </soap:Body>

</soap:Envelope>

If the validation is removed the transaction runs fine but the xml is different.

This is a portion of the xml with the validation checked:

<s:complexType name="Row">

     <s:sequence id="RowSequence">

          <s:element name="OT_GET_ORDERS" minOccurs="1" maxOccurs="1">

              <s:complexType>

                    <s:sequence>

                             <s:element ref="mii0:O_GET_ORDERS"/>

                    </s:sequence>

               </s:complexType>

          </s:element>

          <s:element name="OT_GET_ORDERS_MESSAGES" minOccurs="1" maxOccurs="1">

               <s:complexType>

                    <s:sequence>

                         <s:element ref="mii0:O_GET_ORDERS_MESSAGES"/>

                    </s:sequence>

               </s:complexType>

          </s:element>

     </s:sequence>

</s:complexType>


This is the portion of the xml with no validation checked:

<s:complexType name="Row">

     <s:sequence id="RowSequence">

          <s:element name="OT_GET_ORDERS" type="s:string" minOccurs="1" maxOccurs="1"/>

          <s:element name="OT_GET_ORDERS_MESSAGES" type="s:string" minOccurs="1" maxOccurs="1"/>

</s:sequence> </s:complexType>


I haven't found documentation about, and I need to understand why this validation only affect the output and not the inputs that uses XSD.

I appreciate your help.

Nancy Rocha

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Nancy,

When the transaction does not work what error is logged in Netweaver logs?

Regards,
Anushree

Former Member
0 Kudos

Hi Anushree

Here you will find the logs attached.

Former Member
0 Kudos

Hi Nancy,

The error here is pretty self explanatory. In your XML there is an element named OT_MES_ORDERS whereas the XSD has no such declarations. This is the reason MII throws an error.

Regards,

Anushree

Former Member
0 Kudos

Hi Anushree

OT_GET_ORDERS and OT_GET_ORDERS_MESSAGES are outputs of the transaction, which are linked to elements in the XSD named O_GET_ORDERS and O_GET_ORDERS_MESSAGES as you can see in the following snapshot:

But following your recommendation, I renamed the outputs to be the same as the element name, I mean, to O_GET_ORDERS and O_GET_ORDERS_MESSAGE, but the transaction is showing the same error, but also I see an error about Premature end of file:

Former Member
0 Kudos

Hi Nancy,

The property name has nothing to do with this error. The error is caused due to XML content. Can you attach your XML and XSD here?

You can trace the XML which gets generated from the transaction in the logs and see where exactly XML does not conform to XSD.

Regards,

Anushree

Former Member
0 Kudos

Hi Anushree

Here you can see the XML and the XSDs, it uses 2 XSD.

The XML is created using WSDLGen.

Thanks!

Former Member
0 Kudos

Hi Nancy,

Your reply is a bit confusing. What you have attached here is the WSDL file for calling a transaction as a web service not the XML files produced by your transaction.

We need to look at the XML Input and Output files produced by the transaction to see where the compliance fails and the transaction gives errors.

Regards,
Anushree

Former Member
0 Kudos

Hi Nancy,

Please check SAP note 2010228. Can you please tell us what your transaction is doing

Regards,

Anushree

Former Member
0 Kudos

Hi Anushree

I reviewed the note but it just mention that the if check Validate XML on execution the output will be validated.

In the example provided the transaction get information about the order through a JCO connection, but for all the transactions we have with output from XSD we have the same issue.

I appreciate your help to find out why the xml structure changes if the check is selected, and if not, why the transaction doesn't work.