Tuesday, February 12, 2008

Tuscany SCA support for Relax-ws interfaces

Relax-ws is making the news, so to see what its like I've written a sandbox module giving Apache Tuscany SCA support for interfaces typed by .rws files. Relax-ws is an attempt to make SOA and Web services easier by providing a simple alternative to WSDL with a more programmer-friendly syntax.

Its easy to use, try it out with the helloworld sample in Apache Tuscany's recent 1.1 release, just replace the .wsdl file with the equivilent .rws file and add the runtime dependency for the new Tuscanny Relax WS module:

1) delete the helloworld.wsdl file in the samples\helloworld-ws-service\src\main\resources\wsdl folder and add a new helloworld.rws file with the following contents:

namespace http://helloworld

service HelloWorld {
port {
operation getGreetings {
in {
element name {xsd:string}
}
out {
element getGreetingsResponse {xsd:string}
}
}
}
}

2) add the following dependency for the new module to the sample/helloworld-ws-service pom.xml:

<dependency>
<groupid>org.apache.tuscany.sca</groupid>
<artifactid>tuscany-interface-relax-ws</artifactid>
<version>1.2-incubating-SNAPSHOT</version>
</dependency>

3) The .rws file generates a WSDL with a portType named "HelloWorldPort" instead of "HelloWorld" as in the old wsdl so update the helloworldws.composite to have "wsdl.interface(HelloWorldPort)"

Thats it! You can now use mvn to run the sample as described in the sample README file.

0 Comments:

Post a Comment

Links to this post:

Create a Link

<< Home