I have generated a WSDL for an Apex webservice i have created and trying to call it from a webpage in VS2010. After adding this as reference i am getting the following error

Error 1 Unable to import binding 'getLeadInfoBinding' from namespace 'http://soap.sforce.com/schemas/class/getLeadInfo'. App_WebReferences/WebReference/

The following is the WSDL i am trying to add https://drive.google.com/file/d/0B0ju6ZFh_3TSaDZzQVNsa2lOV1E/view?usp=sharing

Please help!

  • This tool wsdl-analyzer.com thinks the WSDL is OK. Perhaps you should post the question on a VisualStudio forum.
    – Keith C
    Oct 15, 2014 at 12:26
  • Are you adding a service reference or a web reference? Oct 15, 2014 at 15:58
  • Daniel.... i am doing Add Service Reference -> Advanced -> Add Web Reference. Oct 15, 2014 at 16:24

1 Answer 1


UPDATE: There is now a known issue for this that you can track "Generate WSDL" generates a WSDL that does not contain the definition of the compound types address and location if API version is 30.0 or above

I tried adding it myself as a web reference. This is the message I got:

Custom tool error: Unable to import WebService/Schema.
Unable to import binding 'getLeadInfoBinding' from namespace 'http://soap.sforce.com/schemas/class/getLeadInfo'.
Unable to import operation 'getLeadAddressByEmail'.
The datatype 'http://soap.sforce.com/schemas/class/getLeadInfo:address' is missing.

Note that the last part here is important. It is telling you that there is no element named address defined in the tns namespace. The tns namespace is set to "http://soap.sforce.com/schemas/class/getLeadInfo".

You will need to add a complex type for address.

<!-- Compound datatype: Address -->
<xsd:complexType name="address">
    <xsd:extension base="tns:location">
        <xsd:element name="city" type="xsd:string"  nillable="true" />
        <xsd:element name="country" type="xsd:string"  nillable="true" />
        <xsd:element name="countryCode" type="xsd:string"  nillable="true" />
        <xsd:element name="postalCode" type="xsd:string"  nillable="true" />
        <xsd:element name="state" type="xsd:string"  nillable="true" />
        <xsd:element name="stateCode" type="xsd:string"  nillable="true" />
        <xsd:element name="street" type="xsd:string"  nillable="true" />

<!-- Compound datatype: Location -->
<xsd:complexType name="location">
    <xsd:element name="latitude" type="xsd:double"  nillable="true" />
    <xsd:element name="longitude" type="xsd:double"  nillable="true" />

What release is the Org that you generated the Org on? It seems like a bug that they didn't include the required complex types for address and location.

I've raised this on the developer forum to see if will get picked up as a bug. Salesforce generated WSDL for Apex webservice missing address complex type

  • Daniel... thank you very much that fixed the issue. Unfortunately the complete error i am getting if what i have posted was not getting the datatype missing error. I have generated the file in Salesforce test environment Discover Summer 14 environment Oct 16, 2014 at 7:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .