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 David Levy <da...@thedistillery.com.au> on 2005/03/15 04:27:47 UTC

axis stubs

Hi,

I've been working on a project where we must generate client axis stubs for
code which we maintain. This means that we generate the WSDL via java2wsdl,
then generate the stubs with wsdl2java. This all works fine, but the problem
is that the client stubs generated with wsdl2java adhere to a different
interface then the original interface. Both interfaces are almost identical,
but do not adhere to the same java interface.

Example:
Original Interface: com.original.WidgetStore#getWidget(String id):
com.original.Widget
Generated Interface: com.generated.WidgetStore#getWidget(String id):
com.generated.Widget

There are a few problems with the current solution (lesser of evils);
either, (1) both interfaces have exactly the same package name and are
duplicates, or (2) the interfaces are different, and clients of the stubs
cannot cast the returned stubs to the original interface.

I'm going to have to do this over and over again for many types of services,
so I need a general solution I can automate. I've been thinking of solutions
which manipulate the java source code to modify the generated client stubs
so that they do adhere to the same interface, but was wondering if there was
possibly another way?

Thanks if you've read this far, and let me know if I didn't explain my
problem well enough.

Cheers,

David L



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: axis stubs

Posted by Elaine Nance <el...@commerce.state.ak.us>.
Well, when (in my limited experience) I've used -p, the package 
is generated structure and all.  So I guess I'd use the -p switch 
  and designate the interface I want to use, while moving classes 
out of danger of being overwritten.

I'm sure there are others here with better solutions than that, 
but I guess I'd start from there.

HTH,
Elaine

David Levy wrote:
> I can use the -p switch, but that just means that my packages are different.
> Whilst this works, the generated files are not tied to the original
> interface (a new one is generated).
> 
> -----Original Message-----
> From: Elaine Nance [mailto:elaine_nance@commerce.state.ak.us]
> Sent: Wednesday, 16 March 2005 3:18 AM
> To: axis-user@ws.apache.org
> Subject: Re: axis stubs
> 
> Are you using the -p (package) switch with WSDL2Java?
> 
> David Levy wrote:
> 
>>Hi,
>>
>>I've been working on a project where we must generate client axis stubs
> 
> for
> 
>>code which we maintain. This means that we generate the WSDL via
> 
> java2wsdl,
> 
>>then generate the stubs with wsdl2java. This all works fine, but the
> 
> problem
> 
>>is that the client stubs generated with wsdl2java adhere to a different
>>interface then the original interface. Both interfaces are almost
> 
> identical,
> 
>>but do not adhere to the same java interface.
>>
>>Example:
>>Original Interface: com.original.WidgetStore#getWidget(String id):
>>com.original.Widget
>>Generated Interface: com.generated.WidgetStore#getWidget(String id):
>>com.generated.Widget
>>
>>There are a few problems with the current solution (lesser of evils);
>>either, (1) both interfaces have exactly the same package name and are
>>duplicates, or (2) the interfaces are different, and clients of the stubs
>>cannot cast the returned stubs to the original interface.
>>
>>I'm going to have to do this over and over again for many types of
> 
> services,
> 
>>so I need a general solution I can automate. I've been thinking of
> 
> solutions
> 
>>which manipulate the java source code to modify the generated client stubs
>>so that they do adhere to the same interface, but was wondering if there
> 
> was
> 
>>possibly another way?
>>
>>Thanks if you've read this far, and let me know if I didn't explain my
>>problem well enough.
>>
>>Cheers,
>>
>>David L
>>
>>
> 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.
> ---------------------------------------------------------------------
> 
> 
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |  Computers are useless. They can only give you answers.
  |                                 --  Pablo Picasso  --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~





RE: axis stubs

Posted by David Levy <da...@thedistillery.com.au>.
I can use the -p switch, but that just means that my packages are different.
Whilst this works, the generated files are not tied to the original
interface (a new one is generated).

-----Original Message-----
From: Elaine Nance [mailto:elaine_nance@commerce.state.ak.us]
Sent: Wednesday, 16 March 2005 3:18 AM
To: axis-user@ws.apache.org
Subject: Re: axis stubs

Are you using the -p (package) switch with WSDL2Java?

David Levy wrote:
> Hi,
>
> I've been working on a project where we must generate client axis stubs
for
> code which we maintain. This means that we generate the WSDL via
java2wsdl,
> then generate the stubs with wsdl2java. This all works fine, but the
problem
> is that the client stubs generated with wsdl2java adhere to a different
> interface then the original interface. Both interfaces are almost
identical,
> but do not adhere to the same java interface.
>
> Example:
> Original Interface: com.original.WidgetStore#getWidget(String id):
> com.original.Widget
> Generated Interface: com.generated.WidgetStore#getWidget(String id):
> com.generated.Widget
>
> There are a few problems with the current solution (lesser of evils);
> either, (1) both interfaces have exactly the same package name and are
> duplicates, or (2) the interfaces are different, and clients of the stubs
> cannot cast the returned stubs to the original interface.
>
> I'm going to have to do this over and over again for many types of
services,
> so I need a general solution I can automate. I've been thinking of
solutions
> which manipulate the java source code to modify the generated client stubs
> so that they do adhere to the same interface, but was wondering if there
was
> possibly another way?
>
> Thanks if you've read this far, and let me know if I didn't explain my
> problem well enough.
>
> Cheers,
>
> David L
>
>
>
> 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.
> ---------------------------------------------------------------------
>
>

--
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |  Computers are useless. They can only give you answers.
  |                                 --  Pablo Picasso  --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



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: axis stubs

Posted by Elaine Nance <el...@commerce.state.ak.us>.
Are you using the -p (package) switch with WSDL2Java?

David Levy wrote:
> Hi,
> 
> I've been working on a project where we must generate client axis stubs for
> code which we maintain. This means that we generate the WSDL via java2wsdl,
> then generate the stubs with wsdl2java. This all works fine, but the problem
> is that the client stubs generated with wsdl2java adhere to a different
> interface then the original interface. Both interfaces are almost identical,
> but do not adhere to the same java interface.
> 
> Example:
> Original Interface: com.original.WidgetStore#getWidget(String id):
> com.original.Widget
> Generated Interface: com.generated.WidgetStore#getWidget(String id):
> com.generated.Widget
> 
> There are a few problems with the current solution (lesser of evils);
> either, (1) both interfaces have exactly the same package name and are
> duplicates, or (2) the interfaces are different, and clients of the stubs
> cannot cast the returned stubs to the original interface.
> 
> I'm going to have to do this over and over again for many types of services,
> so I need a general solution I can automate. I've been thinking of solutions
> which manipulate the java source code to modify the generated client stubs
> so that they do adhere to the same interface, but was wondering if there was
> possibly another way?
> 
> Thanks if you've read this far, and let me know if I didn't explain my
> problem well enough.
> 
> Cheers,
> 
> David L
> 
> 
> 
> 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.
> ---------------------------------------------------------------------
> 
> 

-- 
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  |  Computers are useless. They can only give you answers.
  |                                 --  Pablo Picasso  --
<~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~