[JBossWS] - WS-RM violates both <ExactlyOnce/> and <InOrder/> ?
by karypid
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-utilit...">
| <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...]
| 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?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170051#4170051
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170051
17 years, 4 months
[JBossWS] - Re: Enabling MTOM-Support at JBossWS client fails
by lfoggy
Hi,
I have been trying to compare my classes with the sample xop examples in jbossws package and finally I was able to find the problem.
Here are my classes:
class AttachmentType {
@XmlMimeType("application/octet-stream")
protected DataHandler dh;
....
class AttachmentTypeHolder {
protected List attachments;
....
In my endpoint class if I have the following method signature, then the xop works:
public AttachmentType echoDataHandler(DHRequest request)
but if I change the method signature to this:
public AttachmentHolder echoDataHandler(DHRequest request)
then the response is returned inline and not xop encoded.
Is there anything I have to do to fix this. I am using Doc/Literal Wrapped wsdl, with a WSDL-first approach.
Any help would really be appreciated.
Thanks,
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169948#4169948
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169948
17 years, 4 months
[JBossWS] - Re: WS-RM Exception: cannot be cast to org.jboss.ws.core.Stu
by karypid
Ok, I've finally found out what was wrong.
First of all, the tutorial is correct and everything should work fine
even without the @Policy annotation (provided of course you embed
your WS-Policy in the WSDL file).
Strange thing though:
When using "wsdLocation" in @WebService, JBoss reads the WSDL file you provided and does the following:
1) if the <soap:address> tag in the WSDL file has a "file://..." URL in it,
it does NOT replace it with the actual address where your web service
endpoint was bound.
2) if the <soap:address> tag in the WSDL file has an "http://..." URL in it,
it replaces it with the actual address where your web service
endpoint was bound.
I had the bad luck of having specified file://path/to/my/contract.wsdl causing the weird behavior.
I know this is totally unrelated to the topic of this thread by now, but I
wanted not to leave any lingering doubt regarding the approach without
@Policy (which I prefer by the way).
In any case, before I go running to JIRA, can someone explain if there's
some reason why JBoss won't touch the file:// address bindings and
therefore this is proper behavior, or would you consider this a bug?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169836#4169836
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169836
17 years, 4 months
[JBossWS] - Re: WS-RM Exception: cannot be cast to org.jboss.ws.core.Stu
by karypid
Understood. However, I can't get it to work. When I add the WSDL file to the META-INF/wsdl folder of my EJB jar (I use a stateless session bean to implement the web service and the "start from WSDL" approach via wsconsume), JBoss publishes the web service using a file:// URL. For instance, the following SLSB (notice that the PolicyFile annotation is commented out):
@Stateless
| @WebService(serviceName = "StationsService", wsdlLocation = "META-INF/wsdl/StationsService.wsdl",
| targetNamespace = "http://www.armoniq.com/StationsService/",
| endpointInterface = "com.armoniq.stationsservice.StationsServicePortType"
| )
| @EndpointConfig(configFile = "META-INF/wsrm-jaxws-endpoint-config.xml", configName = "Standard WSRM Endpoint")
| //@PolicyAttachment(@Policy(policyFileLocation = "META-INF/wsrm-exactly-once-in-order-policy.xml", scope = PolicyScopeLevel.WSDL_BINDING))
| public class StationsService implements StationsServicePortType {
| // Logger logger = Logger
| // .getLogger(StationsService.class.getClass().getName());
|
| public void ping(String in) {
| System.out.println("Ping received with text: " + in);
| // logger.log(Level.INFO, "Ping received with text: " + in);
| }
| }
Causes JBoss to publish this WSDL:
<wsdl:definitions name="StationsService"
| targetNamespace="http://www.armoniq.com/StationsService/"
| xmlns:echoes="http:/www.armoniq.com/echoes/2008/core"
| xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
| xmlns:tns="http://www.armoniq.com/StationsService/"
| xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
| xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
| xmlns:xsd="http://www.w3.org/2001/XMLSchema">
| <wsdl:types>
| <xsd:schema targetNamespace="http://www.armoniq.com/StationsService/">
| <xsd:import namespace="http:/www.armoniq.com/echoes/2008/core"
| schemaLocation="http://localhost:8080/myrm.ear-myrm.ws.impl/StationsService?wsdl&resource..."/>
| <xsd:element name="ping">
| <xsd:complexType>
| <xsd:sequence>
| <xsd:element name="in" type="xsd:string"/>
| </xsd:sequence>
| </xsd:complexType>
| </xsd:element>
| </xsd:schema>
| </wsdl:types>
| <wsdl:message name="pingRequest">
| <wsdl:part element="tns:ping" name="parameters"/>
| </wsdl:message>
| <wsdl:portType name="StationsServicePortType">
| <wsdl:operation name="ping">
| <wsdl:input message="tns:pingRequest"/>
| </wsdl:operation>
| </wsdl:portType>
| <wsdl:binding name="StationsServiceSOAP" type="tns:StationsServicePortType">
| <wsp:PolicyReference URI="#wsrm11policy"/>
| <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
| <wsdl:operation name="ping">
| <soap:operation soapAction="http://www.armoniq.com/StationsService/fetchSchedule"/>
| <wsdl:input>
| <soap:body use="literal"/>
| </wsdl:input>
| </wsdl:operation>
| </wsdl:binding>
| <wsdl:service name="StationsService">
| <wsdl:port binding="tns:StationsServiceSOAP" name="StationsServicePort">
| <soap:address location="file://localhost:8080/myrm.ear-myrm.ws.impl/StationsService"/>
| </wsdl:port>
| </wsdl:service>
| <wsp:UsingPolicy/>
| <wsp:Policy wsu:Id="wsrm11policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
| <wsp:All>
| <wsp:ExactlyOne>
| <wsp:All>
| <ns1:RMAssertion xmlns:ns1="http://docs.oasis-open.org/ws-rx/wsrmp/200702"/>
| <ns2:UsingAddressing xmlns:ns2="http://www.w3.org/2006/05/addressing/wsdl"/>
| </wsp:All>
| </wsp:ExactlyOne>
| </wsp:All>
| </wsp:Policy>
| </wsdl:definitions>
Notice the <soap:address> tag that uses file:// as a protocol.
Even in the jbossws management console (http://localhost:8080/jbossws/services) the link uses this address and clicking on it does not work. You have to copy the link from the web page, paste it to the address bar of the browser and replace file: with http: to get to the (incorrect) WSDL.
I am using JBoss 4.2.3 and JBossWS 3.0.2.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4169812#4169812
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4169812
17 years, 4 months