You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Mi Zhang <mi...@thedistillery.com.au> on 2005/03/14 04:23:43 UTC

Consume EJB and Web Services

Hi,

I have deployed an EJB as Web Service using Axis. The questions I have
are:

1) If it is possible to use one client to invoke EJB and Web Service.

or

2) If  question 1 is impossible, can I use one interface for EJB and Web
Service clients, for example:
EJB client:

InitialContext initCont = new InitialContext(properties);
NiceThingsHome home = (NiceThingsHome)initCont.lookup("NiceThingsBean");

NiceThingsEJB ntBean = (NiceThingsInterface )home.create();
ntBean.findNiceThingsFor("xxx");


Web Service client:

NiceThingsEJBServiceLocator locator = new NiceThingsEJBServiceLocator();

NiceThingsWSIF niceThingWS =
(NiceThingsWSIF)locator.getPort(NiceThingsWSIF.class);
niceThingWS.findNiceThingsFor("xxx");


What I want to achieve is to use the same interface for NiceThingsEJB
and NiceThingsWSIF, then my client only needs to deal with one
Interface. The idea behinds this is to write a client which can invoke
both EJB and Web Service.

Thanks,
MiZ



The Distillery Pty Limited
ABN 69 080 932 467
PO Box 940, Dickson ACT 2602, AUSTRALIA
Phone: +61 2 6272 0200
Fax: +61 2 6262 5151
Web: www.thedistillery.com.au

The Distillery Inc
2111 Wilson Blvd, Suite 700,
Arlington, Virginia 22201, USA
Phone: +1 703 351 5082
Web: www.thedistilleryinc.com

The Distillery (Europe) Ltd
53 Chandos Place London WC2N 4HS
Tel: +44 (0)20 7812 6692
Fax: +44 (0)20 7812 6677


---------------------------------------------------------------------
The information contained in this email and any files attached may be
confidential and/or copyrighted information of The Distillery, Third
Parties and/or the intended recipient and may be the subject of legal
privilege or public interest immunity. You may only reproduce or
distribute the material if you are expressly authorised by us to do
so. If you are not the intended recipient, any use, disclosure,
copying, circulation, forwarding, printing or publication of this
message or attached files is strictly forbidden.

If you have received this document in error or are not an intended
recipient, please notify the sender and delete from your Inbox and/or
system.

The Distillery does not represent or warrant that files attached to
this e-mail are free from computer viruses or other defects and
liability is limited to the resupply (or cost of resupply) of the
attached files.
---------------------------------------------------------------------

Re: Consume EJB and Web Services

Posted by Anne Thomas Manes <at...@gmail.com>.
Then I suggest you use WSIF.


