aspose file tools*
The moose likes Web Services and the fly likes Problem creating a dummy web service w/ WS-RM Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Web Services
Bookmark "Problem creating a dummy web service w/ WS-RM" Watch "Problem creating a dummy web service w/ WS-RM" New topic
Author

Problem creating a dummy web service w/ WS-RM

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Hello.

I'm having a bit of difficulty creating a dummy web service using WS-RM. My service is built using JBossWS and my client is using Metro. The web service seems to deploy without any problem to JBoss AS 5.0.1.

Could someone with more knowledge point out what I'm missing? If it helps at all, the web resources I used to build it were:

* JBossWS-WSReliableMessaging (service)
* JBossWS-MetroWS-ReliableMessagingTutorial (client)

Service

Java code


Policy file


Client
Code generation command


Java code


Warning messages
29-Jun-2009 1:41:11 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectBestAlternative
WARNING: WSP0075: Policy assertion "{http://docs.oasis-open.org/ws-rx/wsrmp/200702}DeliveryAssurance" was evaluated as "UNKNOWN".
29-Jun-2009 1:41:11 PM [com.sun.xml.ws.policy.EffectiveAlternativeSelector] selectBestAlternative
WARNING: WSP0019: Suboptimal policy alternative selected on the client side with fitness "UNKNOWN".


Failure Trace
java.lang.ArrayIndexOutOfBoundsException: 0
at com.sun.xml.ws.rm.runtime.RmClientTube.<init>(RmClientTube.java:87)
at com.sun.xml.ws.rm.runtime.RmTubeAppender.appendTube(RmTubeAppender.java:68)
at com.sun.xml.ws.assembler.TubelineAssemblerFactoryImpl$WsitTubelineAssembler.createClient(TubelineAssemblerFactoryImpl.java:79)
at com.sun.xml.ws.client.WSServiceDelegate.createPipeline(WSServiceDelegate.java:446)
at com.sun.xml.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:639)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:342)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:324)
at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:306)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.ws.reliable.ReliableService.getReliablePort(ReliableService.java:55)
at com.wsClient.reliable.TestReliable.testReliable(TestReliable.java:13)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.internal.runners.TestMethodRunner.executeMethodBody(TestMethodRunner.java:99)
at org.junit.internal.runners.TestMethodRunner.runUnprotected(TestMethodRunner.java:81)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:66)
at org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:35)
at org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:45)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I don't know if it helps, but the policy assertions I get when configuring a web service to use WS-Reliable Messaging in NetBeans are:

Looks a little bit different compared to the ones you have.
Best wishes!
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Thanks Ivan, it looks like one of the problems it was the policy.

I changed it to the following (which I took directly from an Oracle website):



While I'm getting further my client is still throwing an error in that I'm apparantly not actually using WSRM (below). I've re-run the wsconsume from above, but that doesn't seem to help. Do I need to create a custom JAXB file to have my artificats WSRM compliant?

10:59:32,913 INFO [RMDeploymentAspect] WS-RM invocation handler associated with endpoint http://localhost:8180/myWebService/Reliable
10:59:52,591 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
org.jboss.ws.extensions.wsrm.RMFault: The RM Destination requires the use of WSRM
.
.
.

Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
In searching around, the only thing I can see that I'm missing is the creation of WSIT configuration files. Are these absolutely needed when using WS-Policies? Is there no way to get the functionality of them programmatically?

I'd like to avoid editing the XML as much as possible, keeping as many changes as possible at the application level.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I fear that the WSIT configuration files are necessary. If you look at the WSDL of the deployed web service, then you will find the policy information in it. Since the WSDL is a way to inform clients about the contract they have to follow when interacting with your service, I'd say this is the natural place for policy information.
I am not that fond of editing such configuration files either, so I want to recommend NetBeans which has very nice support for this built-in! There is a window in which you can choose different options, such as MTOM, Reliable Messaging etc. and the WSIT configuration file is generated for you.
Best wishes!
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
Shame. Unless there's something I'm not seeing, the configuration files are just a subset of the WSDL; seems like a pretty bad design to me to have to duplicate the effort.
Karl Beowulph
Ranch Hand

Joined: May 31, 2004
Posts: 130
I finally got it.

I wrote a fairly detailed guide on Google Knol if it's of use to anyone.

http://knol.google.com/k/neil-mcfarlane/creating-your-first-web-services-in-java/
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem creating a dummy web service w/ WS-RM