Note that there are some explanatory texts on larger screens.

plurals
  1. POCxf HTTPS client example
    primarykey
    data
    text
    <p>I need a Cxf client which can deal with HTTPS wsdl url. The cxf documentation isn't really big, so i would appreciate some help.</p> <p>Is there any example of what i want ? google isn't my friend today :(</p> <p>Thx for helping me.</p> <hr> <p>EDIT1: I just don't know how to do this. When i try :</p> <pre><code>JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.setAddress("https://mysite/view/ext-services/dpDataService?wsdl"); factory.setServiceClass(DPDataService.class); DPDataService client = (DPDataService) factory.create(); client.getAllHostServiceMetric("1", "1"); </code></pre> <p>I have the error :</p> <pre><code> Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: Could not find conduit initiator for transport </code></pre> <hr> <p>EDIt2:</p> <p>with :</p> <p><code>factory.setWsdlURL</code></p> <p>i have the error :</p> <pre><code>javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target </code></pre> <hr> <p>EDIt3:</p> <p>I create a keystore and add the certificate, then i set the property:</p> <pre><code>System.setProperty("javax.net.ssl.trustStore", "myKeyStore"); System.setProperty("javax.net.ssl.trustStorePassword", "password"); </code></pre> <p>But now the error is Exception in thread "main" <code>org.apache.cxf.service.factory.ServiceConstructionException: Could not find definition for service {http://unknown.namespace/}</code></p> <p>i see that the console say : reating Service {<a href="http://unknown.namespace/" rel="nofollow noreferrer">http://unknown.namespace/</a>}</p> <p>maybe i forgot something.</p> <hr> <p>EDIT4 : Many news :</p> <p>It seems that the https is no longer a problem. but i still need help :)</p> <p>So here with this code :</p> <pre><code>JaxWsDynamicClientFactory factory = JaxWsDynamicClientFactory.newInstance(); Client client = factory.createClient("https://url/services?wsdl"); Object[] res = client.invoke("getSomething", "param"); </code></pre> <p>I have the error :</p> <pre><code>Caused by: org.xml.sax.SAXParseException: Both jaxb:version and version are present </code></pre> <p>Another code :</p> <pre><code>ClientProxyFactoryBean </code></pre> <p>=> some error</p> <p>with : <code>JaxWsProxyFactoryBean + setWsdlURL</code></p> <pre><code>Could not find definition for service {http://unknown.namespace/}DPDataServiceService. </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload