ITeye博客

cxf publish

openstudy · 2011-09-08 19:31 · webservice · 企业架构 · Markdown

Object implementor = new ImplPLMToArchiveWSSoap(); String address = "http://localhost:4931/soa"; Endpoint.publish(address, implementor);

http://localhost:4931/soa?wsdl(即Endpoint.publish的address+"?wsdl")可以查看到wsdl

客户端访问 String check_key = "PLM-ARCHIVE"; String wsdl_url = "http://localhost:4931/soa?wsdl"; String namespace_url = "http://server.lantai.integration/"; String service_name = "ImplPLMToArchiveWSSoapService";

QName SERVICE_NAME = new QName(namespace_url, service_name); //use Service.create to create Service instances Service service = Service.create(wsdlURL, SERVICE_NAME); PLMToArchiveWSSoap port = service.getPort(PLMToArchiveWSSoap.class);

这里重点介绍两个参数 1)namespace_url,wsdl:definitions中targetNamespace属性的值 2)service_name,wsdl:service中的name属性的值

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。