How to generate SoapProxy from wsimport?
Asked Answered
V

2

6

I'm comparing the client stubs generated by IBM Rational Application Developer with Java's wsimport and notice that IBM RAD generates an extra class which is the SOAPProxy class. This class allows the setting of the URL of the web service.

How can I generate a SOAPProxy class in Java's wsimport? Are IBM RAD's wsimport and Java's wsimport the same?

Below are the classes generated by IBM RAD:

  • ObjectFactory.java
  • package-info.java
  • WSCalculator_Service.java
  • WSCalculator.java
  • WSCalculatorRequest.java
  • WSCalculatorResponse.java
  • WSCalculatorSOAPProxy.java - This is not generated on Java's wsimport. How can I generate this using Java's wsimport?
Vicenary answered 6/9, 2012 at 6:21 Comment(1)
Which version of RAD are you using? how are you generating the code - are you using "Prepare for deployment" on the enclosing EAR project? Anything else you're doing?Assumed
I
0

Each tool (JBoss WS, wsimport, Apache CXF, RAD, etc) that generates classes from a WSDL does it slightly differently and they don't all generate the same classes, although they are usually similar. But there will be a way to supply your own URL that points to a WSDL. I am not familiar with RAD and how it generates web services but my guess would be that the WSCalculator_Service class has a constructor that takes a URL argument:

WSCalculator_Service service = new WSCalculator_Service(new URL("http://www.domain.com/ws/file.wsdl"));
WSCalculator port = service.getWSCalculatorPort();
port.callWebService(param1, param2, ...);

Sometimes the constructor that takes a URL also requires a QName. I would look in the source and just copy the QName that it is using.

Issus answered 23/5, 2013 at 19:51 Comment(0)
E
0

In RAD 9.1 when you select "Java Proxy" for "Client type:" in the Web Service Client pop up wizard, it creates the proxy code as well. The wsimport.exe included with RAD doesn't seem to create the proxy code via command line.

Epistasis answered 30/10, 2014 at 19:8 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.