WSDL file:/E:/workspace/A06_wsdl/bin/META-INF/wsdl/mywsdl.wsdl has the following services [{http://w

Exception in thread "main" javax.xml.ws.WebServiceException: WSDL file:/E:/workspace/A06_wsdl/bin/META-INF/wsdl/mywsdl.wsdl has the following services [{http://www.example.org/mywsdl/}MyServcieImplService] but not {http://www.example.org/mywsdl/}MyServiceImplService. Maybe you forgot to specify a serviceName and/or targetNamespace in @WebService/@WebServiceProvider?
    at com.sun.xml.internal.ws.server.EndpointFactory.verifyPrimaryWSDL(EndpointFactory.java:664)
    at com.sun.xml.internal.ws.server.EndpointFactory.create(EndpointFactory.java:221)
    at com.sun.xml.internal.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:144)
    at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:563)
    at com.sun.xml.internal.ws.api.server.WSEndpoint.create(WSEndpoint.java:545)
    at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.createEndpoint(EndpointImpl.java:308)
    at com.sun.xml.internal.ws.transport.http.server.EndpointImpl.publish(EndpointImpl.java:231)
    at com.sun.xml.internal.ws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:126)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:240)
    at org.example.mywsdl.MyServer.main(MyServer.java:7)

解决方式:
参考:

* @see ---------------------------------------------------------------------------------------------------------- 
 * @see 手工编写SIB 
 * @see 1)最好显式的让SIBSEI的targetNamespace相同 
 * @see 2)当指定serviceName值时,其值应为wsdl文件中的<wsdl:service name="CalculatorServiceImpl">标签的name值 
 * @see 3)不指定serviceName值时,wsdl中的<wsdl:service name="">则应为SIBService,如CalculatorServiceImplService 
 * @see   否则在启动WebService服务时,会报告下面的异常 
 * @see   Exception in thread "main" javax.xml.ws.WebServiceException: 
 * @see   wsdl file:/F:/Tool/Code/JavaSE/ws_contractFirst/bin/META-INF/wsdl/myCalculator.wsdl 
 * @see   has the following services [{http://blog.csdn.net/jadyer}CalculatorServiceImpl] 
 * @see   but not {http://blog.csdn.net/jadyer}CalculatorServiceImplService 
 * @see   Maybe you forgot to specify a service name in @WebService/@WebServiceProvider? 
 * @see ----------------------------------------------------------------------------------------------------------

我的问题原因是wsdl中:

<wsdl:service name="MyServcieImplService">

MyServcie单词写反了。
而手动编写的实现类单词是正确的。

@WebService(endpointInterface="org.example.mywsdl.IMyService",
            targetNamespace="http://www.example.org/mywsdl/",
            wsdlLocation="META-INF/wsdl/mywsdl.wsdl")
public class MyServiceImpl implements IMyService {

解决:修改单词,重新使用wsimport生成代码,只留service接口。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值