Re: Customizing end point location

2009-11-20 Thread Manuel Darveau
I finally found a hack to fix https support. Note that in my case, I use
axis2 with an embedde jetty. This complicates the solution a bit. If you
want axis to start its own http server skip the first part.

First part: https support in axis2 embedded in jetty server:
What I did:
In the "" section of the axis2.xml, I added this:

8444


Where HTTPSCustomListener is a custom class that extends axis's
CustomListener:

package com.xxx;
import org.apache.axis2.transport.http.CustomListener;
/**
 * We use this custom listener so the https schema is returned in the
endpoint definition and wsdl if generated
 * correctly with https schema.
 */
public class HTTPSCustomListener extends CustomListener {
public HTTPSCustomListener() {
super( 443, "https" );
}
}

And in the   section, I added:


HTTP/1.1
chunked


In my case, we dont use the default https port so it is overriden in the
transportReceiver config to 8443. If you want the default port 443, you can
remove the "8444".

Also, I did not want to have any http endpoint. I extended the default
AxisServlet to skip the part where it adds the http server:
@Override
public synchronized void init( ServletConfig config ) throws
ServletException {
/*
 * Start of copy from AxisServlet.init(ServletConfig).
 * Review this if we upgrade to axis 1.6
 */
try {
this.servletConfig = config;
ServletContext servletContext =
servletConfig.getServletContext();
this.configContext = (ConfigurationContext)
servletContext.getAttribute( CONFIGURATION_CONTEXT );
if ( configContext == null ) {
configContext = initConfigContext( config );
config.getServletContext().setAttribute(
CONFIGURATION_CONTEXT, configContext );
}
axisConfiguration = configContext.getAxisConfiguration();

ListenerManager listenerManager = new ListenerManager();
listenerManager.init( configContext );

/*
 * Start of hack to remove http endpoints from wsdl
 */
// Add HTTP
//TransportInDescription httpTransportInDescription = new
TransportInDescription( Constants.TRANSPORT_HTTP );
//httpTransportInDescription.setReceiver( this );
//listenerManager.addListener( httpTransportInDescription, true
);
/*
 * End of hack to remove http endpoints from wsdl
 */

listenerManager.start();
ListenerManager.defaultConfigurationContext = configContext;
agent = new ListingAgent( configContext );

initParams();

} catch ( Exception e ) {
throw new ServletException( e );
}

>From your axis2.xml file, you can comment the http transport receiver.
However, you need keep the http transportSender. This sucks but it is needed
since CommonsHTTPTransportSender (used by the https transportSender) does a
msgContext.getConfigurationContext().getAxisConfiguration().getTransportOut(Constants.TRANSPORT_HTTP)
with Constants.TRANSPORT_HTTP hardcoded...

End of part one

Part two: Let axis start the https server and keep http end points:
In the  section:


https://your_server_hostname:443/your_servlet_context


This will start an https server (just a connector actually). You can add
"8444" to set a custom internal port. If
you do, set the custom port in the hostname *as it is seen from the client*.
Server and client port could be different if your firewall does some port
forwarding.

Hope it help!

Manuel


On Fri, Nov 20, 2009 at 12:25 PM, Sanjay Gupta  wrote:

>  No I didn't find any solution. I did see the JIRA as well. It was broken
> in 1.4.1 as well.
>
> Sanjay
>
>
>
> *From:* Manuel Darveau [mailto:manueldarv...@gmail.com]
> *Sent:* Friday, November 20, 2009 9:01 AM
>
> *To:* axis-user@ws.apache.org
> *Subject:* Re: Customizing end point location
>
>
>
> Did you found a solution? I am not able to deploy a webservice over an
> ssl/https connection for this reason.
>
> A message on this list from Andread Veithen (Nov 5) seems to indicate that
> this is broken in 1.5 but will be fixed in 1.6. He refers to AXIS2-4465.
>
> Manuel
>
> On Wed, Sep 23, 2009 at 11:49 PM, Sanjay Gupta <
> sanjay.gu...@billwiseinc.com> wrote:
>
> Hi,
> Deos any have any suggesion on how I can accomplish this. I would
> appreciate any help.
> Thanks
> Sanjay
>
>
> -Original Message-----
> From: Sanjay Gupta [mailto:sanjay.gu...@billwiseinc.com]
> Sent: Monday, September 21, 2009 3:40 PM
> To: axis-user@ws.apache.org
>
> Subject: Customizing end point location
>
> Hi,
> I have pojo based servcies deployed in axis2 inside tomcat. The endpoint
> url in

