Hi Vincent
Thanks you reply this mail so long after the original one, even myself already 
give it up. :-)

First really want to thank you that tip me modify server stub file directly but 
not at Client class. As this is not mentioned in the tutorial (both at 
http://ws.apache.org/axis2/1_1_1/http-transport.html and 
http://wso2.org/node/161), i guess it will be more helpful if someone could 
clarify them in the online tutorials. 

Now "Connection Refused" exception is gone, instead, i got 407 server 
authentication fault. I can make sure that my settings are correct. I can use 
Axis1 to successfully make the call. 

Here are the new exceptions:
C:\GlobalWeather\client\build\classes>java
 -Djava.ext.dirs=h:\lib net.webservicex.www.Client

- ntlm authentication scheme selected
- DES encryption is not available.
org.apache.commons.httpclient.auth.AuthenticationException: DES encryption is no
t available.
        at org.apache.commons.httpclient.auth.NTLM.getCipher(NTLM.java:118)
        at org.apache.commons.httpclient.auth.NTLM.encrypt(NTLM.java:164)
        at org.apache.commons.httpclient.auth.NTLM.hashPassword(NTLM.java:466)
        at org.apache.commons.httpclient.auth.NTLM.getType3Message(NTLM.java:417
)
        at org.apache.commons.httpclient.auth.NTLMScheme.authenticate(NTLMScheme
.java:344)
        at org.apache.commons.httpclient.HttpMethodDirector.authenticateProxy(Ht
tpMethodDirector.java:319)
        at org.apache.commons.httpclient.HttpMethodDirector.authenticate(HttpMet
hodDirector.java:231)
        at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMe
thodDirector.java:169)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:396)
        at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.jav
a:346)
        at org.apache.axis2.transport.http.AbstractHTTPSender.executeMethod(Abst
ractHTTPSender.java:541)
        at org.apache.axis2.transport.http.SOAPOverHTTPSender.send(SOAPOverHTTPS
ender.java:119)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessa
geWithCommons(CommonsHTTPTransportSender.java:335)
        at org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Com
monsHTTPTransportSender.java:204)
        at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:674)
        at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisO
peration.java:237)
        at org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAx
isOperation.java:202)
        at net.webservicex.www.GlobalWeatherStub.GetWeather(GlobalWeatherStub.ja
va:345)
        at net.webservicex.www.Client.main(Client.java:23)
Caused by: java.security.NoSuchAlgorithmException: Cannot find any provider supp
orting DES/ECB/NoPadding
        at javax.crypto.Cipher.getInstance(DashoA12275)
        at org.apache.commons.httpclient.auth.NTLM.getCipher(NTLM.java:113)
        ... 18 more
- Failure authenticating with NTLM <any realm>@proxy.cs.rmit.edu.au:8080
org.apache.axis2.AxisFault: HTTP Transport error : '407' - 'Proxy Authentication
 Required'; nested exception is:
        org.apache.axis2.AxisFault: HTTP Transport error : '407' - 'Proxy Authen
tication Required'; nested exception is:
        org.apache.axis2.AxisFault: HTTP Transport error : '407' - 'Proxy Authen
tication Required'; nested exception is:
        org.apache.axis2.AxisFault: HTTP Transport error : '407' - 'Proxy Authen
tication Required'

In my GlobalWeatherStub class, the modification is:

public GlobalWeatherStub(org.apache.axis2.context.ConfigurationContext 
configurationContext, java.lang.String targetEndpoint)
        throws org.apache.axis2.AxisFault {
         //To populate AxisService
         populateAxisService();
         populateFaults();
         
         HttpTransportProperties.ProxyProperties proxyProperties = new 
HttpTransportProperties.ProxyProperties();

      proxyProperties.setProxyName("proxy.cs.rmit.edu.au");
         proxyProperties.setProxyPort(8080);
         proxyProperties.setDomain("proxy.cs.rmit.edu.au");
         proxyProperties.setPassWord("myPass");
         proxyProperties.setUserName ("myUN");

         //in order to makesure that we use HTTP 1.0
         Options options = new Options();
         
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION
 ,
         HTTPConstants.HEADER_PROTOCOL_10);
         
options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
         proxyProperties);
         
        _serviceClient = new 
org.apache.axis2.client.ServiceClient(configurationContext,_service);
        _serviceClient.setOptions(options);
        
        configurationContext = 
_serviceClient.getServiceContext().getConfigurationContext();

        _serviceClient.getOptions().setTo(new 
org.apache.axis2.addressing.EndpointReference(
                targetEndpoint));
}

Any suggestion?

Regards
Jiang Liu


-----Original Message-----
From: Vincent Flipo <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Mon, 19 Mar 2007 14:17:46 +0100
Subject: [Axis2] problem with proxy setting

It seems that you don't do anything with the option Object when 
instantiated.
According to me, you should try to modify the stub code.

So that the ServiceClient object ( defined in the stub) use your Options 
object.
with the  method : "serviceClient.setOptions()"

In the stub, the modified code should be similar as the code below   ( 
i'm not sure it works but i'm studying the problem):

 // Basic and NTLM Authentication Axis2 uses commons-httpclient's 
preemptive authentication scheme to support Basic and NTLM Authentication.
  // the following lines defines preemptive authentication tor  support 
Basic & NTLM
   HttpTransportProperties.ProxyProperties proxyProperties = new 
HttpTransportProperties.ProxyProperties();
    

 proxyProperties.setProxyName("proxy.cs.rmit.edu.au");
 proxyProperties.setProxyPort(8080);
 proxyProperties.setDomain("proxy.cs.rmit.edu.au");
 proxyProperties.setPassWord("tl111822");
 proxyProperties.setUserName("ljiang");




        //in order to makesure that we use HTTP 1.0
       Options options = new Options();

       // defines HTTP protocol version

options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_PROTOCOL_VERSION,
      HTTPConstants.HEADER_PROTOCOL_10);


options.setProperty(org.apache.axis2.transport.http.HTTPConstants.PROXY,
      proxyProperties);

      try {
        ServiceClient serviceClient = new ServiceClient();
          serviceClient.setOptions(options);
    } catch (AxisFault e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }


Vincent Flipo
J2EE Architect

        

        
                
___________________________________________________________________________
Yahoo! Mail réinvente le mail ! Découvrez le nouveau Yahoo! Mail et son 
interface révolutionnaire.
http://fr.mail.yahoo.com



=======================

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

Reply via email to