Hi found a possible solution using httpConduit and adding in it tls
parameters


               JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
               factory.setServiceClass( MyWebservices.class);
               factory.setAddress("myWsdlUrl");
               MyWebservicesws = ( MyWebservices  ) factory.create();
               HTTPConduit httpConduit = (HTTPConduit)
ClientProxy.getClient(ws).getConduit();
              setupTLS(httpConduit);

                  . ....

private static void setupTLS(Conduit conduit){
//set tls parameters in conduit object
}

Is there a better solution?
thanks
luke

Il giorno sab 18 mag 2019 alle ore 19:28 luke <[email protected]> ha
scritto:

> Hi
> I've developed a client to connect to a webService soap, like this:
>
> import org.apache.cxf.endpoint.Client;
> import org.apache.cxf.endpoint.Endpoint;
> import org.apache.cxf.frontend.ClientProxy;
> import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;
>
> import javax.xml.ws.Service;
>
>
>
> public class MyWSClient extends Service {
>
> ....
>
> public MyWebservices buildWsConnection () {
> JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
> String wsdlURL = "myWsdlUrl";
> Client clientNew = dcf.createClient(wsdlURL);
> MyWebservices webservice =
> super.getPort(clientNew.getEndpoint().getEndpointInfo().getName(),
> MyWebservices.class);
> Client client = ClientProxy.getClient(webservice);
> Map<String,Object> props=new HashMap<String,Object>();
> // set propertiesi      props.put("action","UsernameToken");
> ...
>     return webservice;
> }
>
>
> Now webservice has been modified exposing it in https.
> How can I modify my code ?
> thanks in advance
> luke
>

Reply via email to