• GregThoen
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi,
 
I'm running into an issue where when I try to generate Apex code from WSDL, I get a message like:
 
Unsupported WSDL. Operation '[operation name]' has more than one output element
 
However,
 
The operation does not have more than one output element, so I'm not sure why it's saying this.  In fact, if I change an <all> to <sequence>, it accepts it just fine, even though clearly both <all> and <sequence> allow multiple elements underneath them.
 
Here is some specific portions of the WSDL that Apex can consume and generate code for:
 
Code:
    <xsd:element name="HeadersResponse">
      <xsd:complexType>
        <xsd:all>
           <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="headers" type="ns1:Headers"/>
        </xsd:all>
      </xsd:complexType>
    </xsd:element>

  <wsdl:message name="GetAvailableExportHeadersResponse">
     <wsdl:part name="GetAvailableExportHeadersResponse" element="ns1:HeadersResponse"/>
  </wsdl:message>

  <wsdl:operation name="GetAvailableExportHeaders">
     <wsdl:input name="GetAvailableExportHeadersRequest" message="GetAvailableExportHeadersRequest"/>
     <wsdl:output name="GetAvailableExportHeadersResponse" message="GetAvailableExportHeadersResponse"/>
  </wsdl:operation>

 
Here is the relevant portions of the WSDL changed so that it does NOT work:
 
Code:
    <xsd:element name="HeadersResponse">
      <xsd:complexType>
        <xsd:sequence>
           <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="headers" type="ns1:Headers"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>

  <wsdl:message name="GetAvailableExportHeadersResponse">
     <wsdl:part name="GetAvailableExportHeadersResponse" element="ns1:HeadersResponse"/>
  </wsdl:message>

  <wsdl:operation name="GetAvailableExportHeaders">
    <wsdl:input name="GetAvailableExportHeadersRequest" message="GetAvailableExportHeadersRequest"/>
    <wsdl:output name="GetAvailableExportHeadersResponse" message="GetAvailableExportHeadersResponse"/>
  </wsdl:operation>

 
Note that the ONLY change is that I changed <xsd:all> to <xsd:sequence>.  This would seem like a bug to me, as in both cases, an example of the response XML is the same:
 
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <axis2ns1:HeadersResponse xmlns:axis2ns1="MyNS">
         <axis2ns1:status>
            <axis2ns1:statusCode>300</axis2ns1:statusCode>
            <axis2ns1:statusMsg>Available headers retreived successfully.</axis2ns1:statusMsg>
         </axis2ns1:status>
         <axis2ns1:headers>
            <axis2ns1:header>
               <axis2ns1:headerId>*ORDER ID*</axis2ns1:headerId>
            </axis2ns1:header>
         </axis2ns1:headers>
      </axis2ns1:HeadersResponse>
   </soapenv:Body>
</soapenv:Envelope>

 
Note that a) it's the same SOAP no matter which way the wsdl is defined (it's just that order of elements could potentially be changed), and b) there is only one top-level response element (HeadersResponse in this case).  I normally wouldn't care, but the problem is that I would really like to be able to use XSD extension, which requires the use of <sequence> rather than <all>.
 
Thanks in advance,
Greg
Hi,
 
I'm running into an issue where when I try to generate Apex code from WSDL, I get a message like:
 
Unsupported WSDL. Operation '[operation name]' has more than one output element
 
However,
 
The operation does not have more than one output element, so I'm not sure why it's saying this.  In fact, if I change an <all> to <sequence>, it accepts it just fine, even though clearly both <all> and <sequence> allow multiple elements underneath them.
 
Here is some specific portions of the WSDL that Apex can consume and generate code for:
 
Code:
    <xsd:element name="HeadersResponse">
      <xsd:complexType>
        <xsd:all>
           <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="headers" type="ns1:Headers"/>
        </xsd:all>
      </xsd:complexType>
    </xsd:element>

  <wsdl:message name="GetAvailableExportHeadersResponse">
     <wsdl:part name="GetAvailableExportHeadersResponse" element="ns1:HeadersResponse"/>
  </wsdl:message>

  <wsdl:operation name="GetAvailableExportHeaders">
     <wsdl:input name="GetAvailableExportHeadersRequest" message="GetAvailableExportHeadersRequest"/>
     <wsdl:output name="GetAvailableExportHeadersResponse" message="GetAvailableExportHeadersResponse"/>
  </wsdl:operation>

 
Here is the relevant portions of the WSDL changed so that it does NOT work:
 
Code:
    <xsd:element name="HeadersResponse">
      <xsd:complexType>
        <xsd:sequence>
           <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
           <xsd:element name="headers" type="ns1:Headers"/>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:element>

  <wsdl:message name="GetAvailableExportHeadersResponse">
     <wsdl:part name="GetAvailableExportHeadersResponse" element="ns1:HeadersResponse"/>
  </wsdl:message>

  <wsdl:operation name="GetAvailableExportHeaders">
    <wsdl:input name="GetAvailableExportHeadersRequest" message="GetAvailableExportHeadersRequest"/>
    <wsdl:output name="GetAvailableExportHeadersResponse" message="GetAvailableExportHeadersResponse"/>
  </wsdl:operation>

 
Note that the ONLY change is that I changed <xsd:all> to <xsd:sequence>.  This would seem like a bug to me, as in both cases, an example of the response XML is the same:
 
Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <axis2ns1:HeadersResponse xmlns:axis2ns1="MyNS">
         <axis2ns1:status>
            <axis2ns1:statusCode>300</axis2ns1:statusCode>
            <axis2ns1:statusMsg>Available headers retreived successfully.</axis2ns1:statusMsg>
         </axis2ns1:status>
         <axis2ns1:headers>
            <axis2ns1:header>
               <axis2ns1:headerId>*ORDER ID*</axis2ns1:headerId>
            </axis2ns1:header>
         </axis2ns1:headers>
      </axis2ns1:HeadersResponse>
   </soapenv:Body>
</soapenv:Envelope>

 
Note that a) it's the same SOAP no matter which way the wsdl is defined (it's just that order of elements could potentially be changed), and b) there is only one top-level response element (HeadersResponse in this case).  I normally wouldn't care, but the problem is that I would really like to be able to use XSD extension, which requires the use of <sequence> rather than <all>.
 
Thanks in advance,
Greg