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/'.
请帮助我!
...全文
27 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
JoeXu 2002-07-25
  • 打赏
  • 举报
回复
各位,问题已经解决,我希望这个问题对大家有帮助。
错误的原因是因为我使用了最新的xerces包,我从Apache中下载了最新的xerces(For java2),这个包在解析XML文件的时候并不兼容于老的xerces.jar包,所以当我重新用xerces.jar来解析的时候就成功了。
------------
我觉得Apache Soap在文挡上应该学习MS,我只看看MS的文挡,就可以轻松的写MS的代码,可是无论是Sun还是Apache(这2家还是做的最好的公司)的文挡并不能说是怎么好。另,Apache Soap的开发也要做很多比MS多的多的事情,举了例子:生成WSDL文件,看看WSTK要带8个参数,,,,,
-------------
Flowwork是一个很有前途也许是我们能做梦的一个好的方向,我个人认为MS注重实际,IBM注重理论,看看IBM的FlowWork提了2年,虽然我要承认WSFL标准做的很不错很全面,可是想想MS用了一年的时间就做出了BizTalk,我真的不知道怎么来形容BizTalk,大家去用用把,伟大的产品和思维。SOAP的未来?FlowWork就是其中之一,BizTalk走的太前面了。

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