|
|
WS-Policy and moreFabian's Blog on WS-Policy and more |
|
Thursday Feb 14, 2008
Non-standard WSIT configuration file locations for Metro Rickard Lundin recently asked this question: "I need to be able [at] "runtime" to choose wsit config file. One way would be to have multiple "WEB-INF/..xml" and add exactly one of them to the jvm classpath." There are at least two ways to approach that question. The approach we designed the WSIT configuration for is that you know all your services that you are talking to in advance. That is a reasonable assumption since you need to know the structure of the SOAP messages, etc. to talk to a web service anyway. If you already know the service you are going to talk to, you can do the WSIT configuration before deployment. So the first approach boils down to: Configuring multiple WSIT web services or clients at onceCreating and configuring multiple web services has been designed into WSIT from the beginning. The WSIT tutorial has an extensive example how to configure one web service without the help of NetBeans. The important aspect of this example is that it uses a configuration file named The web service client is only slightly more complex to configure. A client has no notion of an implementation class. Thus it always searches for the configuration file
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="mainclientconfig">
<import location="EchoService.xml" namespace="http://service.echo.ws.xml.sun.com/"/>
</definitions>
The actual configuration is contained in the file EchoService.xml. That makes it very easy to configure clients for additional web services. Simply add more import statements to the Now while the above covers most use cases, we ran into a problem with Open ESB. Open ESB builds composite applications, which ultimately means in our case that it bundles web services inside an application inside a composite application. Consequently, looking up our configuration files from the class path did not work anymore because the files were inside a bundle on the class path. So we had to create a proprietary extension to: Pass configuration file location into WSITNote that the following is an unsupported extension to WSIT and the interfaces may change any time without notice. Moreover, the same mechanisms are used to pass servlet data into JAX-WS and you are likely introducing unpleasant side-effects if using this when running a web service as a servlet. On the client side, you need to create a client by using the The implementation on the web service side is pretty similar. Instead of Tags: GlassFish, WS-Policy, Web Services, Metro, JAX-WS, Project Tango, WSIT Posted at 07:12PM Feb 14, 2008 by Fabian Ritzmann in Sun | Comments[2] |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Hi Fabian, I ran across your website during my research on ws-policy. I am looking to do some hands-on testing of ws-policy, but I'm not sure how to start. Any recommendations on how to go about creating a small testbed to implement and test ws-policy to understand how it works and pros/cons?
thanks
Posted by Shaun on April 02, 2008 at 12:00 AM EEST #
Shaun, take a look at http://wsinterop.sun.com:3280/wspolicy_interop/ and toy a little with the test rounds there. Maybe the WS-Policy interop scenarios help as well: http://dev.w3.org/2006/ws/policy/interop/?only_with_tag=Release-5-20080127
Let me know if you have more questions.
Posted by Fabian Ritzmann on April 02, 2008 at 12:23 PM EEST #