function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Scapelli77Scapelli77 

Apex type not found for element http://tempuri.org/=result

Hi,

I'm using this class generated by wsdl2apex

public class EAI_CallOutServices {
    public class Field {
        public String name;
        public String value;
        private String[] name_type_info = new String[]{'name','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] value_type_info = new String[]{'value','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'name','value'};
    }
    public class SoftResponse {
        public EAI_CallOutServices.Return_x outSoft;
        private String[] outSoft_type_info = new String[]{'outSoft','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSoft'};
    }
    public class SwitchInSLResponse {
        public EAI_CallOutServices.Return_x outSwitchInSL;
        private String[] outSwitchInSL_type_info = new String[]{'outSwitchInSL','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSwitchInSL'};
    }
    public class SwitchInSL {
        public EAI_CallOutServices.SendObj inSwitchInSL;
        private String[] inSwitchInSL_type_info = new String[]{'inSwitchInSL','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSwitchInSL'};
    }
    public class fieldsList {
        public EAI_CallOutServices.ArrayOfField Field;
        private String[] Field_type_info = new String[]{'Field','http://tempuri.org/','ArrayOfField','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'Field'};
    }
    public class Soft {
        public EAI_CallOutServices.SendObj inSoft;
        private String[] inSoft_type_info = new String[]{'inSoft','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSoft'};
    }
    public class SwitchInTT {
        public EAI_CallOutServices.SendObj inSwitchInTT;
        private String[] inSwitchInTT_type_info = new String[]{'inSwitchInTT','http://tempuri.org/','SendObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'inSwitchInTT'};
    }
    public class SalesForce_ws_provider_SalesForceCallOut_Port {
        public String endpoint_x = 'http://localhost:8081/ws/SalesForce.ws.provider:SalesForceCallOut';
        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://tempuri.org/', 'EAI_CallOutServices'};
        public EAI_CallOutServices.Return_x SwitchInTT(EAI_CallOutServices.SendObj inSwitchInTT) {
            EAI_CallOutServices.SwitchInTT request_x = new EAI_CallOutServices.SwitchInTT();
            EAI_CallOutServices.SwitchInTTResponse response_x;
            request_x.inSwitchInTT = inSwitchInTT;
            Map<String, EAI_CallOutServices.SwitchInTTResponse> response_map_x = new Map<String, EAI_CallOutServices.SwitchInTTResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_SwitchInTT',
              'http://tempuri.org/',
              'SwitchInTT',
              'http://tempuri.org/',
              'SwitchInTTResponse',
              'EAI_CallOutServices.SwitchInTTResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSwitchInTT;
        }
        public EAI_CallOutServices.Return_x SwitchInSL(EAI_CallOutServices.SendObj inSwitchInSL) {
            EAI_CallOutServices.SwitchInSL request_x = new EAI_CallOutServices.SwitchInSL();
            EAI_CallOutServices.SwitchInSLResponse response_x;
            request_x.inSwitchInSL = inSwitchInSL;
            Map<String, EAI_CallOutServices.SwitchInSLResponse> response_map_x = new Map<String, EAI_CallOutServices.SwitchInSLResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_SwitchInSL',
              'http://tempuri.org/',
              'SwitchInSL',
              'http://tempuri.org/',
              'SwitchInSLResponse',
              'EAI_CallOutServices.SwitchInSLResponse'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSwitchInSL;
        }
        public EAI_CallOutServices.Return_x Soft(EAI_CallOutServices.SendObj inSoft) {
            EAI_CallOutServices.Soft request_x = new EAI_CallOutServices.Soft();
            EAI_CallOutServices.SoftResponse response_x;
            request_x.inSoft = inSoft;
            Map<String, EAI_CallOutServices.SoftResponse> response_map_x = new Map<String, EAI_CallOutServices.SoftResponse>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'SalesForce_ws_provider_SalesForceCallOut_Binder_Soft',
              'http://tempuri.org/',
              'Soft',
              'http://tempuri.org/',
              'SoftResponse',
              'EAI_CallOutServices.SoftResponse'
              }
            );
            response_x = response_map_x.get('response_x');
            return response_x.outSoft;
        }
    }
    public class SFObj {
        public String objType;
        public String sfId;
        public EAI_CallOutServices.fieldsList fieldsList;
        private String[] objType_type_info = new String[]{'objType','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] sfId_type_info = new String[]{'sfId','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] fieldsList_type_info = new String[]{'fieldsList','http://tempuri.org/','fieldsList','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'objType','sfId','fieldsList'};
    }
    public class Return_x {
        public String result;
        public String description;
        private String[] result_type_info = new String[]{'result','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] description_type_info = new String[]{'description','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'result','description'};
    }
    public class ArrayOfField {
        public EAI_CallOutServices.Field[] ArrayOfFieldItem;
        private String[] ArrayOfFieldItem_type_info = new String[]{'ArrayOfFieldItem','http://tempuri.org/','Field','1','-1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'ArrayOfFieldItem'};
    }
    public class SendObj {
        public EAI_CallOutServices.docTypeRef_dx_cObj cObj;
        private String[] cObj_type_info = new String[]{'cObj','http://tempuri.org/','docTypeRef_dx_cObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'cObj'};
    }
    public class docTypeRef_dx_cObj {
        public EAI_CallOutServices.SFObj SFObj;
        private String[] SFObj_type_info = new String[]{'SFObj','http://tempuri.org/','SFObj','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'SFObj'};
    }
    public class SwitchInTTResponse {
        public EAI_CallOutServices.Return_x outSwitchInTT;
        private String[] outSwitchInTT_type_info = new String[]{'outSwitchInTT','http://tempuri.org/','Return','1','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://tempuri.org/','false','false'};
        private String[] field_order_type_info = new String[]{'outSwitchInTT'};
    }
}
 

when we call the postSoft callout function we get the following exception:

 

System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://tempuri.org/=result Class.EAI_CallOutServices.SalesForce_ws_provider_SalesForceCallOut_Port.Soft: line 104, column 13 Class.OutBoundServices.postSoft: line 275, column 40

this is the response from the external server:

HTTP/1.1 200 OK
Content-Length: 712
Set-Cookie: ssnid=361ddb908e5e11debdf9b47ec05fba6f; path=/; HttpOnly
Content-Type: text/xml; charset=UTF-8

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Header xmlns:SOAP-ENV="
http://schemas.xmlsoap.org/soap/envelope/"></SOAP-ENV:Header><SOAP-ENV:Body>
<ser-root:SoftResponse xmlns:ser-root="
http://tempuri.org/">
<outSoft xmlns:dx="
http://tempuri.org/">
<dx:result>1</dx:result>
<dx:description>simulation</dx:description></outSoft></ser-root:SoftResponse></SOAP-ENV:Body>
</SOAP-ENV:Envelope>

we can't figure out what's going wrong... any help would be much appreciated ;D
thanks in advance!