简体   繁体   中英

Easy way to access wsdl from java

I'm looking for an easy way to acces wsdl file from java.

In python with suds I can do somethin like:

self.wsdlClient = Client(WSDL_URL)
wsdlClient.methodName()

Is there a way to connect to wsdl through an URL?

Python is a dynamic language so you can create methods on an object on the fly, like for example a method for each operation of your web service as discovered by reading the WSDL. But Java is not a dynamic language so the Python approach can't be used.

You either have to generate the code at design time (ie create a stub) by feeding the WSDL to some tool like wsimport.exe (or other tools) then use the generated code in your application or ...

... you have to parse the WSDL at runtime and create the XML payload based on the information you acquired from the WSDL, in which case you might want to look at the following tool: soap-ws .

The easiest way is to generate a stub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM