`
tjbsl
  • 浏览: 1703 次
社区版块
存档分类
最新评论

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解决问题
0
0
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics