Apache CXF Client proxy settings

14,137

Proxy setting are usually set by using httpconduit object

HelloService hello = new HelloService();
HelloPortType helloPort = cliente.getHelloPort();
org.apache.cxf.endpoint.Client client = ClientProxy.getClient(helloPort);
HTTPConduit http = (HTTPConduit) client.getConduit();
http.getClient().setProxyServer("proxy");
http.getClient().setProxyServerPort(8080);
http.getProxyAuthorization().setUserName("user proxy");
http.getProxyAuthorization().setPassword("password proxy");
Share:
14,137
avenirit12
Author by

avenirit12

Updated on June 04, 2022

Comments

  • avenirit12
    avenirit12 almost 2 years

    I am trying to Develop a Consumer for Soap Service using the tutorial at http://cxf.apache.org/docs/developing-a-consumer.html

    In the section ,"Setting Connection Properties with Contexts" I am looking at the code below

    // Set request context property.
    java.util.Map<String, Object> requestContext =
      ((javax.xml.ws.BindingProvider)port).getRequestContext();
    requestContext.put(ContextPropertyName, PropertyValue);
    
    // Invoke an operation.
    port.SomeOperation();
    

    Can someone tell me if I can set the proxy server settings using the requestContext properties and how ?. My code is running behind a proxy and I need the outgoings SOAP calls to use proxy server settings.