• Lasts
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hello, i have this class and the test class
//Generated by wsdl2apex

public class ultramarClLegSapOtc043 {
    public class row_element {
        public String LEGADO;
        public String SOCIEDAD;
        public String RUT_CLIENTE;
        public String MARCA_BLOQUEO;
        public String MARCA_INHABILITADO;
        public String LINEA_CREDITO;
        public String STATUS;
        public String GLOSA_ERROR;
        private String[] LEGADO_type_info = new String[]{'LEGADO','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] SOCIEDAD_type_info = new String[]{'SOCIEDAD','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] RUT_CLIENTE_type_info = new String[]{'RUT_CLIENTE','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] MARCA_BLOQUEO_type_info = new String[]{'MARCA_BLOQUEO','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] MARCA_INHABILITADO_type_info = new String[]{'MARCA_INHABILITADO','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] LINEA_CREDITO_type_info = new String[]{'LINEA_CREDITO','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] STATUS_type_info = new String[]{'STATUS','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] GLOSA_ERROR_type_info = new String[]{'GLOSA_ERROR','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'urn:ultramar:cl:leg_sap:otc043','false','false'};
        //private String[] field_order_type_info = new String[]{'MARCA_BLOQUEO','MARCA_INHABILITADO','LINEA_CREDITO','STATUS','GLOSA_ERROR'};
        private String[] field_order_type_info = new String[]{'LEGADO', 'SOCIEDAD', 'RUT_CLIENTE', 'MARCA_BLOQUEO','MARCA_INHABILITADO','LINEA_CREDITO','STATUS','GLOSA_ERROR'};
        
        
    }
    public class HTTPS_Port {
        public String endpoint_x = 'http://bpc.ultramar.cl:8104/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_LEGADO_TST&receiverParty=&receiverService=&interface=ob_otc043_syn&interfaceNamespace=urn%3Aultramar%3Acl%3Aleg_sap%3Aotc043';
        //public String endpoint_x = 'https://ultrapit:1443/XISOAPAdapter/MessageServlet?senderParty=&senderService=BS_LEGADO_TST&receiverParty=&receiverService=&interface=ob_otc043_syn&interfaceNamespace=urn%3Aultramar%3Acl%3Aleg_sap%3Aotc043';
        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[]{'urn:ultramar:cl:leg_sap:otc043', 'ultramarClLegSapOtc043'};
        public ultramarClLegSapOtc043.row_element[] ob_otc043_syn(ultramarClLegSapOtc043.row_element row) {
            ultramarClLegSapOtc043.dt_request request_x = new ultramarClLegSapOtc043.dt_request();
            ultramarClLegSapOtc043.dt_response response_x;
            request_x.row = row;
            Map<String, ultramarClLegSapOtc043.dt_response> response_map_x = new Map<String, ultramarClLegSapOtc043.dt_response>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://sap.com/xi/WebService/soap1.1',
              'urn:ultramar:cl:leg_sap:otc043',
              'mt_request',
              'urn:ultramar:cl:leg_sap:otc043',
              'mt_response',
              'ultramarClLegSapOtc043.dt_response'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.row;
        }
    }
    public class dt_response {
        public ultramarClLegSapOtc043.row_element[] row;
        private String[] row_type_info = new String[]{'row','urn:ultramar:cl:leg_sap:otc043',null,'1','-1','false'};
        private String[] apex_schema_type_info = new String[]{'urn:ultramar:cl:leg_sap:otc043','false','false'};
        private String[] field_order_type_info = new String[]{'row'};
    }
    public class dt_request {
        public ultramarClLegSapOtc043.row_element row;
        private String[] row_type_info = new String[]{'row','urn:ultramar:cl:leg_sap:otc043',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'urn:ultramar:cl:leg_sap:otc043','false','false'};
        private String[] field_order_type_info = new String[]{'row'};
    }
}
@isTest(SeeAllData=true)
global class TestWsdlSergio implements WebServiceMock {
    global void doInvoke(
        Object stub,
        Object request,
        Map<String, Object> response,
        String endpoint,
        String soapAction,
        String requestName,
        String responseNS,
        String responseName,
        String responseType)
    {
        ultramarClLegSapOtc043.row_element[] dtResp; // = new ultramarClLegSapOtc043.row_element();
        List<ultramarClLegSapOtc043.row_element> asd = new List<ultramarClLegSapOtc043.row_element>();
        dtResp[0].MARCA_BLOQUEO = null;
        dtResp[0].MARCA_INHABILITADO = null;
        dtResp[0].LINEA_CREDITO = null;
        dtResp[0].STATUS = null;
        dtResp[0].GLOSA_ERROR = null;
        asd.add(dtResp[0]);
        response.put('response_x', asd);
    }
}



@isTest
private class WebSvBloqueoCalloutTest {
    @isTest static void testEchoString() {
        // This causes a fake response to be generated
        Test.setMock(WebServiceMock.class, new TestWsdlSergio());
        
        ultramarClLegSapOtc043.row_element rElem = new ultramarClLegSapOtc043.row_element();
            rElem.LEGADO = 'CAS'; 
            rElem.SOCIEDAD = 'UMAR';
            rElem.RUT_CLIENTE = '1234-2';
        System.assertEquals(null, rElem.MARCA_BLOQUEO);
        System.assertEquals(null, rElem.MARCA_INHABILITADO);
        System.assertEquals(null, rElem.LINEA_CREDITO);
        System.assertEquals(null, rElem.STATUS);
        System.assertEquals(null, rElem.GLOSA_ERROR);
        }
}
but i can't cover all the code of the class Generated by wsdl, anybody help me?

Regards



  • April 22, 2014
  • Like
  • 0

hello people,

 

i try to generate apex classes from WSDL and the error

 

Failed to parse wsdl: Found schema import from location.............External schema import not supported

 

i need some help with that.

  • August 30, 2013
  • Like
  • 0

hello people,

 

i try to generate apex classes from WSDL and the error

 

Failed to parse wsdl: Found schema import from location.............External schema import not supported

 

i need some help with that.

  • August 30, 2013
  • Like
  • 0