On Tue, 15 Mar 2005 09:21:08 +1100, Mi Zhang <mi...@thedistillery.com.au> wrote:
> I can use Axis client to invoke Ejb-based Web Service and Ejb client to
> invoke Ejb. But what I want to do is to use one client to invoke both.
> 
> -----Original Message-----
> From: fabrizio picca [mailto:fabrizio.picca@gmail.com]
> Sent: Monday, 14 March 2005 7:03 PM
> To: axis-user@ws.apache.org; mi.zhang@thedistillery.com.au
> Subject: Re: Consume EJB and Web Services
> 
> I've just developed my application using an Ejb-based web service and a
> plain axis client. I've followed the axis user guide on the website and
> all went well.
> 
> The only problems i had was related to the mapping of custom datatypes.
> But here, in this mailing list, i found all the answers!
> 
> On Mon, 14 Mar 2005 14:23:43 +1100, Mi Zhang <mi...@thedistillery.com.au>
> wrote:
> >
> > Hi,
> >
> > I have deployed an EJB as Web Service using Axis. The questions I have
> 
> > are:
> >
> > 1) If it is possible to use one client to invoke EJB and Web Service.
> >
> > or
> >
> > 2) If  question 1 is impossible, can I use one interface for EJB and
> > Web Service clients, for example: EJB client:
> >
> > InitialContext initCont = new InitialContext(properties);
> > NiceThingsHome home =
> > (NiceThingsHome)initCont.lookup("NiceThingsBean");
> >
> >  NiceThingsEJB ntBean = (NiceThingsInterface )home.create();
> > ntBean.findNiceThingsFor("xxx");
> >
> >
> > Web Service client:
> >
> > NiceThingsEJBServiceLocator locator = new
> > NiceThingsEJBServiceLocator();
> >
> > NiceThingsWSIF niceThingWS =
> > (NiceThingsWSIF)locator.getPort(NiceThingsWSIF.class);
> > niceThingWS.findNiceThingsFor("xxx");
> >
> >
> > What I want to achieve is to use the same interface for NiceThingsEJB
> > and NiceThingsWSIF, then my client only needs to deal with one
> > Interface. The idea behinds this is to write a client which can invoke
> 
> > both EJB and Web Service.
> >
> > Thanks,
> > MiZ
> >
> > ________________________________
> >  The Distillery Pty Limited
> >  ABN 69 080 932 467
> >  P.O. Box 940
> >  Dickson ACT, 2602.
> >  Australia
> >  Phone: +61 2 6272 0200
> >  Fax: +61 2 62625151
> >  Web: www.thedistillery.com.au
> >
> > The Distillery Inc.
> >  2111 Wilson Blvd, Suite 700
> >  Arlington, Virginia 22201
> >  USA
> >  Phone: +1 703 351 5082
> >  Web: www.thedistilleryinc.com
> >
> > The Distillery (Europe) Ltd
> >  53 Chandos Place
> >  London WC2N 4HS
> >  United Kingdom
> >  Phone: +44 (0)20 7812 6692
> >  Fax: +44 (0)20 7812 6677
> >
> > ________________________________
> >  The information contained in this email and any files attached may be
> 
> > confidential and/or copyrighted information of The Distillery, Third
> > Parties and/or the intended recipient and may be the subject of legal
> > privilege or public interest immunity. You may only reproduce or
> > distribute the material if you are expressly authorised by us to do
> > so. If you are not the intended recipient, any use, disclosure,
> > copying, circulation, forwarding, printing or publication of this
> > message or attached files is strictly forbidden.
> >
> >
> >
> > If you have received this document in error or are not an intended
> > recipient, please notify the sender immediately and delete from your
> > Inbox and/or system.
> >
> > The Distillery does not represent or warrant that files attached to
> > this e-mail are free from computer viruses or other defects and
> > liability is limited to the resupply (or cost of resupply) of the
> > attached files.________________________________
> >
> >
> >
> 
> The Distillery Pty Limited
> ABN 69 080 932 467
> PO Box 940, Dickson ACT 2602, AUSTRALIA
> Phone: +61 2 6272 0200
> Fax: +61 2 6262 5151
> Web: www.thedistillery.com.au
> 
> The Distillery Inc
> 2111 Wilson Blvd, Suite 700,
> Arlington, Virginia 22201, USA
> Phone: +1 703 351 5082
> Web: www.thedistilleryinc.com
> 
> The Distillery (Europe) Ltd
> 53 Chandos Place London WC2N 4HS
> Tel: +44 (0)20 7812 6692
> Fax: +44 (0)20 7812 6677
> 
> ---------------------------------------------------------------------
> The information contained in this email and any files attached may be
> confidential and/or copyrighted information of The Distillery, Third
> Parties and/or the intended recipient and may be the subject of legal
> privilege or public interest immunity. You may only reproduce or
> distribute the material if you are expressly authorised by us to do
> so. If you are not the intended recipient, any use, disclosure,
> copying, circulation, forwarding, printing or publication of this
> message or attached files is strictly forbidden.
> 
> If you have received this document in error or are not an intended
> recipient, please notify the sender and delete from your Inbox and/or
> system.
> 
> The Distillery does not represent or warrant that files attached to
> this e-mail are free from computer viruses or other defects and
> liability is limited to the resupply (or cost of resupply) of the
> attached files.
> ---------------------------------------------------------------------
> 
>

RE: Consume EJB and Web Services

