geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Janko Heilgeist <janko.heilge...@scai.fraunhofer.de>
Subject Deploying a self-referencing web service
Date Wed, 12 Nov 2008 12:53:28 GMT
Hi,

I currently try to develop a web service that is supposed to contact
other web service instances of the same port type at remote locations. I
started with a WSDL and would like to have as much code generated by
Geronimo as possible. My problem is, that I can't specify the
<soap:address location=""/> value of a service. This value is
automatically patched into the WSDL during deployment of the web service
implementation by Geronimo. Unfortunately, the generated client stub
seems to read the WSDL from its own module file and therefore receives
the unpatched version. This leads to a failure of the deployment process.

Therefore, I played around with alternatives that might allow me to
deploy the client without a reference to the WSDL. E.g.

@Stateless
@WebService(
serviceName="MyService", portName="MyServicePort",
endpointInterface="com.heilgeist.tests.tst_ws_annotations.ws_ejb.MyServiceInterface",

targetNamespace="http://heilgeist.com/tests/tst-ws-annotations/service")
public class MyServiceEJBImpl implements MyServiceInterface {
    @WebServiceRef(name="service/AnotherMyWebService")
    private MyServiceInterface myService;

    public void doSomething(int counter) {
        if (counter > 0) {
            BindingProvider bp = (BindingProvider) myService;
            // the address will come from a DB in the real service
            bp.getRequestContext().put(
                BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
                "http://localhost:9090/MyWebService");
            myService.doSomething(--counter);
        }
    }

}

ejb-jar.xml:
<session>
    <ejb-name>MyWebService</ejb-name>
    <ejb-class>
        com.heilgeist.tests.tst_ws_annotations.ws_ejb.MyServiceEJBImpl
    </ejb-class>

    <service-ref>
        <service-ref-name>service/AnotherMyWebService</service-ref-name>
        <service-interface>javax.xml.ws.Service</service-interface>
    </service-ref>
</session>

This set-up works fine as long as only a single web service is packaged
in the EJB-JAR. As soon as I put a second (completely independent) web
service in the same module, the deployment process aborts with

com.heilgeist.tests.tst_ws_annotations.ws_ejb.MyServiceInterface does
not extend javax.xml.rpc.Service or javax.xml.ws.Service

So it looks like Geronimo is guessing some missing information, that it
can no longer guess with two services. Any ideas on how to solve this?

Regards, Janko


Mime
View raw message