Hi Petrica

Here is the configuration guide of the HTTP Client [1] http://cwiki.apache.org/CXF20DOC/client-http-transport.html Your can set the proxy server , and proxy server port , proxyAuthorization etc

But current CXF not support to get the wsdl with the http proxy or basic authentication setting,
because we don't use the http conduit to get the wsdl.

Willem.

petrica wrote:
Hello to all,

I have a similar problem with a generated client ( it's included in mtom
samples from Apache CXF 2.0 distribution) when I am behind of the corporate
firewall. I can't pass the proxy server and I have the error : "Server
returned HTTP response code: 407 for URL ... "

        TestMtomService tms = new TestMtomService(wsdlURL, SERVICE_NAME);
        TestMtom port = (TestMtom) tms.getPort(PORT_NAME, TestMtom.class);
        Binding binding = ((BindingProvider)port).getBinding();
        ((SOAPBinding)binding).setMTOMEnabled(true);

        Client clt = ClientProxy.getClient(port);

and I tried many posibilities included the code like Alex.

More , a created a cxf.xml file that is loaded (it seems) by method call <<
new TestMtomService(wsdlURL, SERVICE_NAME) >>. I let these settings in it :

        
        

Also I created a class named ClientAuthent which extends
HttpBasicAuthSupplier and override getPreemptiveUserPass public UserPass getPreemptiveUserPass(
            String  conduitName,
            URL     currentURL,
Message message) {
        return  createUserPass( "myuser" ,"mypassword");
}

I don't know what other settings have to do for reading all informations for
ProxyServer, ProxyPort, ProxyUser and ProxyPassword.
Also, I didn't find out others attributes for  and .

Maybe this will solve the problem.

Can somebody help me ?

Thank in advance for help,
Petrica
==================================================================

Willem Jiang-2 wrote:
Hi Axel,

I checked the HTTPConduit code, your way to set the http basic authentication is right.

Can you use tcpmon to check the authentication informantion has been set into the http headers?

If not, I think it must be the CXF's bug.


Willem.

Axel Becker wrote:
Hi,

i generated the client code with the wsdl2java from an existing wsdl.

now i want to connect to this service (it is an axis 1 webservice). the
service ist protected with a http basic authentication. i use the
following
code, but it doesnt work :-(

INFOServiceService ss = new INFOServiceService(SERVICE_URL,
SERVICE_NAME);

Client client = ClientProxy.getClient(ss.getINFOService());
HTTPConduit httpConduit = (HTTPConduit) client.getConduit();
                        
httpConduit.getAuthorization().setUserName("username1");
httpConduit.getProxyAuthorization().setUserName("username1");
                        
INFOService service = ss.getINFOService();
//do somthing with service

Where is the mistake?

Thanks for your help!
Axel


PS: the serverside (axis1) code to get the auth parameter is:
String username = MessageContext.getCurrentContext().getUsername();



Reply via email to