• jayala
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies

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.

  • August 19, 2011
  • Like
  • 0

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');
    System.debug('result ---'+result);

 

Following is the error i am getting

 

11:16:14:220 CALLOUT_RESPONSE [28]|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.



  • August 15, 2011
  • Like
  • 0

I am getting the following error when i tried to make a callout to SAP webservice.

 

I have registered my endpoint in sfdc. I amusing WSDL1.1 for my wsdl to create WSDL2Apex.

 

System.LimitException: @future call currently not allowed 

 

Any help is appreciated.

  • August 14, 2011
  • Like
  • 0

I am getting the following error when i tried to make a callout to SAP webservice.

 

I have registered my endpoint in sfdc. I amusing WSDL1.1 for my wsdl to create WSDL2Apex.

 

System.LimitException: @future call currently not allowed 

 

Any help is appreciated.

  • August 14, 2011
  • Like
  • 0
I am getting the following error when I callout a webservice.

 

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.