[jboss-user] [JBossWS] - setHeader and setServerURL, using javax.xml.ws.Service?
eric@attask.com
do-not-reply at jboss.com
Fri Jul 6 19:22:47 EDT 2007
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());
SforceService extends javax.xml.ws.Service and it was generated by wsconsume from the sales-force partner wsdl.
I need to set the new server url to the lr.getServerUrl and I need to include the lr.getSessionId as a SOAP header.
I can get this to work using Axis but I want to use JBossWS.
--------USING AXIS ---------
SforceService service extends org.apache.axis.client.Stub. The axis org.apache.axis.client.Stub provides _setProperty and setHeader
Example:
| service._setProperty(SoapBindingStub.ENDPOINT_ADDRESS_PROPERTY, serverURL);
and
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);
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4061520#4061520
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4061520
More information about the jboss-user
mailing list