Can anyone provide me the sample code to set username and password for a Apex code callout. I see most of the people set certification. But i am looking for some sample code where in we can set user name and password to the webservice client call.
In my case i am trying to consume a SAP Wervice from Apex code generated by WSDL.
My client call is
System.debug(' callservice begin -- ');
sapComDocumentSapRfcFunctions.ZCUSTOMER_HELPPortType stub = new sapComDocumentSapRfcFunctions.ZCUSTOMER_HELPPortType();
sapComDocumentSapRfcFunctions.ZCUSTOMER_HELP_Response_element result = stub.ZCUSTOMER_HELP(1,'jay');
Following is the error i am getting
11:16:14:220 CALLOUT_RESPONSE |This service requires client certificate for authentication procedure.
I am making just a http call. Do i need to setup any credentials for this like user name and password..? how can i set them .
Help is appreciated.
Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'
I debugged in Execute Anonymous using the test code
When I do this I get a com.sforce.ws.SoapFaultException.
Can anyone please help.