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
thorntonthornton 

UNKNOWN_EXCEPTION

So here's where I am at:

1. Generated and saved my the wsdl locally.
2. Invoked it local wsdl
3. Get response from server with my sessionid and getServerUrl.

When trying to invoke the new url with my SoapHeader I return "UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService".

When I try to post to the new server ((getServerUrl) ) object using the setHeader object I get a local error regarding the stubs.

Any ideas? What am I missing?

 

Brian A. Thornton

SalesForce Developer/Architect

Denver / Indianapolis/ Fort Wayne / Chicago

since 2005

DevAngelDevAngel
Hi thornton,

Please indicate what platform and language you are using.
thorntonthornton
Cold Fusion web services

Code is below:


// Set local page settings
debug = 1;
salesforce_user_name = "asd";
salesforce_password = "asd";
wsdl_location ="http://localhost:8080/cfmain/com/gtt/salesforce/salesforce.wsdl";

// Create the instace
sales_force_login = CreateObject("webservice", wsdl_location);

// Set the required fields.
addSOAPRequestHeader(sales_force_login, wsdl_location, "username", salesforce_user_name, false);
addSOAPRequestHeader(sales_force_login, wsdl_location, "password", salesforce_password, false);
login=sales_force_login.login(salesforce_user_name,salesforce_password);
SalesForceLoginResponse = StructNew();
SalesForceLoginResponse.sessionID = login.sessionID;
SalesForceLoginResponse.getServerUrl = login.getServerUrl();









// Create second instace
sales_force_request = CreateObject("webservice", wsdl_location);
sales_force_request.setHeader(SalesForceLoginResponse.getServerUrl, "SessionHeader", SalesForceLoginResponse.sessionID );
// Set the required fields.
// addSOAPRequestHeader(sales_force_request, wsdl_location, "sessionID", SalesForceLoginResponse.sessionID, false);
servertime = sales_force_request.getServerTimestamp();

DevAngelDevAngel
Hmm...

I've never seen anyone jump up and down and declare total victory with CF.

The basic issue is that there is a url in the wsdl that is used for login, and as you have seen, a new url is returned on successful login. If CF is going back and using the wsdl for other calls, it may still be picking up the url in the wsdl. The fundamental challenge to have CF use the url from the login as the endpoint for all subsequent api calls.

How this is done is not clear to me. I would suggest searching some CF specific resources.
thorntonthornton
In php it's called setlocation. We're trying to figure it out for CF.
thorntonthornton
Do you have a number we can call for support?
DevAngelDevAngel
Are you a salesforce.com customer?
thorntonthornton
I am a employee of a customer.
DevAngelDevAngel
So, you should be able to contact your customer support rep.
thorntonthornton
I don't see that as an option. I did find out I am using a developer version with 2 seat limit. Is any support given for developers doing intergration?
SuperfellSuperfell
I don't think saleforce.com support will be able to help you with coldfusion anyway. You're probably better of asking macromedia about how to override the service URL in the WSDL.
thorntonthornton
I appreciate the respone sir,


For any CFers out there heres the quick start using Cold Fusion. This logins in and gets the session id. The current problem is adding it to the header...


// Set local page settings
debug = 1;
salesforce_user_name = "myuser@mydomain.com";
salesforce_password = "mypassword";
wsdl_location ="http://localhost:8080/cfmain/com/salesforce/salesforce.wsdl";

// Create the instace
sales_force_login = CreateObject("webservice", wsdl_location);

// Set the required fields.
addSOAPRequestHeader(sales_force_login, wsdl_location, "username", salesforce_user_name, false);
addSOAPRequestHeader(sales_force_login, wsdl_location, "password", salesforce_password, false);
login=sales_force_login.login(salesforce_user_name,salesforce_password);
SalesForceLoginResponse = StructNew();
SalesForceLoginResponse.sessionID = login.sessionID;
SalesForceLoginResponse.getServerUrl = login.getServerUrl();









// Create second instace
sales_force_request = CreateObject("webservice", wsdl_location);
sales_force_request.setHeader(SalesForceLoginResponse.getServerUrl, "SessionHeader", SalesForceLoginResponse.sessionID );
// Set the required fields.
// addSOAPRequestHeader(sales_force_request, wsdl_location, "sessionID", SalesForceLoginResponse.sessionID, false);
servertime = sales_force_request.getServerTimestamp();




The current error is invalid stub object.