Find your content:

Search form

You are here

web service callout failed error


I'm having an issue with the Address Verification method available through StrikeIron. I imported the following WSDL and am using the generated wsdl2apex code.

The WSDL I'm using is here:

I'm calling the VerifyAddressUSA method like this(took out my real credentails):

StrikeIron.USAddressVerificationSoap stub= new StrikeIron.USAddressVerificationSoap();

        StrikeIron.VerifyAddressUSAResponse_element response = new StrikeIron.VerifyAddressUSAResponse_element();

        response=stub.VerifyAddressUSA('','MYEMAIL@MYDOMAIN.COM', 'PASSWORD', '1600 Pennsylvania Avenue', '', ' Washington, DC 20500', '', '', 'PROPER');

The error I'm getting is:

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

Any ideas on how to solve this? I'm not sure where the problem is.


EDIT(code for VerifyAddressUSA):

public StrikeIron.VerifyAddressUSAResponse_element VerifyAddressUSA(String UnregisteredUserEmail,String UserID,String Password,String AddressLine1,String AddressLine2,String CityStateZIPCode,String Firm,String Urbanization,String Casing) {
        StrikeIron.VerifyAddressUSA_element request_x = new StrikeIron.VerifyAddressUSA_element();
        StrikeIron.VerifyAddressUSAResponse_element response_x;
        request_x.UnregisteredUserEmail = UnregisteredUserEmail;
        request_x.UserID = UserID;
        request_x.Password = Password;
        request_x.AddressLine1 = AddressLine1;
        request_x.AddressLine2 = AddressLine2;
        request_x.CityStateZIPCode = CityStateZIPCode;
        request_x.Firm = Firm;
        request_x.Urbanization = Urbanization;
        request_x.Casing = Casing;
        Map<String, StrikeIron.VerifyAddressUSAResponse_element> response_map_x = new Map<String, StrikeIron.VerifyAddressUSAResponse_element>();
        response_map_x.put('response_x', response_x);
          new String[]{endpoint_x,
        response_x = response_map_x.get('response_x');
        return response_x;


 public class VerifyAddressUSAResponse_element {
        public StrikeIron.SIWsOutputOfUSAddress VerifyAddressUSAResult;
        public StrikeIron.SISubscriptionInfo SISubscriptionInfo;
        private String[] VerifyAddressUSAResult_type_info = new String[]{'VerifyAddressUSAResult','','SIWsOutputOfUSAddress','0','1','false'};
        private String[] SISubscriptionInfo_type_info = new String[]{'SISubscriptionInfo','','SISubscriptionInfo','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'','true','false'};
        private String[] field_order_type_info = new String[]{'VerifyAddressUSAResult','SISubscriptionInfo'};


public class VerifyAddressUSA_element {
        public String UnregisteredUserEmail;
        public String UserID;
        public String Password;
        public String AddressLine1;
        public String AddressLine2;
        public String CityStateZIPCode;  
    public String Firm;
    public String Urbanization;
    public String Casing;
    private String[] UnregisteredUserEmail_type_info = new String[]{'UnregisteredUserEmail','','string','0','1','false'};
    private String[] UserID_type_info = new String[]{'UserID','','string','0','1','false'};
    private String[] Password_type_info = new String[]{'Password','','string','0','1','false'};
    private String[] AddressLine1_type_info = new String[]{'AddressLine1','','string','0','1','false'};
    private String[] AddressLine2_type_info = new String[]{'AddressLine2','','string','0','1','false'};
    private String[] CityStateZIPCode_type_info = new String[]{'CityStateZIPCode','','string','0','1','false'};
    private String[] Firm_type_info = new String[]{'Firm','','string','0','1','false'};
    private String[] Urbanization_type_info = new String[]{'Urbanization','','string','0','1','false'};
    private String[] Casing_type_info = new String[]{'Casing','','CasingEnum','0','1','false'};
    private String[] apex_schema_type_info = new String[]{'','true','false'};
    private String[] field_order_type_info = new String[]{'UnregisteredUserEmail','UserID','Password','AddressLine1','AddressLine2','CityStateZIPCode','Firm','Urbanization','Casing'};

Attribution to: Phil B

Possible Suggestion/Solution #1

Sounds like the WSDL to APEX generator didn't properly generate the member: AddressLine1 in your response type. Or it gave it the wrong type.

The name of the class we need is called something like: VerifyAddressUSAResult (and it's parent class if any)

Attribution to: jordan.baucke

Possible Suggestion/Solution #2

Note, the following ideas won't directly solve your issue, but it may lead to the cause.

You could try a couple of thinks:

  1. Invoking the web service independently of Salesforce. This will help confirm that it is operating as you expect and that the crediantals are valid.
  2. Examining the callout request and response from the apex log

I've been using soapUI to invoke web services and verify the responses. After installing soapUI, import the WSDL into a new project.

soapUI project for strikeiron

You can then manually fill out the sample request and send it off.

This should help verify that the web service is responding as expected. E.g.

soapUI request and response

Next I would check the the CALLOUT_REQUEST and CALLOUT_RESPONSE that get logged in a developer edition org with calls to WebServiceCallout.invoke. It would be useful to compare these to the request and the response in soapUI.

For example, when I tried importing the WSDL and calling it with your example code and my credentials I got:


For what it is worth, I got the same error you did:

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element =AddressLine1

Class.wwwStrikeironCom.USAddressVerificationSoap.VerifyAddressUSA: line 471, column 1 AnonymousBlock: line 3, column 1

Attribution to: Daniel Ballinger
This content is remixed from stackoverflow or stackexchange. Please visit

My Block Status

My Block Content