Skip to main content

interface-based service development

1 reply [Last post]
domurtag
Offline
Joined: 2011-03-14
Points: 0

Hi,
In my experience, most OO distributed computing technologies (RMI, CORBA, etc.) work something like this:

  • define a remote interface (in IDL, Java, etc.)
  • write an implementation of the interface
  • use a tool (rmic, IDL compiler) that generates code which enables a client to get a reference to the implementation of the interface given some endpoint (URL).

The important point is that the remote interface is the contract that both the client and service adhere to. I've had a look at metro, and it doesn't seem to follow this pattern. If I define a remote implementation such as:

@WebService
class MyServiceImpl implements MyService {
    @WebMethod
    MyType doIt() {
        // impl omitted
    }
}

I then use metro to generate a WSDL from this implementation and client code from the WSDL. Because the client code is generated from the WSDL, it knows nothing about MyService. The result is that there is no way for the client to program to MyService.
Is there any way to use metro in a manner that supports programming to interfaces (rather than programming to WSDL documents that are automatically generated from a service implementation)?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kubatzki
Offline
Joined: 2011-03-25
Points: 0

hi ,
I think the interface contract is actually in the wsdl itself. For your
purpose you migth have a look at the wsdl cusomization feature.
see ref http://jax-ws.java.net/nonav/2.1.2/docs/customizations.html
ys