什么Java库会自动生成用于调用Web Service的所有样板代码?

时间:2011-05-01 21:31:11

标签: web-services

有wsimport命令可以生成WSDL中引用的所有类型。但是这对于调用Web服务方法,将XML解析为Java对象等所有剩余的样板都没有做任何事情。

假设由服务提供者WSDL定义的名为CustomerService的Web服务提供操作getCustomerAddress(String CustomerID)并返回CustomerAddress类型的对象。 wsimport只生成CustomerAddress等类型。我正在寻找的是自动生成的代码,如:

String AppID = "" ;  // autogenerated (if there was such parameter specified in WSDL)
String endpointA = "some end point";
CustomerAddress getCustomerAddress(String customerID) {

// all the bolierplate of actaully calling the webservice, unmarshalling the XML response 
// including error/exception handling etc.


return result;
}

1 个答案:

答案 0 :(得分:0)

我喜欢Spring web services,特别是如果你已经在使用Spring。