我正在尝试实现一个SOAP Web服务,该服务生成用于管理通讯簿条目的SOAP消息。 SOAP API来自Blackboard ConnectTxt,提供单一服务 - “地址簿”来维护地址簿条目。此服务允许开发人员通过创建适当的SOAP消息来请求对通讯簿进行添加,更新和删除。
使用Apache CXF 2.6.1我已经从WSDL和默认impl(下面)生成了对象
@javax.jws.WebService(
serviceName = "TxttoolsAddressbookServiceService",
portName = "TxttoolsAddressbookServicePort",
targetNamespace = "http://www.txttools.co.uk/connectors/soap/addressbook/definitions",
wsdlLocation = "file:/C:/Users/me/Workspaces/work/bbtxttools/src/main/resources/wsdl/txttoolsAddressbook.wsdl",
endpointInterface = "uk.co.txttools.connectors.soap.addressbook.definitions.TxttoolsAddressbookService")
public class TxttoolsAddressbookServiceImpl implements TxttoolsAddressbookService {
private static final Logger LOG = Logger.getLogger(TxttoolsAddressbookServiceImpl.class.getName());
/* (non-Javadoc)
* @see uk.co.txttools.connectors.soap.addressbook.definitions.TxttoolsAddressbookService#addressbook(uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookRequest addressbookRequest )*
*/
public uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookResponse addressbook(uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookRequest addressbookRequest) {
LOG.info("Executing operation addressbook");
System.out.println(addressbookRequest);
try {
uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookResponse _return = null;
return _return;
} catch (java.lang.Exception ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
}
}
地址簿方法只返回一个空响应。我很困惑这里应该怎么做。我原本希望编写一些DAO来提供数据,但该方法似乎什么都不做。我显然在某个地方错过了一个技巧。包含AddressBookService:
@WebService(targetNamespace = "http://www.txttools.co.uk/connectors/soap/addressbook/definitions", name = "TxttoolsAddressbookService")
@XmlSeeAlso({uk.co.txttools.connectors.soap.addressbook.schemas.ObjectFactory.class})
@SOAPBinding(parameterStyle = SOAPBinding.ParameterStyle.BARE)
public interface TxttoolsAddressbookService {
@WebResult(name = "AddressbookResponse", targetNamespace = "http://www.txttools.co.uk/connectors/soap/addressbook/schemas", partName = "AddressbookResponse")
@WebMethod(operationName = "Addressbook")
public uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookResponse addressbook(
@WebParam(partName = "AddressbookRequest", name = "AddressbookRequest", targetNamespace = "http://www.txttools.co.uk/connectors/soap/addressbook/schemas")
uk.co.txttools.connectors.soap.addressbook.schemas.AddressbookRequest addressbookRequest
);
}
任何建议都将不胜感激。
安德鲁