+ Start a Discussion
visualforce_devvisualforce_dev 

Error on creating Apex from WSDL

I am getting this error while creating apex from WSDL.

 

Apex generation failed.

Error message:

Error: Unable to find schema for element; calculateFibonacciRangeReturn
 
where  'calculateFibonacciRangeReturn' is a method in the WSDL.
 
parsing is done with 0 errors,0 warnings, but next step generate apex is giving this error.
 
This WSDL is created from a java package using axis. Then I changed the type to document/literal.
 
 
cheenathcheenath

Can you please post the wsdl?

 

 

visualforce_devvisualforce_dev

Hi Cheenath,

 

here is the wsdl, this one is for a simple java pgm to find the fib series of a number.

 

 

<?xml version="1.0" encoding="UTF-8"?> <wsdl:definitions targetNamespace="urn:fibonacci" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="urn:fibonacci" xmlns:intf="urn:fibonacci" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <!--WSDL created by Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)--> <wsdl:types> <schema targetNamespace="urn:fibonacci" xmlns="http://www.w3.org/2001/XMLSchema"> <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/> <complexType name="ArrayOf_xsd_int"> <complexContent> <restriction base="soapenc:Array"> <attribute ref="soapenc:arrayType" wsdl:arrayType="xsd:int[]"/> </restriction> </complexContent> </complexType> </schema> </wsdl:types> <wsdl:message name="calculateFibonacciRangeResponse"> <wsdl:part name="calculateFibonacciRangeReturn" type="impl:ArrayOf_xsd_int"/> </wsdl:message> <wsdl:message name="calculateFibonacciRequest"> <wsdl:part name="in0" type="xsd:int"/> </wsdl:message> <wsdl:message name="calculateFibonacciRangeRequest"> <wsdl:part name="in0" type="xsd:int"/> <wsdl:part name="in1" type="xsd:int"/> </wsdl:message> <wsdl:message name="calculateFibonacciResponse"> <wsdl:part name="calculateFibonacciReturn" type="xsd:int"/> </wsdl:message> <wsdl:portType name="Fibonacci"> <wsdl:operation name="calculateFibonacci" parameterOrder="in0"> <wsdl:input message="impl:calculateFibonacciRequest" name="calculateFibonacciRequest"/> <wsdl:output message="impl:calculateFibonacciResponse" name="calculateFibonacciResponse"/> </wsdl:operation> <wsdl:operation name="calculateFibonacciRange" parameterOrder="in0 in1"> <wsdl:input message="impl:calculateFibonacciRangeRequest" name="calculateFibonacciRangeRequest"/> <wsdl:output message="impl:calculateFibonacciRangeResponse" name="calculateFibonacciRangeResponse"/> </wsdl:operation> </wsdl:portType> <wsdl:binding name="fibonacciSoapBinding" type="impl:Fibonacci"> <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <wsdl:operation name="calculateFibonacci"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="calculateFibonacciRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:fibonacci" use="encoded"/> </wsdl:input> <wsdl:output name="calculateFibonacciResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:fibonacci" use="encoded"/> </wsdl:output> </wsdl:operation> <wsdl:operation name="calculateFibonacciRange"> <wsdlsoap:operation soapAction=""/> <wsdl:input name="calculateFibonacciRangeRequest"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:fibonacci" use="encoded"/> </wsdl:input> <wsdl:output name="calculateFibonacciRangeResponse"> <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:fibonacci" use="encoded"/> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="FibonacciService"> <wsdl:port binding="impl:fibonacciSoapBinding" name="fibonacci"> <wsdlsoap:address location="http://localhost:8080/axis/services/fibonacci"/> </wsdl:port> </wsdl:service> </wsdl:definitions>

 

 its throwing error while parsing in sfdc "Error: Failed to parse wsdl: attribute name can not be null at: 11:70"

 

even if we change the schema tag, it will show some error in the next step ie 'generate apex'

 

 

 

LordLord

This WSDL is in RPC/encoded format. Right now salesforce is not accepting wsdl's with this format. You can do one thing. Rewrite the whole WSDL in document/literal/wrapped format. Consider this option only if it's a small file or ask the WSDL provider if they have other WSDL with document/literal format.

 

Thanks,

Anil.