• ritswaney007
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 13
    Replies
Hi there

Does Apex support Secure Web Services. I need to consume an external WS, for one which need to be authenticated.
Authentication is via another WS, which accepts a X509 cert in the request and returns a Binary Security Token in the response.

This token needs to be embedded in all further requests, like this
<soap:Header>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-2b27a32b-ca9c-4405-b377-4444f63c8f29">
<wsu:Created>2007-02-20T16:36:54Z</wsu:Created>
<wsu:Expires>2007-02-20T16:41:54Z</wsu:Expires>
</wsu:Timestamp>
<wsse:BinarySecurityToken
ValueType="ExperianWASP"
EncodingType="wsse:Base64Binary"
wsu:Id="SecurityToken-f64439f9-c12c-4d09-ac3d-fc478ad19775">
MjAtRTctQ0YtMTUtN0EtODEtNTk...
</wsse:BinarySecurityToken>

In .NET , this can be written as

AuthPlusWS.InteractiveWSWse service = new AuthPlusWS.InteractiveWSWse();
// Add the secure token to the secured service
service.RequestSoapContext.Security.MustUnderstand = false;
service.RequestSoapContext.Security.Tokens.Add(wt);

Is there a way to do this in apex ?

Cheers,
Ritesh
Is there a way to have a hostname to ip appdress mapping on salesforce, like you do using a windows or unix "hosts" file?
3 days old (new) to salesforce!
i need to invoke a webservice from a tab like contacts when a button is clicked.
i understand i can add a custom button, but how do i write the code behind it, which will be triggered upon clicking.
the code behind the buttons needs to invoke this webservice, passing some details from the screen such as customer name and postcode, and the response that is received should be displayed on the screen.

please help people !
Hi there

Does Apex support Secure Web Services. I need to consume an external WS, for one which need to be authenticated.
Authentication is via another WS, which accepts a X509 cert in the request and returns a Binary Security Token in the response.

This token needs to be embedded in all further requests, like this
<soap:Header>
<wsse:Security>
<wsu:Timestamp wsu:Id="Timestamp-2b27a32b-ca9c-4405-b377-4444f63c8f29">
<wsu:Created>2007-02-20T16:36:54Z</wsu:Created>
<wsu:Expires>2007-02-20T16:41:54Z</wsu:Expires>
</wsu:Timestamp>
<wsse:BinarySecurityToken
ValueType="ExperianWASP"
EncodingType="wsse:Base64Binary"
wsu:Id="SecurityToken-f64439f9-c12c-4d09-ac3d-fc478ad19775">
MjAtRTctQ0YtMTUtN0EtODEtNTk...
</wsse:BinarySecurityToken>

In .NET , this can be written as

AuthPlusWS.InteractiveWSWse service = new AuthPlusWS.InteractiveWSWse();
// Add the secure token to the secured service
service.RequestSoapContext.Security.MustUnderstand = false;
service.RequestSoapContext.Security.Tokens.Add(wt);

Is there a way to do this in apex ?

Cheers,
Ritesh
Is there a way to have a hostname to ip appdress mapping on salesforce, like you do using a windows or unix "hosts" file?
3 days old (new) to salesforce!
i need to invoke a webservice from a tab like contacts when a button is clicked.
i understand i can add a custom button, but how do i write the code behind it, which will be triggered upon clicking.
the code behind the buttons needs to invoke this webservice, passing some details from the screen such as customer name and postcode, and the response that is received should be displayed on the screen.

please help people !
Hi all,

I am new for Apex development. So please help me out. Any help will be appreciable.
Currently I am using a function in our application in which I am retrieving data from external web services and storing it in Salesforce database. I am calling this function in a ‘for’ loop because this is getting called multiple times based on the selection of checkboxes. At 1st time, this function is working properly but 2nd time, It's giving exception which is as follows:
ERROR: System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out.

Below is the function which is getting called multiple times:
WebService static void getContent(String id)
{
    String response = '';
    Http h = new Http();
    HttpRequest req = new HttpRequest();
    String url = 'url of the web service';
    req.setEndpoint(url);
    req.setMethod('GET');
    HttpResponse res=null;
    try {
        res= h.send(req);
    } catch(System.CalloutException e) {
    System.debug('ERROR: '+ e);
}

Thanks,
Manjiri