Skip to main content
Hi,

Need help in udnerstanding the error type and resolving the same.​

System.CalloutException: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 403 Forbidden

We are trying to integrate with Perlchain CPQ machine, There is no provision for passing the user name and password in the wsdl provided by CPQ. I have followed the link and tweaked to pass these two as part of header.

http://blog.dacology.com/callouts-from-salesforce-adding-soap-headers-for-wsse-security/

I'm still getting the error, 

System.CalloutException: IO Exception: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 403 Forbidden

Need help in resolving this.

//Generated by wsdl2apex

public class xsServicesOp {

        public class Security {

            public UsernameToken usernameToken;

            private String[] usernameToken_type_info = new String[]{'UsernameToken','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','UsernameToken','0','1','true'};

            private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};

            private String[] field_order_type_info = new String[]{'usernameToken'};

        }

        public class UsernameToken {

            public String username;

            public String password;

            private String[] username_type_info = new String[]{'Username','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','0','1','true'};

            private String[] password_type_info = new String[]{'Password','http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','string','1','1','true'};

            private String[] apex_schema_type_info = new String[]{'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd','true','false'};

            private String[] field_order_type_info = new String[]{'username','password'};

        }  

    public class CreateOpportunityPortType {

        public String endpoint_x = //'http://localhost:8010/CreateOpptyMed/1';

           (I have replace endpoint with the correct url)

                                    

        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;

            //instantiate the header

            public UsernameToken userToken;

            public Security Header;

            private String Header_hns = 'Security=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd';

            //end

        private String[] ns_map_type_info = new String[]{'http://www.test.machine/messages/opportunity/1', 'CdmMessagesOpport', 'http://www.test.machine/opportunity/1', 'CdmOpportunity', 'http://www.test.machine/services/opportunity/1', 'CdmServicesOpport', 'http://www.test.machine/common/1', 'CdmCommon', 'urn:codelist:ISO639-2-2002', 'CdmCodelist', 'http://www.test.machine/customer/1', 'CdmCustomer'};

        public CdmMessagesOpport.CreateOpportunityResponseMessageType CreateOpportunity(CdmOpportunity.OpportunityType Opportunity,CdmOpportunity.AccountType Account,CdmOpportunity.ProductsType[] Products) {

            CdmMessagesOpport.CreateOpportunityRequestMessageType request_x = new CdmMessagesOpport.CreateOpportunityRequestMessageType();

            request_x.Opportunity = Opportunity;

            request_x.Account = Account;

            request_x.Products = Products;

            CdmMessagesOpport.CreateOpportunityResponseMessageType response_x;

            Map<String, CdmMessagesOpport.CreateOpportunityResponseMessageType> response_map_x = new Map<String, CdmMessagesOpport.CreateOpportunityResponseMessageType>();

            response_map_x.put('response_x', response_x);

            

            userToken = new UsernameToken();

            userToken.username = 'onecanon';

            userToken.password = 'password';

            WebServiceCallout.invoke(

              this,

              request_x,

              response_map_x,

              new String[]{endpoint_x,

              '',

              'http://www.test.machine/services/opportunity/1',

              'CreateOpportunityRequestMessage',

              'http://www.test.machine/services/opportunity/1',

              'CreateOpportunityResponseMessage',

              'CdmMessagesOpport.CreateOpportunityResponseMessageType'}

            );

            response_x = response_map_x.get('response_x');

            return response_x;

        }

    }

}

 
7 respostas
  1. 11 de ago. de 2015, 18:33
    The issue was due to some setup issue on the middle wear, security feature was eanbled on middle wear where it was checking for certification in SFDC request, as the certificate was not included in the request it failed with the above error.

    The issue got resolved when the middle wear disabled certificate feature.
0/9000