0

world!

I'm trying to call via SOAP to a function called putRecogida.

When I execute it via SoapUI, it works perfectly, but when I loaded both classes into salesforce with apex2wsdl tool, both APEX classes generates an error:

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

when I try to use it.

The snippets are:

NacexSoapAPI.cls

public class NacexSoapAPI {
public class putRecogida {
    public String String_1;
    public String String_2;
    public String[] arrayOfString_3;
    private String[] String_1_type_info = new String[]{'String_1','urn:soap/types',null,'0','1','false'};
    private String[] String_2_type_info = new String[]{'String_2','urn:soap/types',null,'0','1','false'};
    private String[] arrayOfString_3_type_info = new String[]{'arrayOfString_3','urn:soap/types',null,'0','-1','false'};
    private String[] apex_schema_type_info = new String[]{'urn:soap/types','false','false'};
    private String[] field_order_type_info = new String[]{'String_1','String_2','arrayOfString_3'};
}
public class putRecogidaResponse {
    String[] return_x;
    private String[] return_x_type_info = new String[]{'return','urn:soap/types',null,'0','-1','false'};
    private String[] apex_schema_type_info = new String[]{'urn:soap/types','false','false'};
    private String[] field_order_type_info = new String[]{'return_x'};
}
public class nacexwsImplPort {
    public String endpoint_x = 'https://pda.nacex.com/nacex_ws/soap';
    public Map<String,String> inputHttpHeaders_x;
    public Map<String,String> outputHttpHeaders_x;
    public String clientCertName_x;
    public String clientCert_x;
    public String clientCertPasswd_x;
    public Integer timeout_x;
    private String[] ns_map_type_info = new String[]{'http://jaxb.dev.java.net/array', 'NacexJaxbDevArray', 'urn:soap/types', 'NacexSoapAPI'};

    public String[] putRecogida(String String_1,String String_2,String[] arrayOfString_3) {
        NacexSoapAPI.putRecogida request_x = new NacexSoapAPI.putRecogida();
        request_x.String_1 = String_1;
        request_x.String_2 = String_2;
        request_x.arrayOfString_3 = arrayOfString_3;
        NacexSoapAPI.putRecogidaResponse response_x;
        Map<String, NacexSoapAPI.putRecogidaResponse> response_map_x = new Map<String, NacexSoapAPI.putRecogidaResponse>();
        response_map_x.put('response_x', response_x);
        WebServiceCallout.invoke(
            this,
            request_x,
            response_map_x,
            new String[]{endpoint_x, // Endpoint
            '', // SOAP action
            'urn:soap/types', // request namespace
            'putRecogida', // request name
            'urn:soap/types', // response namespace
            'putRecogidaResponse', //  response name
            'NacexSoapAPI.putRecogidaResponse'} // response type
        );
        response_x = response_map_x.get('response_x');

        return response_x.return_x;
    }
}
}

NacexJaxbDevArray.cls

public class NacexJaxbDevArray {
        public class stringArray {
            public String[] item;
            private String[] item_type_info = new String[]{'item','http://jaxb.dev.java.net/array',null,'0','-1','true'};
            private String[] apex_schema_type_info = new String[]{'http://jaxb.dev.java.net/array','false','false'};
            private String[] field_order_type_info = new String[]{'item'};
        }
    }

You can find the WSDL I loaded into Salesforce here, but I think the relevant piece is putrecogida: WSDL Snap

Can anyone PLEASE tell me how can I work around it so I can get the response properly?

Thanks a lot in advance guys!

1 Answer 1

0

In the end, based on this previous answer, I've decided to read Daniel's post, where he recommends FuseIt SFDC Explorer. I've tried to upload my WSDL there, and it has generated a proper class that makes everything work!

Highly recommended!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.