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 "Hughes, Stan" <Th...@nov.com> on 2006/09/01 03:25:14 UTC

Forwarding a web service call...

All,

 

I am using axis to run the same set of web services on several different
servers. 

 

One of the methods is called "getItem". I am not sure if this makes
sense or not, but, here goes.

 

If I call getItem on one server and the item does not exist in that
database, I want the call to be "forwarded" to the next server in the
chain. I tried creating a proxy class and changing the endpoint and
passing the parameters to the next server, but this does not work...

 

Here is some sample code:

 

<pre>

public ItemInfo getItem(CredentialsInfo credentials,String itemId) {

 

...

 

    "get the item from the current database"

    If (theItem == null) {

         CETGServicesProxy proxy = new CETGServicesProxy();

 
proxy.setEndpoint("http://nextserver.com/cetgws/services/CETGServices");

         ItemInfo item = proxy.getItem(credentials,itemId);

         return item;

   }

...

</pre>

 

Is this possible, or, am I just being mentally challenged?

 

Thanks for any help...

 


Re: Forwarding a web service call...

Posted by Martin Gainty <mg...@hotmail.com>.
Good Afternoon Stan--

CLIENT
lets say for the sake of argument your client's packagename is called
package samples.userguide.example2
and the class is called TestClient.java
after compiling the TestClient your TestClient.class should be located in
<BaseFolder>/samples/userguide/example2/TestClient.class
so in my case I have use Axis folder for the BaseFolder 
the class is located in
/Axis/samples/userguide/example2/TestClient.class
and the way I invoke the AxisClient is to 
cd Axis
java -classpath .;$CLASSPATH samples.userguide.example2.TestClient
the TestClient main method as a reference to setendpoint as here
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
where endpoint is set to 
String endpoint = http://localhost:8080/axis/services/MessageWebService
once you invoke the WebService via
call.invoke( params)
the deployed service 'MessageWebService' Server has the ball and will call the associated stub classes (located on TOMCAT axis folder SERVER configuration)

SERVER configuration
from the package point of view the (assume previouslt generated stub) server classes are located in either one of 2 places
1)individual classes can be located in the classes folder as in
$TOMCAT_HOME/webapps/axis/WEB-INF/classes/PACKAGENAME/CLASSNAME
2)the library (jar file) can be located in lib folder as in the example
$TOMCAT_HOME/webapps/axis/WEB-INF/lib/*.jar

HTH
Martin --
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



  ----- Original Message ----- 
  From: Hughes, Stan 
  To: axis-user@ws.apache.org ; Martin Gainty 
  Sent: Monday, September 04, 2006 10:46 AM
  Subject: RE: Forwarding a web service call...


  Martin,

   

  Thanks for your response, but to be perfectly honest, I didn't understand a single word of that. I guess I am still a newbie..

   

  I am not actually using any of the Axis api for the things I have done thus far, so, digging into the servlet and such are a little beyond me.

   

  Is there not any way I can use a proxy (client) to another system to do what I want? I was thinking I could go through and change package names and such to differentiate the client from the actual (server side) implementation, but, I found this to be fairly difficult as well - not that I mind difficult. I just need to know what actually works.

   

  Thanks again,

   

  Stan

   


------------------------------------------------------------------------------

  From: Martin Gainty [mailto:mgainty@hotmail.com] 
  Sent: Saturday, September 02, 2006 9:19 AM
  To: axis-user@ws.apache.org
  Subject: Re: Forwarding a web service call...

   

  Good Morning Stan--


  Far from it ..You're NOT mentally challenged at all..You're asking a valid question which SHOULD be asked!
  As forwarding a response is a challenge I found earlier this week.. I countered the error by creating a few mutator methods in MessageContext notably

  msgContext.setResponse and msgContext.setRequest to be set from within AxisServlet as soon (as the msgContext object is acquired)
  Later in in your <WebService>Manager Stub class when you acquire the msgContext object 
  you will be able to re-acquire the original response and request objects via MessageContext accessor methods-
  BTW When I originally posted this same question I did get a response from dims (Apache committer) as well as Luis (from IEEE)

   

  I hope this helps your efforts-
  Martin--

  *********************************************************************
  This email message and any files transmitted with it contain confidential
  information intended only for the person(s) to whom this email message is
  addressed.  If you have received this email message in error, please notify
  the sender immediately by telephone or email and destroy the original
  message without making a copy.  Thank you.

   


   

    ----- Original Message ----- 

    From: Hughes, Stan 

    To: axis-user@ws.apache.org 

    Sent: Thursday, August 31, 2006 9:25 PM

    Subject: Forwarding a web service call...

     

    All,

     

    I am using axis to run the same set of web services on several different servers. 

     

    One of the methods is called "getItem". I am not sure if this makes sense or not, but, here goes.

     

    If I call getItem on one server and the item does not exist in that database, I want the call to be "forwarded" to the next server in the chain. I tried creating a proxy class and changing the endpoint and passing the parameters to the next server, but this does not work.

     

    Here is some sample code:

     

    <pre>

    public ItemInfo getItem(CredentialsInfo credentials,String itemId) {

     

    .

     

        "get the item from the current database"

        If (theItem == null) {

             CETGServicesProxy proxy = new CETGServicesProxy();

             proxy.setEndpoint("http://nextserver.com/cetgws/services/CETGServices");

             ItemInfo item = proxy.getItem(credentials,itemId);

             return item;

       }

    .

    </pre>

     

    Is this possible, or, am I just being mentally challenged?

     

    Thanks for any help.

     

Re: Axis tutorial. Did anyone buy it?

Posted by José Ferreiro <jo...@gmail.com>.
It is more like a tutorial.
Don't expect buying this book that they will explain in all details how
the libraries work and so on but
it is a good starting develop your first secure web service using
Tomcat, Axis 1.x, WSS4J, keytool and Eclipse.

Hope this helps

Happy Axis.

Jose Ferreiro

On 9/5/06, HHDirecto. Net <hh...@gmail.com> wrote:
>
> I saw it but, it the first chapter is very simple. Are another chapters
> more detailled?
> Thanks
>
>
> Obviously you should not neglect to look always at the javadoc of WSS4J
> > and Axis 1.X .
> >
> > You may look at the table of contents here:
> > http://www.agileskills2.org/DWSAA/FourtyPages.pdf
> >
> > Hope this helps.
> > I wish a wonderful day to everybody
> > and HAPPY AXIS
> >
> > José Ferreiro
> >
> >
> >
> > On 9/4/06, Martin Gainty < mgainty@hotmail.com> wrote:
> > >
> > >  Whats the ISBN?
> > >
> > > M-
> > > *********************************************************************
> > > This email message and any files transmitted with it contain
> > > confidential
> > > information intended only for the person(s) to whom this email message
> > > is
> > > addressed.  If you have received this email message in error, please
> > > notify
> > > the sender immediately by telephone or email and destroy the original
> > > message without making a copy.  Thank you.
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > >  *From:* HHDirecto.Net <hh...@gmail.com>
> > > *To:* axis-user@ws.apache.org
> > > *Sent:* Monday, September 04, 2006 12:18 PM
> > > *Subject:* Axis tutorial. Did anyone buy it?
> > >
> > > Hi,
> > > Did anyone buy "Axis book:Developing Web Services with Apache Axis" ?
> > > http://www.agileskills2.org/DWSAA/index.html
> > >
> > > Have it interesting things? or is all in ws.apache.org/axis reference?
> > >
> > > Thanks
> > >
> > >
> > >
> > >
> >
> >
> > --
> > José Ferreiro
> > EPFL Communication Systems engineer
> > ing.sys.com.dipl.EPFL
> >
> >

Re: Axis tutorial. Did anyone buy it?

Posted by "HHDirecto.Net" <hh...@gmail.com>.
I saw it but, it the first chapter is very simple. Are another chapters more
detailled?
Thanks


Obviously you should not neglect to look always at the javadoc of WSS4J and
> Axis 1.X .
>
> You may look at the table of contents here:
> http://www.agileskills2.org/DWSAA/FourtyPages.pdf
>
> Hope this helps.
> I wish a wonderful day to everybody
> and HAPPY AXIS
>
> José Ferreiro
>
>
>
> On 9/4/06, Martin Gainty <mg...@hotmail.com> wrote:
> >
> >  Whats the ISBN?
> >
> > M-
> > *********************************************************************
> > This email message and any files transmitted with it contain
> > confidential
> > information intended only for the person(s) to whom this email message
> > is
> > addressed.  If you have received this email message in error, please
> > notify
> > the sender immediately by telephone or email and destroy the original
> > message without making a copy.  Thank you.
> >
> >
> >
> >
> > ----- Original Message -----
> >  *From:* HHDirecto.Net <hh...@gmail.com>
> > *To:* axis-user@ws.apache.org
> > *Sent:* Monday, September 04, 2006 12:18 PM
> > *Subject:* Axis tutorial. Did anyone buy it?
> >
> > Hi,
> > Did anyone buy "Axis book:Developing Web Services with Apache Axis" ?
> > http://www.agileskills2.org/DWSAA/index.html
> >
> > Have it interesting things? or is all in ws.apache.org/axis reference?
> >
> > Thanks
> >
> >
> >
> >
>
>
> --
> José Ferreiro
> EPFL Communication Systems engineer
> ing.sys.com.dipl.EPFL
>
>

Re: Axis tutorial. Did anyone buy it?

Posted by José Ferreiro <jo...@gmail.com>.
Hello

ISBN is: 1-4116-7032-9.

I wanted to learn how to set up a secure web service using
signature and encryption and I bought it.

It is a good way to achieve your goal.

Obviously you should not neglect to look always at the javadoc of WSS4J and
Axis 1.X .

You may look at the table of contents here:
http://www.agileskills2.org/DWSAA/FourtyPages.pdf

Hope this helps.
I wish a wonderful day to everybody
and HAPPY AXIS

José Ferreiro



On 9/4/06, Martin Gainty <mg...@hotmail.com> wrote:
>
>  Whats the ISBN?
>
> M-
> *********************************************************************
> This email message and any files transmitted with it contain confidential
> information intended only for the person(s) to whom this email message is
> addressed.  If you have received this email message in error, please
> notify
> the sender immediately by telephone or email and destroy the original
> message without making a copy.  Thank you.
>
>
>
>
> ----- Original Message -----
> *From:* HHDirecto.Net <hh...@gmail.com>
> *To:* axis-user@ws.apache.org
> *Sent:* Monday, September 04, 2006 12:18 PM
> *Subject:* Axis tutorial. Did anyone buy it?
>
> Hi,
> Did anyone buy "Axis book:Developing Web Services with Apache Axis" ?
> http://www.agileskills2.org/DWSAA/index.html
>
> Have it interesting things? or is all in ws.apache.org/axis reference?
>
> Thanks
>
>
>
>


-- 
José Ferreiro
EPFL Communication Systems engineer
ing.sys.com.dipl.EPFL

Re: Axis tutorial. Did anyone buy it?

Posted by Martin Gainty <mg...@hotmail.com>.
Whats the ISBN?

M-
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



  ----- Original Message ----- 
  From: HHDirecto.Net 
  To: axis-user@ws.apache.org 
  Sent: Monday, September 04, 2006 12:18 PM
  Subject: Axis tutorial. Did anyone buy it?


  Hi,
  Did anyone buy "Axis book:Developing Web Services with Apache Axis" ?
  http://www.agileskills2.org/DWSAA/index.html

  Have it interesting things? or is all in ws.apache.org/axis reference?

  Thanks


Axis tutorial. Did anyone buy it?

Posted by "HHDirecto.Net" <hh...@gmail.com>.
Hi,
Did anyone buy "Axis book:Developing Web Services with Apache Axis" ?
http://www.agileskills2.org/DWSAA/index.html

Have it interesting things? or is all in ws.apache.org/axis reference?

Thanks


RE: Forwarding a web service call...

Posted by "Hughes, Stan" <Th...@nov.com>.
Martin,

 

Thanks for your response, but to be perfectly honest, I didn't
understand a single word of that... I guess I am still a newbie....

 

I am not actually using any of the Axis api for the things I have done
thus far, so, digging into the servlet and such are a little beyond me.

 

Is there not any way I can use a proxy (client) to another system to do
what I want? I was thinking I could go through and change package names
and such to differentiate the client from the actual (server side)
implementation, but, I found this to be fairly difficult as well - not
that I mind difficult. I just need to know what actually works.

 

Thanks again,

 

Stan

 

________________________________

From: Martin Gainty [mailto:mgainty@hotmail.com] 
Sent: Saturday, September 02, 2006 9:19 AM
To: axis-user@ws.apache.org
Subject: Re: Forwarding a web service call...

 

Good Morning Stan--


Far from it ..You're NOT mentally challenged at all..You're asking a
valid question which SHOULD be asked!
As forwarding a response is a challenge I found earlier this week.. I
countered the error by creating a few mutator methods in MessageContext
notably

msgContext.setResponse and msgContext.setRequest to be set from within
AxisServlet as soon (as the msgContext object is acquired)
Later in in your <WebService>Manager Stub class when you acquire the
msgContext object 
you will be able to re-acquire the original response and request objects
via MessageContext accessor methods-
BTW When I originally posted this same question I did get a response
from dims (Apache committer) as well as Luis (from IEEE)

 

I hope this helps your efforts-
Martin--

*********************************************************************
This email message and any files transmitted with it contain
confidential
information intended only for the person(s) to whom this email message
is
addressed.  If you have received this email message in error, please
notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.

 


 

	----- Original Message ----- 

	From: Hughes, Stan <ma...@nov.com>  

	To: axis-user@ws.apache.org 

	Sent: Thursday, August 31, 2006 9:25 PM

	Subject: Forwarding a web service call...

	 

	All,

	 

	I am using axis to run the same set of web services on several
different servers. 

	 

	One of the methods is called "getItem". I am not sure if this
makes sense or not, but, here goes.

	 

	If I call getItem on one server and the item does not exist in
that database, I want the call to be "forwarded" to the next server in
the chain. I tried creating a proxy class and changing the endpoint and
passing the parameters to the next server, but this does not work...

	 

	Here is some sample code:

	 

	<pre>

	public ItemInfo getItem(CredentialsInfo credentials,String
itemId) {

	 

	...

	 

	    "get the item from the current database"

	    If (theItem == null) {

	         CETGServicesProxy proxy = new CETGServicesProxy();

	
proxy.setEndpoint("http://nextserver.com/cetgws/services/CETGServices");

	         ItemInfo item = proxy.getItem(credentials,itemId);

	         return item;

	   }

	...

	</pre>

	 

	Is this possible, or, am I just being mentally challenged?

	 

	Thanks for any help...

	 


Re: Forwarding a web service call...

Posted by Martin Gainty <mg...@hotmail.com>.
Good Morning Stan--

Far from it ..You're NOT mentally challenged at all..You're asking a valid question which SHOULD be asked!
As forwarding a response is a challenge I found earlier this week.. I countered the error by creating a few mutator methods in MessageContext notably
msgContext.setResponse and msgContext.setRequest to be set from within AxisServlet as soon (as the msgContext object is acquired)
Later in in your <WebService>Manager Stub class when you acquire the msgContext object 
you will be able to re-acquire the original response and request objects via MessageContext accessor methods-
BTW When I originally posted this same question I did get a response from dims (Apache committer) as well as Luis (from IEEE)

I hope this helps your efforts-
Martin--
*********************************************************************
This email message and any files transmitted with it contain confidential
information intended only for the person(s) to whom this email message is
addressed.  If you have received this email message in error, please notify
the sender immediately by telephone or email and destroy the original
message without making a copy.  Thank you.



  ----- Original Message ----- 
  From: Hughes, Stan 
  To: axis-user@ws.apache.org 
  Sent: Thursday, August 31, 2006 9:25 PM
  Subject: Forwarding a web service call...


  All,

   

  I am using axis to run the same set of web services on several different servers. 

   

  One of the methods is called "getItem". I am not sure if this makes sense or not, but, here goes.

   

  If I call getItem on one server and the item does not exist in that database, I want the call to be "forwarded" to the next server in the chain. I tried creating a proxy class and changing the endpoint and passing the parameters to the next server, but this does not work.

   

  Here is some sample code:

   

  <pre>

  public ItemInfo getItem(CredentialsInfo credentials,String itemId) {

   

  .

   

      "get the item from the current database"

      If (theItem == null) {

           CETGServicesProxy proxy = new CETGServicesProxy();

           proxy.setEndpoint("http://nextserver.com/cetgws/services/CETGServices");

           ItemInfo item = proxy.getItem(credentials,itemId);

           return item;

     }

  .

  </pre>

   

  Is this possible, or, am I just being mentally challenged?

   

  Thanks for any help.