MSSOAP Client与Apache Soap互操作的问题
JoeXu 2002-07-25 04:50:33 环境:
机器1: Apache SOAP2.3.1(作为SOAP Server), Tomcat4.1, JDK1.3.1, Windows2K
机器2: MS SOAP2(作为SOAP Client), Window2K
==============
在2台机器都使用Apache Soap时,Web Services没有任何问题.
在Apache Soap作为Server, MS SOAP2作为Client时,如果调用的方法没有参数和返回值(如: void foo(void) ),也成功.
当Apache Soap作为Server, MS SOAP2作为Server时,调用的方法有参数(如:void foo(string param) ),就出错.
下面是我的代码和配置:
1. Web Services Method:
package hello;
public class HelloParam {
public void sayHelloTo(String name) {
System.out.println("sayHelloTo() have-param & no-return-value");
}
}
-------------------------------
2. 我的Deloy配置文件
<isd:service xmlns:isd="http://xml.apache.org/xml-soap/deployment" id="WS:HaveParam">
<isd:provider type="java" scope="Application" methods="sayHelloTo">
<isd:java class="hello.HelloParam" static="false"/>
</isd:provider>
<isd:faultListener>org.apache.soap.server.DOMFaultListener</isd:faultListener>
<isd:mappings>
<isd:map encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:x="WS:HaveParam" qname="x:A"
xml2JavaClassName="org.apache.soap.encoding.soapenc.StringDeserializer"/>
</isd:mappings>
</isd:service>
疑问: 在很多的类似文件中,他们取 xmlns:x=""(即null),但是这根本不行,使用
java org.apache.soap.server.ServiceManagerClient *URI* deploy **.xml时就报错误.
--------------------
3. SOAP Client(已经简化的代码)
Option Explicit
Dim SC
Dim Res
Set SC = CreateObject("MSSOAP.SoapClient")
Call SC.mssoapinit("HelloParam.wsdl", "", "", "")
SC.sayHelloTo("aa")
-----------------------
4. HelloParam.wsdl文件
<?xml version='1.0' ?>
<definitions name='HelloParam' targetNamespace='WS:HaveParam'
xmlns='http://schemas.xmlsoap.org/wsdl/'
xmlns:tns='WS:HaveParam_WSDL'
xmlns:se='http://schemas.xmlsoap.org/soap/encoding/'
xmlns:xsd='http://www.w3.org/2000/10/XMLSchema'
xmlns:so='http://schemas.xmlsoap.org/wsdl/soap/'>
<message name='HelloParam.RetString'>
<part name='A' type='xsd:string'/>
</message>
<message name='HelloParam.RetStringResponse'>
</message>
<portType name='HelloParamSoapPort'>
<operation name='sayHelloTo' parameterOrder='A'>
<input message='tns:HelloParam.RetString' />
<output message='tns:HelloParam.RetStringResponse' />
</operation>
</portType>
<binding name='HelloParam.Binding' type='tns:HelloParamSoapPort'>
<so:binding style='rpc' transport='http://schemas.xmlsoap.org/soap/http' />
<operation name='sayHelloTo'>
<so:operation soapAction=''/>
<input>
<so:body use="encoded"
namespace="WS:HaveParam"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</input>
<output>
<so:body use="encoded"
namespace="WS:HaveParam"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/>
</output>
</operation>
</binding>
<service name='HelloParam'>
<port name='HelloParamSoapPort' binding='tns:HelloParam.Binding'>
<so:address location='http://sniff:8080/soap/servlet/rpcrouter' />
</port>
</service>
</definitions>
==========================
出错信息:
No Deserializer found to deserialize a ':name' using encoding style 'http://schemas.xmlsoap.org/soap/encoding/'.
请帮助我!