3 Replies Latest reply on Aug 13, 2008 4:36 AM by Richard Opalka

    WS-RM violates both <ExactlyOnce/> and <InOrder/> ?

    Alexandros Karypidis Novice

      I have a web service with WS-RM enabled. Here is the WSDL as published by JBoss, with the associated policy in bold fonts:

      <definitions name="StationsService" targetNamespace="http://www.armoniq.com/StationsService/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.armoniq.com/StationsService/" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
       <types>
       <xs:schema targetNamespace="http://www.armoniq.com/StationsService/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
       <xs:element name="echo">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="in" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       <xs:element name="echoResponse">
       <xs:complexType>
       <xs:sequence>
       <xs:element name="out" type="xs:string"/>
       </xs:sequence>
       </xs:complexType>
       </xs:element>
       </xs:schema>
       </types>
       <message name="StationsServicePortType_echoResponse">
       <part element="tns:echoResponse" name="echoResponse"/>
       </message>
       <message name="StationsServicePortType_echo">
       <part element="tns:echo" name="echo"/>
       </message>
       <portType name="StationsServicePortType">
       <operation name="echo" parameterOrder="echo">
       <input message="tns:StationsServicePortType_echo"/>
       <output message="tns:StationsServicePortType_echoResponse"/>
       </operation>
       </portType>
       <binding name="StationsServicePortTypeBinding" type="tns:StationsServicePortType">
       <wsp:PolicyReference URI="#exactly_one_in_order_rm_delivery"/>
       <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
       <operation name="echo">
       <soap:operation soapAction="http://www.armoniq.com/StationsService/echo"/>
       <input>
       <soap:body use="literal"/>
       </input>
       <output>
       <soap:body use="literal"/>
       </output>
       </operation>
       </binding>
       <service name="StationsService">
       <port binding="tns:StationsServicePortTypeBinding" name="StationsServicePort">
       <soap:address location="http://localhost:8080/eessi.ear-eessi.ws.mta/StationsServiceImpl"/>
       </port>
       </service>
       <wsp:Policy wsu:Id="exactly_one_in_order_rm_delivery" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
       <wsp:All>
       <wsrmp:DeliveryAssurance xmlns:wsrmp="http://docs.oasis-open.org/ws-rx/wsrmp/200702">
       <wsp:Policy>
       <wsp:ExactlyOne>
       <wsp:All>
       <wsrmp:ExactlyOnce/>
       <wsrmp:InOrder/>
       </wsp:All>
       </wsp:ExactlyOne>
       </wsp:Policy>
       </wsrmp:DeliveryAssurance>
       </wsp:All>
       </wsp:Policy>
      </definitions>


      When starting up, JBoss logs that that the service is running properly with the appropriate JAX-WS handlers for WS-ReliableMessaging:

      HandlerMetaDataJAXWS:
       type=POST
       name=WSAddressing Handler
       class=class org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler
       params=[]
       protocols=##SOAP11_HTTP
       services=null
       ports=null
      
      HandlerMetaDataJAXWS:
       type=POST
       name=WSRM Handler
       class=class org.jboss.ws.extensions.wsrm.jaxws.RMServerHandler
       params=[]
       protocols=##SOAP11_HTTP
       services=null
       ports=null
      2008-08-12 14:16:20,081 DEBUG [org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl] RMDeploymentAspect:Start
      2008-08-12 14:16:20,081 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.management.ServerConfigFactory'
      2008-08-12 14:16:20,081 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] class org.jboss.wsf.spi.management.ServerConfigFactory Implementation: org.jboss.wsf.framework.management.ServerConfigFactoryImpl@187b08d
      2008-08-12 14:16:20,112 INFO [org.jboss.ws.extensions.wsrm.server.RMDeploymentAspect] WS-RM invocation handler associated with endpoint http://localhost:8080/eessi.ear-eessi.ws.mta/StationsServiceImpl
      2008-08-12 14:16:20,112 DEBUG [org.jboss.wsf.framework.deployment.DeploymentAspectManagerImpl] PublishContractDeploymentAspect:Start
      2008-08-12 14:16:20,112 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] provide SPI 'class org.jboss.wsf.spi.management.ServerConfigFactory'
      2008-08-12 14:16:20,112 DEBUG [org.jboss.wsf.framework.DefaultSPIProvider] class org.jboss.wsf.spi.management.ServerConfigFactory Implementation: org.jboss.wsf.framework.management.ServerConfigFactoryImpl@7720d7
      2008-08-12 14:16:20,112 DEBUG [org.jboss.wsf.stack.jbws.WSDLFilePublisher] Publish WSDL file: file:/D:/Programs/jboss/as0/jboss-4.2.3.GA/server/default/tmp/jbossws/StationsService13926.wsdl
      2008-08-12 14:16:20,112 INFO [org.jboss.wsf.stack.jbws.WSDLFilePublisher] WSDL published to: file:/D:/Programs/jboss/as0/jboss-4.2.3.GA/server/default/data/wsdl/eessi.ear.ear/eessi.ws.mta.jar/StationsService13926.wsdl


      I then try to send two messages from a simple Java client using asynchronous invocation:

      public void wsrmTest() throws InterruptedException, ExecutionException,
       MalformedURLException {
       final int MAX_PACKETS = 2;
       Response<EchoResponse> response = null;
      
       QName serviceName = new QName(
       "http://www.armoniq.com/StationsService/", "StationsService");
       URL wsdlURL = new URL(
       "http://localhost:8080/eessi.ear-eessi.ws.mta/StationsServiceImpl?wsdl");
       StationsService ss = new StationsService(wsdlURL, serviceName);
       ssp = ss.getStationsServicePort();
       ((StubExt) ssp).setConfigName("Standard Anonymous WSRM Client",
       "META-INF/wsrm-jaxws-client-config.xml");
      
       for (int i = 0; i < MAX_PACKETS; i++)
       response = ssp.echoAsync("PACKET " + i);
       System.out.println("Sent out all my packets asynchronously...");
      
       System.out.println("Last response: " + response.get());
       Thread.sleep((MAX_PACKETS + 1) * 2000);
       System.out.println("All packets should have returned...");
       ((RMProvider) ssp).closeSequence();
       }


      When running, JBoss throws this exception:

      2008-08-12 14:21:18,039 DEBUG [org.jboss.ws.extensions.wsrm.server.RMServerSequence] Inbound Sequence: urn:uuid:5074e327-2f26-424f-a744-47836a765fd, received message no. 1
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.extensions.wsrm.server.RMInvocationHandler] Invoking method: echo
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestPayload
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.EndpointInvocation] getRequestParamValue: {http://www.armoniq.com/StationsService/}echo
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] -----------------------------------
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.soap.SOAPContentElement] Transitioning from XML_VALID to OBJECT_VALID
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.soap.XMLContent] getObjectValue [xmlType={http://www.armoniq.com/StationsService/}echo,javaType=class com.armoniq.stationsservice.Echo]
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.jaxws.JAXBDeserializer] deserialize: [xmlName={http://www.armoniq.com/StationsService/}echo,xmlType={http://www.armoniq.com/StationsService/}echo]
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.jaxws.handler.MessageContextJAXWS] Begin response processing
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] popMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@54c2b8 (Thread http-localhost%2F127.0.0.1-8080-5)
      2008-08-12 14:21:18,055 DEBUG [org.jboss.ws.core.soap.MessageContextAssociation] pushMessageContext: org.jboss.ws.core.jaxws.handler.SOAPMessageContextJAXWS@1ce4608 (Thread http-localhost%2F127.0.0.1-8080-5)
      2008-08-12 14:21:18,055 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
       org.jboss.ws.extensions.wsrm.RMFault: The value of wsrm:Identifier is not a known Sequence identifier.
       at org.jboss.ws.extensions.wsrm.server.RMInvocationHandler.getUnknownSequenceFault(RMInvocationHandler.java:297)
       at org.jboss.ws.extensions.wsrm.server.RMInvocationHandler.prepareResponseContext(RMInvocationHandler.java:242)
       at org.jboss.ws.extensions.wsrm.server.RMInvocationHandler.invoke(RMInvocationHandler.java:306)
       at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:466)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
       at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
       at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
       at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
       at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
       at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
       at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
       at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
       at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
       at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
       at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
       at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
       at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
       at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
       at java.lang.Thread.run(Unknown Source)
       2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] Cannot obtain fault meta data for: class org.jboss.ws.extensions.wsrm.RMFault
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: PRE
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: ENDPOINT
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] callFaultHandlerChain: POST
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Enter: handleOutBoundFault
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.extensions.addressing.jaxws.WSAddressingServerHandler] handleFault
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.extensions.wsrm.jaxws.RMServerHandler] handling fault message
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.extensions.wsrm.jaxws.RMServerHandler] SequenceFault WSRM message was serialized to payload
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] Exit: handleOutBoundFault with status: true
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerDelegateJAXWS] closeHandlerChain
      2008-08-12 14:21:18,071 DEBUG [org.jboss.ws.core.jaxws.handler.HandlerChainExecutor] close


      If I don't use the asynchronous invocation, my client works just fine. Any idea what I am doing wrong?