• meister.eder
  • NEWBIE
  • 0 Points
  • Member since 2011

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

hey guys,

 

i have the following problem:

 

 

private Soap salesforceClient;
	private SessionHeader sh;
	private HashSet<Login> loginSet;


	public void init() {
		try {
			if(salesforceClient == null){
			SforceService ss = new SforceService(new URL("link/to/enterprise.wsdl"), new QName("urn:enterprise.soap.sforce.com", "SforceService"));
			salesforceClient = ss.getSoap();
	        LoginResult loginResult = salesforceClient.login("LOGIN", "PASSWORD+TOKEN");
	        ((BindingProvider) salesforceClient).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, loginResult.getServerUrl());
			//ss.addPort(portName, loginResult.getSessionId(), loginResult.getMetadataServerUrl())
			
	        //Create a new session header object and set the session id to that returned by the login
	        sh = new SessionHeader();
	        sh.setSessionId(loginResult.getSessionId());
	        
	        
	        }	
			
		} catch (InvalidIdFault_Exception e) {
			logger.debug(e.toString());
		} catch (LoginFault_Exception e) {
			logger.debug(e.toString());
		} catch (UnexpectedErrorFault_Exception e) {
			logger.debug(e.toString());
		} catch (MalformedURLException e) {
			logger.debug(e.toString());
			e.printStackTrace();
		}
	}

 

 

I get the   UnexpectedErrorFault_Exception INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session