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 "Faucher, Christian" <Ch...@axa-canada.com> on 2004/12/22 16:50:33 UTC

RE : Changing target endpoint URL

Can you add a redirect/forward in your WebServer to redirect from
http://myserver.com/serviceName <http://myserver.com/serviceName>  to
http://myserver.com/axis/services/serviceName
<http://myserver.com/axis/services/serviceName>  internally?
 
Christian Faucher



-----Message d'origine-----
De : André Næss [mailto:andre.naess@gmail.com]
Envoyé : mercredi 22 décembre 2004 10:44
À : axis-user@ws.apache.org
Objet : Changing target endpoint URL


I've recently taken over the development of an Axis based web service
implementation. The service is currently called as
http://myserver.com/axis/services/serviceName but the customer wants it
to be available as simply http://myserver.com/serviceName

I've unsuccessfully played around with mod_rewrite and googled quite a
bit for other solutions, but I can't seem to find a way to achieve this.
Does anyone know of a way to do what I want?

Regards
André Næss
  _____  

"Ce message est confidentiel, à l'usage exclusif du destinataire
ci-dessus et son contenu ne représente en aucun cas un engagement de la
part de AXA, sauf en cas de stipulation expresse et par écrit de la part
de AXA. Toute publication, utilisation ou diffusion, même partielle,
doit être autorisée préalablement. Si vous n'êtes pas destinataire de ce
message, merci d'en avertir immédiatement l'expéditeur."

"This e-mail message is confidential, for the exclusive use of the
addressee and its contents shall not constitute a commitment by AXA,
except as otherwise specifically provided in writing by AXA. Any
unauthorized disclosure, use or dissemination, either whole or partial,
is prohibited. If you are not the intended recipient of the message,
please notify the sender immediately."

Re: Changing target endpoint URL

Posted by Sunil Kothari <su...@majoris.com>.
MessageHi Christian and Andre and other Axis-users,
   I think you will have to make changes to web.xml corresponding to axis and then in the client code. 

I played around a bit and could get to http://myserver.com/axis/serviceName
from http://myserver.com/axis/services/serviceName 

