cancel
Showing results for 
Search instead for 
Did you mean: 

WebService Transaction Output as XML with specified xsd

Former Member
0 Kudos


Hello,

my intention is to call a transaction from outside via soap web service with xml output. Therefore I defined a xml output variable. I provided a xsd for this output, chose myRowList as Element Name and marked Validate XML on Execution. Calling my web service I get an exception: Transaction threw an unrecoverable exception.  Here's my xsd:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
  xmlns:s0="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema">

  <xs:complexType name="myRowList">
    <xs:sequence>
      <xs:element name="MyTag1" type="xs:string" />
      <xs:element name="MyTag2" type="xs:string" />
      <xs:element name="MyTag3" type="xs:string" />
      <xs:element name="MyTag4" type="xs:string" />
    </xs:sequence>
  </xs:complexType>

  <xs:element name="myRowList">


    <xs:complexType>
      <xs:sequence>
        <xs:element name="Row" type="s0:myRowList" />
      </xs:sequence>
    </xs:complexType>
  </xs:element>
</xs:schema>

And this is my transaction output (generated via Test-Button inside MII):

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

<Row>

    <MyTag1>test</MyTag1>

    <MyTag2>test</MyTag2>

    <MyTag3>test</MyTag3>

    <MyTag4>test</MyTag4>

</Row>

I'm using MII 14.0 SP4 Patch1. What went wrong?

Thanks in advance,

Holger

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member193328
Active Participant
0 Kudos

Hi Holger

Can you check the NW logs to see what errors are being posted?

Can you post the related logs here?

Regards

Partha

Former Member
0 Kudos

Hello,

thanks for answering.

Both xsd-Files, my and the one from Rohit, leads to the following error:

Error while validating XML against XSD : cvc-elt.1: Cannot find the declaration of element 'Row'

@Rohit: I thought the output is checked against the Element I've choosen in the drop Box ElementName. So in my case I've choosen myRowList and the subelement is the element Row.

Regards,

Holger

Former Member
0 Kudos

Hi Holger,

Try this xsd:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
<xs:element name="Row">
  
<xs:complexType>
  
<xs:sequence>
  
<xs:element type="xs:string" name="MyTag1"/>
  
<xs:element type="xs:string" name="MyTag2"/>
  
<xs:element type="xs:string" name="MyTag3"/>
  
<xs:element type="xs:string" name="MyTag4"/>
  
</xs:sequence>
  
</xs:complexType>
 
</xs:element>
</xs:schema>


and select 'Row' in the selected Element Dropdown.

Also do not put the "<?xml version="1.0" encoding="utf-8"?>" XML tag in the xsd and save the file with extension.xsd


I tried and it worked for me.


Regards,

Rohit Negi.

Former Member
0 Kudos

Hi Holger,

Try this xsd:

<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified" xmlns:xs="http://www.w3.org/2001/XMLSchema">
 
<xs:element name="Row">
  
<xs:complexType>
  
<xs:sequence>
  
<xs:element type="xs:string" name="MyTag1"/>
  
<xs:element type="xs:string" name="MyTag2"/>
  
<xs:element type="xs:string" name="MyTag3"/>
  
<xs:element type="xs:string" name="MyTag4"/>
  
</xs:sequence>
  
</xs:complexType>
 
</xs:element>
</xs:schema>


and select row in the selected Element Dropdown.

Also do not put the "<?xml version="1.0" encoding="utf-8"?>" XML tag in the xsd and save the file with extension.xsd


I tried and it worked for me.


Regards,

Rohit Negi.

Former Member
0 Kudos

Hello,

the xsd described works well, on server side. On client side I get the following errors:

XSD: The location 'http://server:port/XMII/WSDLGen/db/path/myRowList.xsd' has not been resolved because the import is unused

XSD: Element reference 'http://schemas.xmlsoap.org/wsdl/#Row' is unresolved

On my client (Web Service Explorer in eclipse) I got the error message but can execute the web-service. But not every client is so fault-tolerant. What other issues have to be done that the call runs without problems?

Any hints are welcome.

Thanks for answering

Regards,

Holger

Former Member
0 Kudos

Hi Holger,

Your XML Output does not conform to the Schema you have given. This is why you are getting this exception.

According to your Schema the xml output should be in this format:

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

<myRowList>

  <Row>

    <MyTag1>str1234</MyTag1>

    <MyTag2>str1234</MyTag2>

    <MyTag3>str1234</MyTag3>

    <MyTag4>str1234</MyTag4>

</Row>

</myRowList>

If you want the xml output in the format you have mentioned in your question then change the schema to:

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

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"

  xmlns:s0="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.w3.org/2001/XMLSchema">

  <xs:element name="Row">

    <xs:complexType>

      <xs:sequence>

        <xs:element type="xs:string" name="MyTag1"/>

        <xs:element type="xs:string" name="MyTag2"/>

        <xs:element type="xs:string" name="MyTag3"/>

        <xs:element type="xs:string" name="MyTag4"/>

      </xs:sequence>

    </xs:complexType>

  </xs:element>

</xs:schema>

Regards,

Rohit Negi.