【发布时间】:2009-05-20 17:03:08
【问题描述】:
我必须使用由第 3 方用 Java 编写的 Web 服务,我猜是用 Axis 生成的。
我正在使用 .Net Framework 3.5 SP1 和 VS 2008。
我创建了一个 Web 引用,就像我们在 .net 2.0 中所做的那样,并将其指向服务的 wsdl。
它与服务的某些方法完美配合,但是当我尝试调用以 int 作为参数的 Method 时,会引发以下异常:
JAXRPCTIE01: caught exception while handling request:
unexpected element type:
expected={http://schemas.xmlsoap.org/soap/encoding/}int,
actual={http://www.w3.org/2001/XMLSchema}int
我检查了 wsdl,它定义了五个不同的 Xml Schema 命名空间:
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="urn:servicos/wsdlservicosgmp2"
xmlns:ns2="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns3="urn:servicos/typesservicosgmp2"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="servicosgmp2"
targetNamespace="urn:servicos/wsdlservicosgmp2">
<schema xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:servicos/typesservicosgmp2"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="urn:servicos/typesservicosgmp2">
以及问题方法的定义:
<message name="IWsServicosGMP2_buscaConvenio">
<part name="Integer_1" type="ns2:int" />
<part name="Integer_2" type="ns2:int" />
</message>
任何人都知道我必须做些什么来解决这个问题?
【问题讨论】:
-
这只是一个猜测,但它可能与 Java 使用无符号整数(据我记得)有关。
标签: java .net web-services interop wsdl