Looking at the source for CommonsHTTPTransportSender method
writeMessageWithCommons the first thing it does is to form a
java.net.URL from the service address ("myssl://localhost/axis2/...").
This causes a java.net.MalformedURLException to be thrown, which is
caught and rethrown as the AxisFault that I am seeing.

So java.net.URL knows nothing at this point about my newly registered
protocol "myssl".

Googling suggests I need to register a protocol handler by setting the
system property "java.protocol.handler.pkgs" with the class name of an
appropriate handler.

Now I had expected that this would have happened for me by calling
org.apache.commons.httpclient.protocol.Protocol.registerProtocol(...).

So have I missed a configuration step that sets up an appropriate
protocol handler that knows about the httpclient Protocol registration,
or is it a bug in CommonsHTTPTransportSender to use java.net.URL instead
of something provided by the httpclient package or the more general
java.net.URI?

Steve Hindmarch

One IT - iBridge Development

> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
> Sent: 23 August 2007 17:39
> To: [email protected]
> Subject: RE: [axis2] AxisFault "Transport out has not been 
> set" with self signed certificates
> 
> I advanced a bit by adding the transport sender with these lines
> 
>       TransportSender tSender=new CommonsHTTPTransportSender();
>       TransportOutDescription tOutDesc=new
> TransportOutDescription("myssl");
>       tOutDesc.setSender(tSender);
>       tOutDesc.addParameter(
>           new Parameter(
>               HTTPConstants.PROTOCOL_VERSION
>               ,HTTPConstants.HEADER_PROTOCOL_11));
>       tOutDesc.addParameter(new
> Parameter("Transfer-Encoding","chunked"));
>       ServiceClient serviceClient=stub._getServiceClient();
>       AxisConfiguration
> axisConfig=serviceClient.getAxisConfiguration();
>       axisConfig.addTransportOut(tOutDesc);
> 
> This time I got the following exception:-
> 
> Caught org.apache.axis2.AxisFault: unknown protocol: myssl
> org.apache.axis2.AxisFault: unknown protocol: myssl
>       at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.wri
> teMessageW
> ithCommons(CommonsHTTPTransportSender.java:330)
>       at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.inv
> oke(Common
> sHTTPTransportSender.java:206)
>       at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
> 
> Which ties in with something in another thread
> http://mail-archives.apache.org/mod_mbox/ws-axis-user/200704.m
> box/%3c100
> [EMAIL PROTECTED]
> 
> It suggests that the CommonsHTTPTransportSender ignores the newly
> registered protocol "myssl" and so cannot find the custom socket
> factory. Is this a bug?
> 
> The workaround is to register the protocol against "https", 
> which allows
> the transport sender to find the socket factory, but this is not
> satisfactory as I may not want to use the custom (and rather insecure)
> socket factory in all cases.
> 
> Steve Hindmarch
> 
> One IT - iBridge Development
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to