function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

_CallOptions Object


I am trying to add a  token t(hat we need to add to our integration config )that will allow Professional and Enterprise customers to use our integration.  I am trying to use a java  sample code

Here is a code


Here is a snippet of sample Java code to aid you in the understanding and use of your client id:


// The following snippet assumes use of the partner WSDL

// For use with sforce 3.0, 4.0, 5.0

// Use the following in your login method, before you call

// the login method.  Be sure to set the header value

// with your clientid.

// There exists a header object "_CallOptions" and setter method

// to insert the value.  See the WSDL definition for details.

// To insert the header value, set the call option for client id

// as follows:

_CallOptions co = new _CallOptions();



// bind it to the current soap session

binding.SetHeader("SforceService", "CallOptions", co);

I have 2 questions:

1>Where exactly I need to use  to set token? will it be in my webservice where I am calling login function.

2>How can I use _CallOptions object? If I try to use it gives me an error type or namespace is not found.

Please Advice!!!!




In .NET, assuming svc is an instance of the client proxy its simply

svc.CallOptionsValue = new sforce.CallOptions();
svc.CallOptionsValue.client = "foo";

Once set, .NET will send it up on every request made by that instance of the proxy. All requests from your integration should send this header.
The callOptions is only exposed on the Partner API also.  This is the namespace and should only be used on the services/Soap/u/x.x endpoint where x.x is the version number of the API that you are using.

thanks Dave, can you explain this stuff more.... Right now my company is in process of becoming partner with so i need to add the token.

Where exactly I need to call this function for adding clientid(token)





John SaundersJohn Saunders

This is interesting. I've been programming the Partner API for 4 months now, and have never used the CallOptions header. Am I supposed to?

It's for sforce certified applications. If you're sforce certified, you should be filling this in. We don't require it for everyone today.
John SaundersJohn Saunders