• Wim
  • NEWBIE
  • 0 Points
  • Member since 2010

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

Hi gurus,

 

I am not able to create a succesfull call to SAP XI.

I keep getting 401 Unauthorized message.

 

I have created a remote site and created a class with use of 'Generate from WSDL',

Then I created a class to call this WSDL generated class but I do not seem te get the authorization correct.

What is the use and how do I use clientCertName_x, clientCert_x and clientCertPasswd_x?

 

How do I get a proper authorized web service call with use of a WSDL generated class?

 

kind regards,

Wim van Erp

  • July 14, 2010
  • Like
  • 0

Hi gurus,

 

is it possible to call a method dynamically?

For instance, I have a class with method a. Within this method I want to call another method with some checks based on the given objectname. These methods start with Authorize and then the objectname, I have something like this but of course the last line does not work.

 

String obj = 'Authorize' + ObjectName + '()';
obj.replace('_','');
authorized = obj;

 

Is it possible to build up the method name dynamically and then call it?

 

Kind regards,

Wim

  • July 06, 2010
  • Like
  • 0
Has anyone successfully written callouts to SAP/XI?

I have tried all sorts of combinations, but running into issues:

All my research points that I am doing this correct.  We have tried both self-signed certs and basic username/password authentication.

Setting my stub values:
Stub.inputHttpHeaders_x.put('Authorization','BASIC dnJldmF....W1wcGFzczAx');
--OR--
Blob headerValue = Blob.valueOf(username + ':' + password);//username/password set above String authorizationHeader = 'BASIC '+ EncodingUtil.base64Encode(headerValue);
stub.inputHttpHeaders_x.put('Authorization', authorizationHeader);

We have also tried (separately):
stub.clientCert_x = 'MIIG...';//Where this is the bas64 encoding of the pkc12 version of the cert
stub.clientCertPasswd_x = 'xxxxx';

Nothing seems to get past the security layer.  Has anyone successfully written the outbound message?