How to generate SoapProxy from wsimport?

I compare client stubs created by IBM Rational Application Developer with Java wsimport and notice that IBM RAD generates an extra class, which is the SOAPProxy class. This class allows you to set the web service URL.

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

The following are the classes created by IBM RAD:

  • ObjectFactory.java
  • package-info.java
  • WSCalculator_Service.java
  • WSCalculator.java
  • WSCalculatorRequest.java
  • WSCalculatorResponse.java
  • WSCalculatorSOAPProxy.java - This is not generated in Java wsimport. How can I generate this using Java wsimport?
+6
source share
2 answers

Each tool (JBoss WS, wsimport, Apache CXF, RAD, etc.) that generates classes from WSDL does this a little differently, and they do not all generate the same classes, although they are usually similar. But there is a way to provide your own URL that points to the WSDL. I am not familiar with RAD and how it generates web services, but I assume that the WSCalculator_Service class has a constructor that accepts a URL:

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

Sometimes a constructor that accepts a URL also requires a QName. I would look in the source and just copy the QName name that it uses.

0
source

In RAD 9.1, when you select โ€œJava Proxyโ€ for โ€œClient Type:โ€ in the pop-up web service client wizard, it also creates proxy code. Wsimport.exe, included in RAD, does not seem to generate proxy code through the command line.

0
source

Source: https://habr.com/ru/post/924701/


All Articles