`
mark_5528
  • 浏览: 63546 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}

阅读更多

环境

(1)用jdk1.6.25生成webservice客户端

(2)项目中内嵌了cxf的jar包(不能去掉)

 

报错:

 

Caused by: javax.wsdl.WSDLException: WSDLException (at /soap:Envelope): faultCode=INVALID_WSDL: Expected element '{http://schemas.xmlsoap.org/wsdl/}definitions'.

at com.ibm.wsdl.xml.WSDLReaderImpl.checkElementName(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.parseDefinitions(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(Unknown Source)

at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:237)

at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:186)

at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:92)

... 29 more

)

at junit.framework.Assert.fail(Assert.java:47)

at junit.framework.TestSuite$1.runTest(TestSuite.java:97)

at junit.framework.TestCase.runBare(TestCase.java:134)

at junit.framework.TestResult$1.protect(TestResult.java:110)

at junit.framework.TestResult.runProtected(TestResult.java:128)

at junit.framework.TestResult.run(TestResult.java:113)

at junit.framework.TestCase.run(TestCase.java:124)

at junit.framework.TestSuite.runTest(TestSuite.java:232)

at junit.framework.TestSuite.run(TestSuite.java:227)

at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:81)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:38)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)

 

 

 

出错原因及解决方案:

wsdlLocation = "http://172.16.82.92:8080/OmaeService/services/UserService" 没有加后缀,具体为什么还没弄清楚,可能是jdk的jaxws和cxf的jaxws不兼容吧。总之,我加上后缀后,问题解决。

 

正解:

wsdlLocation = "http://172.16.82.92:8080/OmaeService/services/UserService?wsdl

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics