简体   繁体   中英

Invoking Web Services From a Java Client

I have a simple web app that runs inside Tomcat. I need to call a web service from this web app and I'm not sure how to go about it. It seems there are two methods depending on whether you are using a managed or unmanaged environment:

JNDI service lookup (managed)

and

JAX-RPC ServiceFactory (unmanaged)

...So which technique should I use?

You don't have to necessarily use those techniques. Assuming you're using Axis as the web services engine and ant as the build tool( http://ws.apache.org/axis/java/user-guide.html ), you need to do the following

1) generate the proxy/stub for invoking the web services. This will give you an entry point into calling the webservices
2) provide configuration info for the client -- a .wsdd file
3) know where the WSDL for your webservices is.

BR,
~a

如果是网络服务,为什么不使用apache的httpclient呢?

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