+ Start a Discussion
PleasePlease 

Unable to parse callout response. Apex type not found for element ....

Hi,

 

I can't figure out what is the cause of this error when i am trying to do a callout to a external webservice,

 

Whatever i try i keep getting this error....

 

I used wsdl2apex for a "Wrapped documet/literal" wsdl.

 

I'd like to know what is possible and what is not possible for use of the wsdl2apex feature...

 

The "unable to parse" problem.... is it something I can do something about or is salesforce unable to parse the response anyhow...???

 

Please tell me.... i am getting a bit frustrated on this matter because ist described as an easy to use feature.... 

 

 

This is the WSDL

 

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

<wsdl:definitions targetNamespace="http://soapserver.jsm.marktselect.com" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://soapserver.jsm.marktselect.com" xmlns:intf="http://soapserver.jsm.marktselect.com" 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 LANSA Integrator SOAP Wizard and Apache Axis version: 1.4 Built on Apr 22, 2006 (06:55:48 PDT)-->

 <wsdl:types>
  <schema elementFormDefault="qualified" targetNamespace="http://soapserver.jsm.marktselect.com" xmlns="http://www.w3.org/2001/XMLSchema">

   <element name="getAddress1">
    <complexType>
     <sequence>
      <element name="username" type="xsd:string"/>
      <element name="password" type="xsd:string"/>
      <element name="profileid" type="xsd:string"/>
      <element name="postal_code" type="xsd:string"/>
      <element name="house_number" type="xsd:string"/>
      <element name="country_code" type="xsd:string"/>
     </sequence>
    </complexType>
   </element>
   <element name="getAddress1Response">
    <complexType>
     <sequence>
      <element name="getAddress1Return" type="impl:GetAddress1_response"/>
     </sequence>
    </complexType>
   </element>
   <complexType name="GetAddress1_response">
    <sequence>
     <element name="address_city" nillable="true" type="xsd:string"/>
     <element name="address_house_number" nillable="true" type="xsd:string"/>
     <element name="address_postalcode" nillable="true" type="xsd:string"/>
     <element name="address_street" nillable="true" type="xsd:string"/>
     <element name="resultCode" nillable="true" type="xsd:string"/>
     <element name="resultMessage" nillable="true" type="xsd:string"/>
    </sequence>
   </complexType>
  </schema>
 </wsdl:types>

 <wsdl:message name="getAddress1Request">
  <wsdl:part element="impl:getAddress1" name="parameters"/>
 </wsdl:message>

 <wsdl:message name="getAddress1Response">
  <wsdl:part element="impl:getAddress1Response" name="parameters"/>
 </wsdl:message>

 <wsdl:portType name="AddressDirectServer2ServicePortType">
  <wsdl:operation name="getAddress1">
   <wsdl:input message="impl:getAddress1Request" name="getAddress1Request"/>
   <wsdl:output message="impl:getAddress1Response" name="getAddress1Response"/>
  </wsdl:operation>
 </wsdl:portType>

 <wsdl:binding name="AddressDirectServer2ServiceBinding" type="impl:AddressDirectServer2ServicePortType">
  <wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
  <wsdl:operation name="getAddress1">
   <wsdlsoap:operation soapAction="getAddress1"/>
   <wsdl:input name="getAddress1Request">
    <wsdlsoap:body use="literal"/>
   </wsdl:input>
   <wsdl:output name="getAddress1Response">
    <wsdlsoap:body use="literal"/>
   </wsdl:output>
  </wsdl:operation>
 </wsdl:binding>

 <wsdl:service name="AddressDirectServer2ServiceService">
  <wsdl:port binding="impl:AddressDirectServer2ServiceBinding" name="AddressDirectServer2ServicePort">
   <wsdlsoap:address location="http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2"/>
  </wsdl:port>
 </wsdl:service>

</wsdl:definitions>

 

 

This is the "with succes and without any errors" created apex class from the wsdl

 

//Generated by wsdl2apex

public class AddressDirect {
    public class getAddress1_element {
        public String username;
        public String password;
        public String profileid;
        public String postal_code;
        public String house_number;
        public String country_code;
        private String[] username_type_info = new String[]{'username','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] password_type_info = new String[]{'password','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] profileid_type_info = new String[]{'profileid','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] postal_code_type_info = new String[]{'postal_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] house_number_type_info = new String[]{'house_number','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] country_code_type_info = new String[]{'country_code','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','profileid','postal_code','house_number','country_code'};
    }
    public class AddressDirectServer2ServicePort {
        public String endpoint_x = 'http://ccc.marktselect.nl/cgi-bin/jsmdirect?MSAddressDirect2';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://soapserver.jsm.marktselect.com', 'AddressDirect'};
        public AddressDirect.GetAddress1_response getAddress1(String username,String password,String profileid,String postal_code,String house_number,String country_code) {
            AddressDirect.getAddress1_element request_x = new AddressDirect.getAddress1_element();
            AddressDirect.getAddress1Response_element response_x;
            request_x.username = username;
            request_x.password = password;
            request_x.profileid = profileid;
            request_x.postal_code = postal_code;
            request_x.house_number = house_number;
            request_x.country_code = country_code;
            Map<String, AddressDirect.getAddress1Response_element> response_map_x = new Map<String, AddressDirect.getAddress1Response_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1',
              'http://soapserver.jsm.marktselect.com',
              'getAddress1Response',
              'AddressDirect.getAddress1Response_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.getAddress1Return;
        }
    }
    public class GetAddress1_response {
        public String address_city;
        public String address_house_number;
        public String address_postalcode;
        public String address_street;
        public String resultCode;
        public String resultMessage;
        private String[] address_city_type_info = new String[]{'address_city','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_house_number_type_info = new String[]{'address_house_number','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_postalcode_type_info = new String[]{'address_postalcode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] address_street_type_info = new String[]{'address_street','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultCode_type_info = new String[]{'resultCode','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] resultMessage_type_info = new String[]{'resultMessage','http://www.w3.org/2001/XMLSchema','string','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'address_city','address_house_number','address_postalcode','address_street','resultCode','resultMessage'};
    }
    public class getAddress1Response_element {
        public AddressDirect.GetAddress1_response getAddress1Return;
        private String[] getAddress1Return_type_info = new String[]{'getAddress1Return','http://soapserver.jsm.marktselect.com','GetAddress1_response','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://soapserver.jsm.marktselect.com','true','false'};
        private String[] field_order_type_info = new String[]{'getAddress1Return'};
    }
}

 

and this is the prototype

 

  • public class AddressDirect {
    • public class getAddress1Response_element {
      • public AddressDirect.GetAddress1_response getAddress1Return;
    • }
    • public class GetAddress1_response {
      • public String address_city;
      • public String address_house_number;
      • public String address_postalcode;
      • public String address_street;
      • public String resultCode;
      • public String resultMessage;
    • }
    • public class getAddress1_element {
      • public String country_code;
      • public String house_number;
      • public String password;
      • public String postal_code;
      • public String profileid;
      • public String username;
    • }
    • public class AddressDirectServer2ServicePort {
      • public String clientCert_x;
      • public String clientCertPasswd_x;
      • public String endpoint_x;
      • public MAP:String,String inputHttpHeaders_x;
      • public MAP:String,String outputHttpHeaders_x;
      • public Integer timeout_x;
      • public AddressDirect.GetAddress1_response getAddress1(String, String, String, String, String, String){};
    • }
  • }

 

 

who can tell me if i must continue my quest to get this working ??? Or am i trying the impossible?

 

 

Message Edited by Please on 05-06-2009 06:35 AM
PleasePlease
Hello.... anybody ....
Divya GoelDivya Goel

Hi,

 

Did you get the solution of this problem. If yes please let me know.

 

Thanks in advance.

 

Thanks.

Dhushyanth kumar KDhushyanth kumar K
Hi
I am also getting same problem please any one help us.