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
SFDC to Java ConnectorSFDC to Java Connector 

Invalid session Header error after login

Hi I am doing a project to Integrate salesforce with java.

 

I am successfully getting login which returns session id and server Url.

 

I set the server url, but dont know how to set the session header.

 

I created an object for the session header and set the session id, but dont know how to use that object.

 

I am using Netbeans 6.9.1.

 

Is it necessary to use wsc to parse the enterprise WSDL file.

 

Please give me a solution...

Best Answer chosen by Admin (Salesforce Developers) 
Abhinav GuptaAbhinav Gupta

You need to tell using which tool Axis, WSC you have complied the WSDL's. As setting session id and server url is different for each. 

 

If you are using WSC or Axis. I suggest you use "Tolerado" it does all the heavy lifting of creating correct stubs. You just need to make the web service calls. http://code.google.com/p/tolerado-sfdc-wsc-apis/wiki/GettingStartedGuide

All Answers

Abhinav GuptaAbhinav Gupta

You need to tell using which tool Axis, WSC you have complied the WSDL's. As setting session id and server url is different for each. 

 

If you are using WSC or Axis. I suggest you use "Tolerado" it does all the heavy lifting of creating correct stubs. You just need to make the web service calls. http://code.google.com/p/tolerado-sfdc-wsc-apis/wiki/GettingStartedGuide

This was selected as the best answer
SFDC to Java ConnectorSFDC to Java Connector

Thank you for your Information. I am using JAVA-WS api to parse the WSDL file. In that I dont know how to set the session header....