0 Replies Latest reply on May 3, 2011 2:50 AM by renegritsch

    Seam 2, Metro, Jax-WS - how to start new conversation

    renegritsch

      Hi there,


      i´m facing the following problem. I run a webservice (generated bei jax-ws) in my webapp on tomcat.
      My Tomcat 6 has the embedded jboss and metro inside.
      I want to have a stateless service called sendCustomer. Inside the service method i want to create
      a new session with a new conversation and prefill a few seam components (which have the scope conversation)
      with some data from the webservice request.


      How can i create a new Session and Conversation ? I know how to get the Conv.Id but how can i want to send
      back a link to my webapp with the sessionId and conv.Id. The client should be able than to call the link via browser.


      I´ve tried the standard-jaxws-endpoint-config.xml in a META-INF directory, but it wasn´t read by the framework.
      I´ve no EAR file, i´m working with WAR, so i placed the file under WEB-INF/META-INF/standard-jaxws-endpoint-config.xml
      Also i´m pretty sure that Lifecycle.beginCall(); isn´t the right way to do it ;-)




      @WebService(endpointInterface='com.generali.fipos.iss.sales.mappings.webservice.evpconnect.EvpCommonPort')
      public class _EvpConnectServiceImpl implements EvpCommonPort, Serializable {
      
      ...
      @Override
      public SendCustomerResponse sendCustomer(SendCustomerRequest request) throws EvpServiceFault_Exception {
              log.error("Webservice 'sendCustomer' started");
              Lifecycle.beginCall();
              final SendCustomerResponse response = of.createSendCustomerResponse();
              try{
                      Conversation.instance().begin();
                      System.out.println(Contexts.getApplicationContext().hashCode());
                      response.setCustomerID(new BigInteger("1"));
              }catch(Throwable t) {
                      t.printStackTrace();
                      response.setEvpServiceFault(WebserviceTools.getEvpServiceFault(of.createEvpServiceFault(), 0, 0, t.getMessage()));
              }
              Lifecycle.endCall();
              return response;
      }
      ...






      Exception:
      ----------



      java.lang.IllegalArgumentException: Stack must not be null
              at org.jboss.seam.core.ConversationEntry.<init>(ConversationEntry.java:45)
              at org.jboss.seam.core.ConversationEntries.createConversationEntry(ConversationEntries.java:53)
              at org.jboss.seam.core.Manager.createConversationEntry(Manager.java:664)
              at org.jboss.seam.core.Manager.beginConversation(Manager.java:685)
              at org.jboss.seam.core.Conversation.reallyBegin(Conversation.java:246)
              at org.jboss.seam.core.Conversation.begin(Conversation.java:239)
              at com.generali.fipos.iss.sales.mappings.webservice.evpconnect._EvpConnectServiceImpl.sendCustomer(_EvpConnectServiceImpl.java:94)