users@glassfish.java.net

Multiple EJBs into one web service

From: <glassfish_at_javadesktop.org>
Date: Wed, 18 Apr 2007 03:12:53 PDT

Hi folks.

I am working on a demo, which has 2 stateless session beans. BankTeller and InsuranceBroker.

These are marked with @WebService, which I can compile and deploy on Glassfish. All is well.


Now I would like to package the 2 beans as one service (one WSDL). I have tried messing with all the parameters of the @WebService annotation, to no avail.

The reason I want todo this, is that the 2 session beans have functions named the same, which seems to break wsimport.

example code.

[code]
@Stateless
@WebService(
    name="BankTeller",
    portName="BankTellerPort",
    serviceName="FinancialService",
    targetNamespace="com.starjar.test.testwebservice")
public class BankTellerBean implements BankTellerLocal {

    public List<BankAccount> find(String name) {
        return null;
    }
}



@Stateless
@WebService(
   name="InsuranceBroker",
    portName="InsuranceBrokerPort",
    serviceName="FinancialService",
    targetNamespace="com.starjar.test.testwebservice")
public class InsuranceBrokerBean implements testwebservice.InsuranceBrokerLocal {
    
    public List<InsurancePolicy> find(String name) {
        return null;
    }
}



[/code]


When wsimport is run against the Insurance broker wsdl a class called FindResponse is created.
When I run wsimport again, FindResponse is over written.

To me this seems like a bug, but it could well be how it is supposed to work.

Thanks for any replies.
[Message sent by forum member 'phenderson' (phenderson)]

http://forums.java.net/jive/thread.jspa?messageID=212887