Specifically, here's my web.xml in the \axis\WEB-INF folder
<servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>    
    <url-pattern>/*</url-pattern>
  </servlet-mapping>

instead of the earlier 
<servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>    
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>


and the client code now uses :
http://localhost:8080/axis/Bank instead of 

http://localhost:8080/axis/services/Bank

I think what you desire is closer now.

Sunil Kothari
Majoris Systems
  ----- Original Message ----- 
  From: Faucher, Christian 
  To: axis-user@ws.apache.org ; André Næss 
  Sent: Wednesday, December 22, 2004 9:20 PM
  Subject: RE : Changing target endpoint URL


  Can you add a redirect/forward in your WebServer to redirect from http://myserver.com/serviceName to http://myserver.com/axis/services/serviceName internally?

  Christian Faucher



  -----Message d'origine-----
  De : André Næss [mailto:andre.naess@gmail.com]
  Envoyé : mercredi 22 décembre 2004 10:44
  À : axis-user@ws.apache.org
  Objet : Changing target endpoint URL


  I've recently taken over the development of an Axis based web service implementation. The service is currently called as http://myserver.com/axis/services/serviceName but the customer wants it to be available as simply http://myserver.com/serviceName

  I've unsuccessfully played around with mod_rewrite and googled quite a bit for other solutions, but I can't seem to find a way to achieve this. Does anyone know of a way to do what I want?

  Regards
  André Næss



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

  "Ce message est confidentiel, à l'usage exclusif du destinataire ci-dessus et son contenu ne représente en aucun cas un engagement de la part de AXA, sauf en cas de stipulation expresse et par écrit de la part de AXA. Toute publication, utilisation ou diffusion, même partielle, doit être autorisée préalablement. Si vous n'êtes pas destinataire de ce message, merci d'en avertir immédiatement l'expéditeur."

  "This e-mail message is confidential, for the exclusive use of the addressee and its contents shall not constitute a commitment by AXA, except as otherwise specifically provided in writing by AXA. Any unauthorized disclosure, use or dissemination, either whole or partial, is prohibited. If you are not the intended recipient of the message, please notify the sender immediately." 

Re: RE : Changing target endpoint URL

Posted by André Næss <an...@gmail.com>.
I just found apache's mod_proxy and the ProxyPass and
ProxyPassReverse. With these two I was partially able to achieve what
I wanted. The only problem now is that the web service is versioned.
So for example there is now
http://myserver.com/axis/services/serviceName-0.8

Which with the following mod_proxy settings:
ProxyRequests Off
ProxyPass               /serviceName-0.8
http://localhost:8514/axis/services/serviceName-0.8
ProxyPassReverse        /serviceName-0.8
http://localhost:8514/axis/services/serviceName-0.8

Results in http://myserver.com/serviceName-0.8 mapping to
http://localhost:8514/axis/services/serviceName-0.8

But because of the versioning I will have to make changes to
httpd.conf every time a new version is added.

But after understanding mod_proxy I understand mod_rewrite better, the
following does the trick:

<IfModule mod_rewrite.c>
 RewriteLog c:\mod_rewrite.log
 RewriteLogLevel 9
 RewriteEngine on
 RewriteRule ^/serviceName-([0-9]\.[0-9])$
http://localhost:8514/axis/services/serviceName-$1 [P]
</IfModule>

The [P] flag on the rule forces a proxy request to be made, i.e. this
is a more powerful version of ProxyPass.

You gotta love Apache.

I hope I haven't wasted anyones time, and hopefully this can be of
help to others.

André Næss



On Wed, 22 Dec 2004 17:24:03 +0100, André Næss <an...@gmail.com> wrote:
> I just found apache's mod_proxy and the ProxyPass and
> ProxyPassReverse. With these two I was partially able to achieve what
> I wanted. The only problem now is that the web service is versioned.
> So for example there is now
> http://myserver.com/axis/services/serviceName-0.8
> 
> Which with the following mod_proxy settings:
> ProxyRequests Off
> ProxyPass               /serviceName-0.8 http://localhost:8514/axis/services/serviceName-0.8
> ProxyPassReverse        /serviceName-0.8
> http://localhost:8514/axis/services/serviceName-0.8
> 
> Results in http://myserver.com/serviceName-0.8 mapping to
> http://localhost:8514/axis/services/serviceName-0.8
> 
> But because of the versioning I will have to make changes to
> httpd.conf every time a new version is added.
> 
> But after understanding mod_proxy I understand mod_rewrite better, the
> following does the trick:
> 
> <IfModule mod_rewrite.c>
>   RewriteLog c:\mod_rewrite.log
>   RewriteLogLevel 9
>   RewriteEngine on
>   RewriteRule ^/serviceName-([0-9]\.[0-9])$
> http://localhost:8514/axis/services/serviceName-$1 [P]
> </IfModule>
> 
> The [P] flag on the rule forces a proxy request to be made, i.e. this
> is a more powerful version of ProxyPass.
> 
> You gotta love Apache.
> 
> I hope I haven't wasted anyones time, and hopefully this can be of
> help to others.
> 
> André Næss
> 
> On Wed, 22 Dec 2004 10:50:33 -0500, Faucher, Christian
> <Ch...@axa-canada.com> wrote:
> >
> >
> > Can you add a redirect/forward in your WebServer to redirect from
> > http://myserver.com/serviceName to
> > http://myserver.com/axis/services/serviceName internally?
> >
> > Christian Faucher
> >
> >
> >
> >
> > -----Message d'origine-----
> > De : André Næss [mailto:andre.naess@gmail.com]
> > Envoyé : mercredi 22 décembre 2004 10:44
> > À : axis-user@ws.apache.org
> > Objet : Changing target endpoint URL
> >
> >
> >
> > I've recently taken over the development of an Axis based web service
> > implementation. The service is currently called as
> > http://myserver.com/axis/services/serviceName but the customer wants it to
> > be available as simply http://myserver.com/serviceName
> >
> > I've unsuccessfully played around with mod_rewrite and googled quite a bit
> > for other solutions, but I can't seem to find a way to achieve this. Does
> > anyone know of a way to do what I want?
> >
> > Regards
> > André Næss
> >
> >  ________________________________
> >
> > "Ce message est confidentiel, à l'usage exclusif du destinataire ci-dessus
> > et son contenu ne représente en aucun cas un engagement de la part de AXA,
> > sauf en cas de stipulation expresse et par écrit de la part de AXA. Toute
> > publication, utilisation ou diffusion, même partielle, doit être autorisée
> > préalablement. Si vous n'êtes pas destinataire de ce message, merci d'en
> > avertir immédiatement l'expéditeur."
> >
> > "This e-mail message is confidential, for the exclusive use of the addressee
> > and its contents shall not constitute a commitment by AXA, except as
> > otherwise specifically provided in writing by AXA. Any unauthorized
> > disclosure, use or dissemination, either whole or partial, is prohibited. If
> > you are not the intended recipient of the message, please notify the sender
> > immediately."
>