0
有wsimport命令可以生成WSDL中引用的所有类型。但是,这对于调用Web服务方法,将XML解析为Java对象等所有其余样板都没有做任何事情。什么样的Java库会自动生成用于调用Web Service的所有锅炉代码?
假设由服务提供商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;
}
我找不到如何使用Spring Web服务自动生成样板代码?你能提供更多的信息吗? – ace 2011-05-11 13:11:30