[jboss-user] [JBossWS] - Re: setHeader and setServerURL, using javax.xml.ws.Service?

eric@attask.com do-not-reply at jboss.com
Mon Jul 9 13:34:08 EDT 2007


That seems to reset the URL:

SforceService service = new SforceService(urlToWSDL, q);
  | Soap soapBinding = service.getSoap();
  | LoginResult lr = soapBinding.login("username", password");
  | ((BindingProvider)soapBinding).getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, lr.getServerUrl());
  | 

That works perfectly, with JBoss 1.2.1 sp1

I still haven't figured out how to set the sessionID.  I've tried: 

SessionHeader session = new SessionHeader();
  | session.setSessionId(lr.getSessionId());
  | ((BindingProvider)soapBinding).getRequestContext().put("SessionHeader", session);
  | 

but I still get the following error:


Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session
	at org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS.getSOAPFaultException(SOAPFaultHelperJAXWS.java:56)
	at org.jboss.ws.core.jaxws.binding.SOAP11BindingJAXWS.throwFaultException(SOAP11BindingJAXWS.java:111)
	at org.jboss.ws.core.CommonSOAPBinding.unbindResponseMessage(CommonSOAPBinding.java:460)
	at org.jboss.ws.core.CommonClient.invoke(CommonClient.java:333)
	at org.jboss.ws.core.jaxws.client.ClientImpl.invoke(ClientImpl.java:185)
	at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:163)
	at org.jboss.ws.core.jaxws.client.ClientProxy.invoke(ClientProxy.java:149)
	at $Proxy22.query(Unknown Source)



THIS IS HOW YOU SET THE SESSION HEADER IN AXIS:
SoapBindingStub service; // public class SoapBindingStub extends org.apache.axis.client.Stub implements com.sforce.soap.partner.Soap


SessionHeader sessionHeader = new SessionHeader();
  | sessionHeader.setSessionId(sessionID);
  | 
  | String sforceURI = new SforceServiceLocator().getServiceName().getNamespaceURI();
  | service.setHeader(sforceURI, "SessionHeader", sessionHeader);
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4062080#4062080

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4062080



More information about the jboss-user mailing list