Trying to integrate into SalesForce using JBossws1.2 SP1 instead of Axis.
I've generated the java stubs and I can connect just fine. One I login I'm given a new SeverURL and a sessionID. I need to change the location that I connect to and I need to attach the SessionID to the soap Bindings for every subsequent request.
QName q = new QName("urn:partner.soap.sforce.com", "SforceService"); SforceService service = new SforceService(urlToWSDL, q); LoginResult lr = service.getSoap().login("username", "password"); System.out.println("lr.getServerUrl() = " + lr.getServerUrl()); System.out.println("lr.getSessionId() = " + lr.getSessionId());
service._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, serverURL);
SessionHeader sessionHeader = new SessionHeader(); sessionHeader.setSessionId(sessionID); // Add the header to the binding stub. String sforceURI = new SforceServiceLocator().getServiceName().getNamespaceURI(); service.setHeader(sforceURI, "SessionHeader", sessionHeader);
Stub._setProperty
BindingProvider.ENDPOINT_ADDRESS_PROPERTY