Problem creating a dummy web service w/ WS-RM

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:

Failure Tracejava.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)

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?

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

posted Jun 30, 2009 18:45:42

0

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

posted Jul 01, 2009 06:41:48

0

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

posted Jul 14, 2009 07:58:21

0

I finally got it.

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