Posted by Mi Zhang <mi...@thedistillery.com.au>.
I can use Axis client to invoke Ejb-based Web Service and Ejb client to
invoke Ejb. But what I want to do is to use one client to invoke both.

-----Original Message-----
From: fabrizio picca [mailto:fabrizio.picca@gmail.com]
Sent: Monday, 14 March 2005 7:03 PM
To: axis-user@ws.apache.org; mi.zhang@thedistillery.com.au
Subject: Re: Consume EJB and Web Services


I've just developed my application using an Ejb-based web service and a
plain axis client. I've followed the axis user guide on the website and
all went well.

The only problems i had was related to the mapping of custom datatypes.
But here, in this mailing list, i found all the answers!



On Mon, 14 Mar 2005 14:23:43 +1100, Mi Zhang <mi...@thedistillery.com.au>
wrote:
>
> Hi,
>
> I have deployed an EJB as Web Service using Axis. The questions I have

> are:
>
> 1) If it is possible to use one client to invoke EJB and Web Service.
>
> or
>
> 2) If  question 1 is impossible, can I use one interface for EJB and
> Web Service clients, for example: EJB client:
>
> InitialContext initCont = new InitialContext(properties);
> NiceThingsHome home =
> (NiceThingsHome)initCont.lookup("NiceThingsBean");
>
>  NiceThingsEJB ntBean = (NiceThingsInterface )home.create();
> ntBean.findNiceThingsFor("xxx");
>
>
> Web Service client:
>
> NiceThingsEJBServiceLocator locator = new
> NiceThingsEJBServiceLocator();
>
> NiceThingsWSIF niceThingWS =
> (NiceThingsWSIF)locator.getPort(NiceThingsWSIF.class);
> niceThingWS.findNiceThingsFor("xxx");
>
>
> What I want to achieve is to use the same interface for NiceThingsEJB
> and NiceThingsWSIF, then my client only needs to deal with one
> Interface. The idea behinds this is to write a client which can invoke

> both EJB and Web Service.
>
> Thanks,
> MiZ
>
> ________________________________
>  The Distillery Pty Limited
>  ABN 69 080 932 467
>  P.O. Box 940
>  Dickson ACT, 2602.
>  Australia
>  Phone: +61 2 6272 0200
>  Fax: +61 2 62625151
>  Web: www.thedistillery.com.au
>
> The Distillery Inc.
>  2111 Wilson Blvd, Suite 700
>  Arlington, Virginia 22201
>  USA
>  Phone: +1 703 351 5082
>  Web: www.thedistilleryinc.com
>
> The Distillery (Europe) Ltd
>  53 Chandos Place
>  London WC2N 4HS
>  United Kingdom
>  Phone: +44 (0)20 7812 6692
>  Fax: +44 (0)20 7812 6677
>
> ________________________________
>  The information contained in this email and any files attached may be

> confidential and/or copyrighted information of The Distillery, Third
> Parties and/or the intended recipient and may be the subject of legal
> privilege or public interest immunity. You may only reproduce or
> distribute the material if you are expressly authorised by us to do
> so. If you are not the intended recipient, any use, disclosure,
> copying, circulation, forwarding, printing or publication of this
> message or attached files is strictly forbidden.
>
>
>
> If you have received this document in error or are not an intended
> recipient, please notify the sender immediately and delete from your
> Inbox and/or system.
>
> The Distillery does not represent or warrant that files attached to
> this e-mail are free from computer viruses or other defects and
> liability is limited to the resupply (or cost of resupply) of the
> attached files.________________________________
>
>
>



The Distillery Pty Limited
ABN 69 080 932 467
PO Box 940, Dickson ACT 2602, AUSTRALIA
Phone: +61 2 6272 0200
Fax: +61 2 6262 5151
Web: www.thedistillery.com.au

The Distillery Inc
2111 Wilson Blvd, Suite 700,
Arlington, Virginia 22201, USA
Phone: +1 703 351 5082
Web: www.thedistilleryinc.com

The Distillery (Europe) Ltd
53 Chandos Place London WC2N 4HS
Tel: +44 (0)20 7812 6692
Fax: +44 (0)20 7812 6677