RE: Customizing end point location

2009-11-20 Thread Sanjay Gupta
No I didn't find any solution. I did see the JIRA as well. It was broken in 
1.4.1 as well.
Sanjay

From: Manuel Darveau [mailto:manueldarv...@gmail.com]
Sent: Friday, November 20, 2009 9:01 AM
To: axis-user@ws.apache.org
Subject: Re: Customizing end point location

Did you found a solution? I am not able to deploy a webservice over an 
ssl/https connection for this reason.

A message on this list from Andread Veithen (Nov 5) seems to indicate that this 
is broken in 1.5 but will be fixed in 1.6. He refers to AXIS2-4465.

Manuel
On Wed, Sep 23, 2009 at 11:49 PM, Sanjay Gupta 
mailto:sanjay.gu...@billwiseinc.com>> wrote:
Hi,
Deos any have any suggesion on how I can accomplish this. I would appreciate 
any help.
Thanks
Sanjay

-Original Message-
From: Sanjay Gupta 
[mailto:sanjay.gu...@billwiseinc.com<mailto:sanjay.gu...@billwiseinc.com>]
Sent: Monday, September 21, 2009 3:40 PM
To: axis-user@ws.apache.org<mailto:axis-user@ws.apache.org>
Subject: Customizing end point location

Hi,
I have pojo based servcies deployed in axis2 inside tomcat. The endpoint url 
inside autogenerated wsdl has http in "

Re: Customizing end point location

2009-11-20 Thread Manuel Darveau
Did you found a solution? I am not able to deploy a webservice over an
ssl/https connection for this reason.

A message on this list from Andread Veithen (Nov 5) seems to indicate that
this is broken in 1.5 but will be fixed in 1.6. He refers to AXIS2-4465.

Manuel

On Wed, Sep 23, 2009 at 11:49 PM, Sanjay Gupta  wrote:

> Hi,
> Deos any have any suggesion on how I can accomplish this. I would
> appreciate any help.
> Thanks
> Sanjay
>
> -Original Message-
> From: Sanjay Gupta [mailto:sanjay.gu...@billwiseinc.com]
> Sent: Monday, September 21, 2009 3:40 PM
> To: axis-user@ws.apache.org
> Subject: Customizing end point location
>
> Hi,
> I have pojo based servcies deployed in axis2 inside tomcat. The endpoint
> url inside autogenerated wsdl has http in " though I am using ssl on port 8443. Is there a way to change the http  to
> https. I am able to get proper port in the url by using hostname parameter
> in transportReceiver tag but not https. The service itself is working fine
> using https on port 8443.
> Sanjay
>


RE: Customizing end point location

2009-09-23 Thread Sanjay Gupta
Hi,
Deos any have any suggesion on how I can accomplish this. I would appreciate 
any help.
Thanks
Sanjay

-Original Message-
From: Sanjay Gupta [mailto:sanjay.gu...@billwiseinc.com] 
Sent: Monday, September 21, 2009 3:40 PM
To: axis-user@ws.apache.org
Subject: Customizing end point location

Hi,
I have pojo based servcies deployed in axis2 inside tomcat. The endpoint url 
inside autogenerated wsdl has http in "

Customizing end point location

2009-09-21 Thread Sanjay Gupta
Hi,
I have pojo based servcies deployed in axis2 inside tomcat. The endpoint url 
inside autogenerated wsdl has http in "