You need to sign in to do that
Don't have an account?
GregThoen
Here is the relevant portions of the WSDL changed so that it does NOT work:
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:
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>.
Apex cannot parse wsdl
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
Greg
Thanks,
Hi,
Here's a stripped-down small wsdl that exhibits the apparent bug:
This WSDL works:
Note that the only difference in the two WSDL's is that the TestResponse xml element has either an "all" or a "sequence" of elements underneath it. Both tags allow all of the nested xml elements to be contained there, the "all" and "sequence" tags just determine whether those nested xml elements are ordered or not.
1. WSDL parser is not checking for "all" correctly. I will file a bug for this. So please use sequence.
2. TestResponse complex type in the WSDL contains two elements. This is not supported.
Apex can only return one return type, so sfdc only supports doc/literal/wrapped style of service.
<xsd:element name="TestResponse">
<xsd:complexType>
<xsd:all>
<xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
<xsd:element name="cell" type="ns1:Cell" maxOccurs="1" minOccurs="0"/>
</xsd:all>
</xsd:complexType>
</xsd:element>
If you have control over the wsdl, please change it to use sequence and wrap the TestResponse to
a wrapper that contains status and cell. eg:
<xsd:element name="TestResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="result" type="ns1:TestCallResult" minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="TestCallResult">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/>
<xsd:element name="cell" type="ns1:Cell" maxOccurs="1" minOccurs="0"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
HTHs,
Thanks - that's what I needed to know. I think it's a shame that Apex requires wrapped responses, as it just makes things more verbose for other consumers of the wsdl, but that's a different issue. :)
Thanks,
Greg
Could you please take a look and let us know what is going on here?
And here is the complete wsdl used to generate the above Apex classes:
And the rest of the wsdl:
You can go to the "System Log" link on the top of the page and execute the web service method.
If you set the log level to CALLOUT, you can see the request and response XML that callout sends.
Manoj,
The problem is that the Apex code that is being generated from the wsdl doesn't include the necessary fields to make any calls. For example, notice that the "Search" contains cellsToPopulate, searchByCells, numPerPage, pageInfo, andOrType and orderByCell. However, none of these show up in the Search class in the generated InfopiaWebservicesTypes.cls.
Any idea why?
Thanks,
Jon
"Search" is using xsd:any and this is causing trouble with wsdl2apex.
I will file this bug. Hope this will be fixed in the next release.
Apex generation failed.
Error message:Error: Unsupported WSDL. Operation 'updateEntitlementLineItem' has more than one output element.
I believe this is the part of the WSDL that may be generating the error. But it looks like what you've posted.
only have one element for the response complex type.
HTHs,
Any idea when this issue will be resolved? We’re release some really cool web services functionality and it would be incredible to be able to take advantage of them in Salesforce!
Thanks,
Jon
Cheenath,
I assume the SOAP response has to be wrapped in an additional tag as well?
In your example below, in addition to modifying WSDL, the Web service implementation must be modified so that it returns the following response.
<TestResponse>
<TestCallout>
</TestCallout>
<TestResponse>
2. TestResponse complex type in the WSDL contains two elements. This is not supported. Apex can only return one return type, so sfdc only supports doc/literal/wrapped style of service. <xsd:element name="TestResponse"> <xsd:complexType> <xsd:all> <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/> <xsd:element name="cell" type="ns1:Cell" maxOccurs="1" minOccurs="0"/> </xsd:all> </xsd:complexType> </xsd:element> If you have control over the wsdl, please change it to use sequence and wrap the TestResponse to a wrapper that contains status and cell. eg: <xsd:element name="TestResponse"> <xsd:complexType> <xsd:sequence> <xsd:element name="result" type="ns1:TestCallResult" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:element> <xsd:element name="TestCallResult"> <xsd:complexType> <xsd:sequence> <xsd:element name="status" type="ns1:Status" minOccurs="1" maxOccurs="1"/> <xsd:element name="cell" type="ns1:Cell" maxOccurs="1" minOccurs="0"/> </xsd:sequence> </xsd:complexType> </xsd:element>
I am having the same error while using Fedex webservice WSDL.
Operation getRates has more than one output element. Below is the partof WSDL that has getRates method. Pleae have a look and help me.
<operation name="getRates" parameterOrder="RateRequest">
<input message="ns:RateRequest"/>
<output message="ns:RateReply"/>
</operation>
xs:complexType name="RateReply">
<xs:sequence>
<xs:element minOccurs="1" name="HighestSeverity" type="ns:NotificationSeverityType">
<xs:annotation>
<xs:documentation>This indicates the highest level of severity of all the notifications returned in this reply</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element maxOccurs="unbounded" minOccurs="1" name="Notifications" type="ns:Notification">
<xs:annotation>
<xs:documentation>The descriptive data regarding the results of the submitted transaction.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element minOccurs="0" name="TransactionDetail" type="ns:TransactionDetail">
<xs:annotation>
<xs:documentation>Descriptive data for this customer transaction. The TransactionDetail from the request is echoed back to the caller in the corresponding reply.</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Version" type="ns:VersionId">
<xs:annotation>
<xs:documentation>Identifies the version/level of a service operation expected by a caller (in each request) and performed by the callee (in each reply).</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="RateReplyDetails" type="ns:RateReplyDetail" maxOccurs="unbounded" minOccurs="0">
<xs:annotation>
<xs:documentation>Rate information which was requested.</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:complexType>
Your RateReply should be wrapped in another type - it will be = TestCallResult in example above.
You need to create another type similar to "TestResponse" above which wraps your RateReply.