Conversation ID in web service response
shakenbrain Jul 31, 2007 3:19 PMI'm getting started with conversations in a JBoss Seam web service. I've got a basic web service with a method called 'start' that doesn't do anything (yet):
@Stateless @Name("supportCenterService") @WebService(name = "SupportCenter", targetNamespace = "http://blah.service", serviceName = "SupportCenterService") public class SupportCenter implements SupportCenterRemote { @In(create=true) AgentConfigurationSource agentConfiguration; @Logger Log log; @WebMethod public void start() { } }
I'm calling this web service from an Axis client generated from WSDL2Java:
public static void start() { try { SupportCenter supportCenter = SupportCenterClientFactory.getClient(); supportCenter.start(); SOAPHeaderElement[] headers = ((Stub) supportCenter).getResponseHeaders(); System.out.println("Headers: " + headers.length); } catch (Exception e) { throw new WebServiceClientException(e); } }
The getClient method in SupportCenterClientFactory calls setMaintainSession:
public static SupportCenter getClient() { try { URL endpointAddress = new URL(AgentGlobals.getInstance().getConfig().getWebService().getPrimaryAddress()); SupportCenterServiceLocator serviceLocator = new SupportCenterServiceLocator(); serviceLocator.setMaintainSession(true); return serviceLocator.getSupportCenterPort(endpointAddress); } catch (ServiceException e) { throw new WebServiceClientException(e); } catch (MalformedURLException e) { throw new WebServiceClientException(e); } }
I have the following in META-INF/standard-jaxws-endpoint-config.xml:
<jaxws-config xmlns="urn:jboss:jaxws-config:2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:javaee="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="urn:jboss:jaxws-config:2.0 jaxws-config_2_0.xsd"> <endpoint-config> <config-name>Seam WebService Endpoint</config-name> <pre-handler-chains> <javaee:handler-chain> <javaee:protocol-bindings>##SOAP11_HTTP</javaee:protocol-bindings> <javaee:handler> <javaee:handler-name>SOAP Request Handler</javaee:handler-name> <javaee:handler-class>org.jboss.seam.webservice.SOAPRequestHandler</javaee:handler-class> </javaee:handler> </javaee:handler-chain> </pre-handler-chains> </endpoint-config> </jaxws-config>
So, going back to the client call, should I expect to see a conversation id in the response header? Right now, there are no headers defined in the response:
public static void start() { try { SupportCenter supportCenter = SupportCenterClientFactory.getClient(); supportCenter.start(); SOAPHeaderElement[] headers = ((Stub) supportCenter).getResponseHeaders(); System.out.println("Headers: " + headers.length); // Result is 0 } catch (Exception e) { throw new WebServiceClientException(e); } }
Am I misunderstanding something here, or am I missing something?