Thursday, July 16, 2015

Web Services Interoperability. Java client identified via certificates

Based on http://webservices20.blogspot.com/search/label/Web%20Services%20Interoperability

The problem is: to call WCP endpoint from java client being identified via certificate by both parties.

  1. Set up the environment: You should have NetBeans 7 (or higher).
  2. Download and extract somewhere metro of 2.1 version (or higher) via http://metro.java.net
  3. Establish a vpn connection to quansis if needed
  4. Install "Soap Web Services" plugin (Tools -> plugings -> available plugins)
  5. Create a new project of type Java Application:


  6. Right click the package in the project view and add a new "web service client":

  7. Paste that Wsdl URL in opened window and click "finish".




  8. Development server of quansis uses self-signed certificates, so Netbeans IDE (as any other java application) will complain, just accept the certificate in warning window. Sometimes to force it to accept the certificate you could need to open the WSDL URL via web browser
  9. On success in your project some new elements will appear in META-INF folder
  10. Unforunatelly Netbeans use default metro library from glassfish, which is 2.0. That version has some bugs with istablishing secure connections to WCP IIS endpoints. To overcome this obstacle you need:

  • Open the web service quality attribute form as you did in step 6. Uncheck the "use development defaults" check box. Now configure the keystore and trust store.

  1. write the client code.
  2. Now run the application (F6).

No comments: