0

Could you please help me about the steps to be followed for generating stubs using wsimport. In my case my WSDL requires username and password if it has to be downloaded using certificate via SSL. I used the command wsimport -keep -s path url.

But it is not working. how to provide username and password to get the WSDL?

Thanks.

Suresh Atta
  • 120,458
  • 37
  • 198
  • 307
Sushma
  • 121
  • 4
  • 18
  • possible duplicate of [How can I use wsimport to generate a webservice client which wsdl requires authentication?](http://stackoverflow.com/questions/6293722/how-can-i-use-wsimport-to-generate-a-webservice-client-which-wsdl-requires-authe) – pdw Aug 13 '14 at 10:52

1 Answers1

1

In case the WSDL Expects user credentials use the below

C:>wsimport -keep -d D:/XXX -Xauthfile WS_Auth.txt {http}://CustomURL.com/Metrics/Services/MetricDrop.asmx?WSDL

Where WS_Auth.txt contains:

{http}://domainName\username:password@WSDL_URL//Metrics/Services/MetricDrop.asmx?WSDL

Maas
  • 1,317
  • 9
  • 20
  • Thank you for the help. But still i'm getting the error. [ERROR] java.security.cert.CertificateException: No subject alternative names present. in my authentication file i kept as ' http://16.175.217.24:8443\admin\username:password@https://16.175.217.24:8443/cfcc/control?view=services/AdministratorService?WSDL' Is there any prob with my file? – Sushma Aug 13 '14 at 11:04
  • @Sushma : What is the error? And can you open the WSDL file in browser using the credentials? – Maas Aug 13 '14 at 11:05
  • Your auth file should contain "{https}://username:password@url?wsdl" – Maas Aug 13 '14 at 11:10
  • Ok. I tried like that also, i'm able to access the WSDL via URL, but when i use wsimport i'm repeatedly getting the same cetification error. What might be the issue. Actually the certificate in the URL having the same host name as i specified in the wsimport but still i'm getting the erro? – Sushma Aug 13 '14 at 11:16
  • See if this link helps for cert error : http://stackoverflow.com/questions/8443081/how-are-ssl-certificate-server-names-resolved-can-i-add-alternative-names-using/8444863#8444863 – Maas Aug 13 '14 at 11:18
  • 1
    *"But still I'm getting the error... java.security.cert.CertificateException"* - this looks like a different problem (none of this was mentioned in your post). You should open a new question and thank Maas by accepting his answer. When you accept his answer, future visitors will be able to locate the correct answer quickly. – jww Aug 13 '14 at 11:48