+ Start a Discussion
soasoa 

Not able to Generate the Class from WSDL

Hello,
 
Trying to generate an Apex class from the following WSDL :
 
WSDL :
<—xml version="1.0"–>
<wsdl:definitions xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
 name="FLAMericaService"
 targetNamespace="http://fla.merica-us.net/coreBaseObjects"
 xmlns="http://schemas.xmlsoap.org/wsdl/"
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
 xmlns:tns="http://fla.merica-us.net" 
 xmlns:s="http://fla.merica-us.net/coreBaseObjects"
 xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
 xmlns:xml-soap="http://xml.apache.org/xml-soap">
 
 <wsdl:types>
  
  
  <xsd:schema elementFormDefault="qualified"
   targetNamespace="http://fla.merica-us.net/coreBaseObjects">
   <xsd:element name="GetHealthProfile">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1" name="name" type="s:TXLifeRequest"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   
   <xsd:element name="GetHealthProfileResponse">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1"
       name="GetHealthProfileResult" type="xsd:string"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   
   <!-- GetPrescriptionHistory starts here-->
   <xsd:element name="GetPrescriptionHistory">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1" name="TXLifeRequest" type="s:TXLifeRequest"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <xsd:element name="GetPrescriptionHistoryResponse">
    <xsd:complexType>
     <xsd:sequence>
      <xsd:element minOccurs="1" maxOccurs="1"
       name="GetPrescriptionHistoryResult" type="s:TXLifeResponse"/>
     </xsd:sequence>
    </xsd:complexType>
   </xsd:element>
   <!-- GetPrescriptionHistory ends here-->
   
  </xsd:schema>
  
  
  <s:schema xmlns="http://www.w3.org/2001/XMLSchema"
   xmlns:typens="urn:XXXXXAddressFetcher2"
   targetNamespace="http://fla.merica-us.net/coreBaseObjects">
   <import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
   
   <complexType name="TXLifeRequest">
    <all>
     <element name="OLifE" type="s:oLifE" nillable="true"/>
     <element name="TransRefGUID" type="string" nillable="true"/>
     <element name="TransType" type="int" nillable="true"/>
     <element name="TransExeDate" type="string" nillable="true"/>
     <element name="TransExeTime" type="string" nillable="true"/>
     <element name="TransMode" type="string" nillable="true"/>
     <element name="TestIndicator" type="int" nillable="true"/>
    </all>
   </complexType>
   
   <complexType name="TXLifeResponse">
    <all>
     <element name="TransResult" type="s:transResult"
      nillable="true"/>
     <element name="OLifE" type="s:oLifE" nillable="true"/>
     <element name="TransRefGUID" type="string" nillable="true"/>
     <element name="TransType" type="int" nillable="true"/>
     <element name="TransExeDate" type="string" nillable="true"/>
     <element name="TransExeTime" type="string" nillable="true"/>
     <element name="TransMode" type="string" nillable="true"/>
     <element name="TestIndicator" type="int" nillable="true"/>
     <element name="TXLifeResponseOLifEExtension"
      type="s:TXLifeResponseOLifEExtension" nillable="true"/>
    </all>
   </complexType>
   
..............  
... Deleted the detailed echma detail because of the limitation of size..
 <!-- GetHelloMsg messages starts here-->
 <wsdl:message name="GetHealthProfileSoapIn">
  <wsdl:part name="parameters" element="s:GetHealthProfile"/>
 </wsdl:message>
 <wsdl:message name="GetHealthProfileSoapOut">
  <wsdl:part name="parameters" element="s:GetHealthProfileResponse"/>
 </wsdl:message>
 
 <!-- GetHelloMsg messages ends here-->
 
 <!-- GetPrescriptionHistory messages starts here-->
 <wsdl:message name="GetPrescriptionHistorySoapIn">
  <wsdl:part name="parameters" element="s:GetPrescriptionHistory"/>
 </wsdl:message>
 <wsdl:message name="GetPrescriptionHistorySoapOut">
  <wsdl:part name="parameters" element="s:GetPrescriptionHistoryResponse"/>
 </wsdl:message>
 <!-- GetPrescriptionHistory messages ends here-->
 
 
 
 <!--  porttype starts here-->
 <wsdl:portType name="FlaMericaServiceSoap">
  
  <wsdl:operation name="GetHealthProfile">
   <wsdl:input message="s:GetHealthProfileSoapIn"/>
   <wsdl:output message="s:GetHealthProfileSoapOut"/>
  </wsdl:operation>
  
  <wsdl:operation name="GetPrescriptionHistory">
   <wsdl:input message="s:GetPrescriptionHistorySoapIn"/>
   <wsdl:output message="s:GetPrescriptionHistorySoapOut"/>
  </wsdl:operation>
  
  
 </wsdl:portType>
 <!-- porttype ends here-->
 
 
 <wsdl:binding name="FlaMericaServiceSoap" type="s:FlaMericaServiceSoap">
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http"
   style="document"/>
  <!-- GetHelloMsg operation starts here-->
  <wsdl:operation name="GetHealthProfile">
   <soap:operation
    soapAction="http://localhost:8080/doclit/sample/services/FLAWebService/GetHelloMsg"
    style="document"/>
   <wsdl:input>
    <soap:body use="literal"/>
   </wsdl:input>
   <wsdl:output>
    <soap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
  <!-- GetHelloMsg operation ends here-->
  
  <!-- GetPrescriptionHistory operation starts here-->
  
  <wsdl:operation name="GetPrescriptionHistory">
   <soap:operation
    soapAction="http://localhost:8080/hannover/merica-us/services/FLAWebService/GetPrescriptionHistoryReport"
    style="document"/>
   <wsdl:input>
    <soap:body use="literal"/>
   </wsdl:input>
   <wsdl:output>
    <soap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
  
  <!-- GetPrescriptionHistory operation ends here-->
  
 </wsdl:binding> 
 
 
 <wsdl:service name="FlaMericaService">
  <wsdl:port name="FLAWebService" binding="s:FlaMericaServiceSoap">
   <soap:address
    location="http://localhost:8080/hannover/merica-us/services/FLAWebService"/>
  </wsdl:port>
 </wsdl:service>
 
</wsdl:definitions>

 
The WSDL is stored on my local hard disk ..
 
Force.come could parse the WSDL but while generating the code I got the following error :
Error: Unable to find complexType for {http://fla.merica-us.net/coreBaseObjects}TXLifeRequest
 
Am I missing some thing.
 
Thanks & Regrds
Sanghamitra
 
Best Answer chosen by Admin (Salesforce Developers) 
cheenathcheenath
It seems the generated classes are too big for Apex to handle. See if you can
trim down the wsdl to only the methods and types that you really need.

 

All Answers

SuperfellSuperfell
You have 2 separate schema elements, but they both have the same targetNamespace, I'm guessing that that's an issue. (just fold them into a single schema element)
soasoa
Hi
 
Many thanks for your prompt Response, restructuring the schema had solved the
problem.
 
However now I am getting the following error while generating the class.
 

The following generated class(es) have compilation errors:

Error: flaMericaUsNetCorebaseobjects


Error: Script too large: //Generated by wsdl2apex

public class flaMericaUsNetCorebaseobjects {
public class product {
... at -1:-1

Is there size restriction for the schema, the size of the wsdl is 51 k only..

Thanks & Regards,

Sanghamitra

cheenathcheenath
It seems the generated classes are too big for Apex to handle. See if you can
trim down the wsdl to only the methods and types that you really need.

 

This was selected as the best answer