简体   繁体   English

使用JAX-WS请求ws时抛出com.sun.xml.internal.ws.protocol.soap.VersionMismatchException

[英]com.sun.xml.internal.ws.protocol.soap.VersionMismatchException thrown when using JAX-WS to request a ws

I'm tring to construct a client of a webservice using jax-ws, and this exception blocked me: 我正在尝试使用jax-ws构造Web服务的客户端,并且此异常阻止了我:

com.sun.xml.internal.ws.protocol.soap.VersionMismatchException: Couldn't create SOAP message. Expecting Envelope in namespace http://schemas.xmlsoap.org/soap/envelope/, but got http://www.w3.org/2003/05/soap-envelope 
    at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:167)
    at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:292)
    at com.sun.xml.internal.ws.encoding.StreamSOAPCodec.decode(StreamSOAPCodec.java:118)
    at com.sun.xml.internal.ws.encoding.SOAPBindingCodec.decode(SOAPBindingCodec.java:278)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:180)
    at com.sun.xml.internal.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:83)
    at com.sun.xml.internal.ws.transport.DeferredTransportPipe.processRequest(DeferredTransportPipe.java:105)
    at com.sun.xml.internal.ws.api.pipe.Fiber.__doRun(Fiber.java:587)
    at com.sun.xml.internal.ws.api.pipe.Fiber._doRun(Fiber.java:546)
    at com.sun.xml.internal.ws.api.pipe.Fiber.doRun(Fiber.java:531)
    at com.sun.xml.internal.ws.api.pipe.Fiber.runSync(Fiber.java:428)
    at com.sun.xml.internal.ws.client.Stub.process(Stub.java:211)
    at com.sun.xml.internal.ws.client.sei.SEIStub.doProcess(SEIStub.java:124)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:98)
    at com.sun.xml.internal.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:78)
    at com.sun.xml.internal.ws.client.sei.SEIStub.invoke(SEIStub.java:107)
    at com.sun.proxy.$Proxy26.isAlive(Unknown Source)

That is strange because my types are genereated by myEclipse, and nothing is modified. 这很奇怪,因为我的类型是由myEclipse生成的,并且没有任何修改。 When I ran this webservice in SOAPUI with the same wsdl, it worked! 当我使用相同的wsdl在SOAPUI中运行此Web服务时,它起作用了! but not in java (jax-ws). 但不在Java(jax-ws)中。 I think the wsdl is all right because the SOAPUI generated the envelope with the right namespace, but why the jax-ws insist to use the wrong one? 我认为wsdl没问题,因为SOAPUI用正确的名称空间生成了信封,但是为什么jax-ws坚持使用错误的名称空间?

I use jdk6 and its internal jax-ws libraries. 我使用jdk6及其内部的jax-ws库。

I've searched for several days but nothing is found. 我搜索了几天,但什么也没找到。 Can anybody help me? 有谁能够帮助我?

我找到了,是服务器代理向我发送了另一个版本的Soap响应...

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM