+ Start a Discussion
Maros SitkoMaros Sitko 

WSDL 2 apex problem with extension

Hi, I do not know how to resolve issue with extension in wsdl

this is part of wsdl

<complexType name="Contact">
  <annotation>
   <documentation>...</documentation>
  </annotation>
<complexContent>
<extension base="tns:BaseContact">
 <sequence>
  <element maxOccurs="1" minOccurs="0" name="id" type="xsd:long">
    <annotation>
     <documentation>...</documentation>
    </annotation>
  </element>
  <element maxOccurs="1" minOccurs="0" name="name" type="xsd:string">
    <annotation>
      <documentation>...</documentation>
    </annotation>
  </element>
.......

 salesforce wsdl2sfdc generate

public class Contact{
public String name;
private String[] name_type_info = new String[]{'name','https://....',null,'0','1','false'};
...
}

and 
public class BaseContact {
        public String BaseContact_Type;
        private String[] BaseContact_Type_type_info = new String[]{'BaseContact.Type','https://...',null,'0','1','false'};
        private String[] apex_schema_type_info = new String[]{'...','true','false'};
        private String[] field_order_type_info = new String[]{'BaseContact_Type'};
    }

 but it doesn't work, when I receive response form web service. Error message:

Web service callout failed: Unable to parse callout response. Apex type not found for element BaseContact.Type

 

Please, can anyone help me? I read some articles and tried many combinations, but it have not help me.

Do you have some documentation how to manualy write apex class from wsdl?

digamber.prasaddigamber.prasad

Hi,

 

Could you please change 

 

private String[] apex_schema_type_info = new String[]{'...','true','false'};

 

to

 

private String[] apex_schema_type_info = new String[]{'...','false','false'};

in generated stub class.

 

Please let me know if helps you!

 

Regards,

Digamber Prasad

 

 

Maros SitkoMaros Sitko
No it does not help
digamber.prasaddigamber.prasad

Could you please share wsdl @ digamberlucky@gmail.com, obviously if its not sensitive. I will try my hands on this.

 

Regards,

Digamber Prasad