WSDL Metadata not available to create the proxy异常解决办法

Client端调用:
public class FourClass_PortTypeClient {

public static void main(String[] args) throws Exception {
QName serviceName = new QName("http://four.com/", "FourClassService");
QName portName = new QName("http://four.com/", "FourClassPort");

Service service = Service.create(serviceName);
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
"http://localhost:8080/WebserviceServer/services/FourClassPort");
com.four.FourClass_PortType client = service.getPort(portName, com.four.FourClass_PortType.class);
System.out.println(client.doMethodFour("ssd"));
// Insert code to invoke methods on the client here
}
}
调用报错;
Exception in thread "main" javax.xml.ws.WebServiceException: WSDL Metadata not available to create the proxy, either Service instance or ServiceEndpointInterface com.four.FourClass_PortType should have WSDL information
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:308)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:295)
at javax.xml.ws.Service.getPort(Service.java:92)
at com.four.FourClass_PortTypeClient.main(FourClass_PortTypeClient.java:27)


问题解决:
Client端项目缺少Webservice调用的包
添加Cxf.zip解决问题
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值