简体   繁体   中英

Why is there no easy way to consume web services in Java?

I've been doing a lot of work exploring different methods to consume (.NET) web services in Java clients. It seems that this area is a black hole in Java. The easiest way that I have found is to use Apache Axis2 wsdl2java to generate the source files. But still, this requires some work to integrate Apache into my existing web applications.

I'm surprised that there is no easier way. Why is that?

Because there is. The required functionality for SOAP clients are included in the standard API library. You can use the wsimport tool (located in the bin directory of your JDK installation) to generate client classes from a specified WSDL.

I've not used metro , but it sounds like it integrates with JAXB2.0 well and might be worth taking a look at. I noticed a metro vs axis2 comparison which might be interesting if you are familiar with axis2 already.

for quick and dirty stuff the apache commons httpclient + jaxb works well.

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