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#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...