---------------------------------------------------------------------
The information contained in this email and any files attached may be
confidential and/or copyrighted information of The Distillery, Third
Parties and/or the intended recipient and may be the subject of legal
privilege or public interest immunity. You may only reproduce or
distribute the material if you are expressly authorised by us to do
so. If you are not the intended recipient, any use, disclosure,
copying, circulation, forwarding, printing or publication of this
message or attached files is strictly forbidden.

If you have received this document in error or are not an intended
recipient, please notify the sender and delete from your Inbox and/or
system.

The Distillery does not represent or warrant that files attached to
this e-mail are free from computer viruses or other defects and
liability is limited to the resupply (or cost of resupply) of the
attached files.
---------------------------------------------------------------------


Re: Consume EJB and Web Services

Posted by fabrizio picca <fa...@gmail.com>.
I've just developed my application using an Ejb-based web service and
a plain axis client.
I've followed the axis user guide on the website and all went well.

The only problems i had was related to the mapping of custom datatypes.
But here, in this mailing list, i found all the answers!



On Mon, 14 Mar 2005 14:23:43 +1100, Mi Zhang <mi...@thedistillery.com.au> wrote:
>  
> Hi, 
>   
> I have deployed an EJB as Web Service using Axis. The questions I have are: 
>   
> 1) If it is possible to use one client to invoke EJB and Web Service. 
>   
> or 
>   
> 2) If  question 1 is impossible, can I use one interface for EJB and Web
> Service clients, for example: 
> EJB client: 
>   
> InitialContext initCont = new InitialContext(properties);
> NiceThingsHome home = (NiceThingsHome)initCont.lookup("NiceThingsBean");
>       
>  NiceThingsEJB ntBean = (NiceThingsInterface )home.create(); 
> ntBean.findNiceThingsFor("xxx"); 
>   
>   
> Web Service client: 
>   
> NiceThingsEJBServiceLocator locator = new NiceThingsEJBServiceLocator();
> 
> NiceThingsWSIF niceThingWS =
> (NiceThingsWSIF)locator.getPort(NiceThingsWSIF.class); 
> niceThingWS.findNiceThingsFor("xxx"); 
>   
>   
> What I want to achieve is to use the same interface for NiceThingsEJB and
> NiceThingsWSIF, then my client only needs to deal with one Interface. The
> idea behinds this is to write a client which can invoke both EJB and Web
> Service. 
>   
> Thanks, 
> MiZ 
>   
> ________________________________
>  The Distillery Pty Limited
>  ABN 69 080 932 467
>  P.O. Box 940
>  Dickson ACT, 2602.
>  Australia
>  Phone: +61 2 6272 0200
>  Fax: +61 2 62625151
>  Web: www.thedistillery.com.au 
> 
> The Distillery Inc.
>  2111 Wilson Blvd, Suite 700
>  Arlington, Virginia 22201
>  USA
>  Phone: +1 703 351 5082
>  Web: www.thedistilleryinc.com 
> 
> The Distillery (Europe) Ltd
>  53 Chandos Place
>  London WC2N 4HS
>  United Kingdom
>  Phone: +44 (0)20 7812 6692
>  Fax: +44 (0)20 7812 6677 
> 
> ________________________________
>  The information contained in this email and any files attached may be
> confidential and/or copyrighted information of The Distillery, Third Parties
> and/or the intended recipient and may be the subject of legal privilege or
> public interest immunity. You may only reproduce or distribute the material
> if you are expressly authorised by us to do so. If you are not the intended
> recipient, any use, disclosure, copying, circulation, forwarding, printing
> or publication of this message or attached files is strictly forbidden.
> 
>  
> 
> If you have received this document in error or are not an intended
> recipient, please notify the sender immediately and delete from your Inbox
> and/or system. 
> 
> The Distillery does not represent or warrant that files attached to this
> e-mail are free from computer viruses or other defects and liability is
> limited to the resupply (or cost of resupply) of the attached
> files.________________________________
> 
> 
>