询问者
mssoap使用失败

问题
-
最近用SoapClient30调用一个webservice,地址是http://qiubiaini.gicp.net:19525/ezwg/services/fingerInterface?wsdl在MSSoapInit2调用出现COM异常,提示SoapMapper出错,好像是没法解析这个wsdl,以前用SoapClient30还没出现过这个问题,不知道原因,客户端代码其实很简单,除了MSSoapInit2第一个参数是这个地址外,其他都是空,请高手指教
全部回复
-
最近用SoapClient30调用一个webservice,地址是http://qiubiaini.gicp.net:19525/ezwg/services/fingerInterface?wsdl在MSSoapInit2调用出现COM异常,提示SoapMapper出错,好像是没法解析这个wsdl,以前用SoapClient30还没出现过这个问题,不知道原因,客户端代码其实很简单,除了MSSoapInit2第一个参数是这个地址外,其他都是空,请高手指教
<?xml version="1.0" encoding="utf-8"?> <wsdl:definitions xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:intf="http://10.75.68.116/ezwg/services/fingerInterface" xmlns:impl="http://10.75.68.116/ezwg/services/fingerInterface" targetNamespace="http://10.75.68.116/ezwg/services/fingerInterface" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> <wsdl:types /> <wsdl:message name="fingerBatchQueryResponse"> <wsdl:part name="fingerBatchQueryReturn" type="soapenc:string" /> </wsdl:message> <wsdl:message name="fingerBatchQueryRequest"> <wsdl:part name="wsxlh" type="soapenc:string" /> <wsdl:part name="queryXml" type="soapenc:string" /> </wsdl:message> <wsdl:message name="wsValidateResponse"> <wsdl:part name="wsValidateReturn" type="soapenc:string" /> </wsdl:message> <wsdl:message name="wsValidateRequest"> <wsdl:part name="wsxlh" type="soapenc:string" /> <wsdl:part name="wslx" type="soapenc:string" /> </wsdl:message> <wsdl:portType name="FingerInterface"> <wsdl:operation name="fingerBatchQuery" parameterOrder="wsxlh queryXml"> <wsdl:input name="fingerBatchQueryRequest" message="impl:fingerBatchQueryRequest" /> <wsdl:output name="fingerBatchQueryResponse" message="impl:fingerBatchQueryResponse" /> </wsdl:operation> <wsdl:operation name="wsValidate" parameterOrder="wsxlh wslx"> <wsdl:input name="wsValidateRequest" message="impl:wsValidateRequest" /> <wsdl:output name="wsValidateResponse" message="impl:wsValidateResponse" /> </wsdl:operation> </wsdl:portType> <wsdl:binding name="fingerInterfaceSoapBinding" type="impl:FingerInterface"> <wsdlsoap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc" /> <wsdl:operation name="fingerBatchQuery"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="fingerBatchQueryRequest"> <wsdlsoap:body use="encoded" namespace="http://dao.webservice.module.lanxin.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:input> <wsdl:output name="fingerBatchQueryResponse"> <wsdlsoap:body use="encoded" namespace="http://10.75.68.116/ezwg/services/fingerInterface" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:output> </wsdl:operation> <wsdl:operation name="wsValidate"> <wsdlsoap:operation soapAction="" /> <wsdl:input name="wsValidateRequest"> <wsdlsoap:body use="encoded" namespace="http://dao.webservice.module.lanxin.com" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:input> <wsdl:output name="wsValidateResponse"> <wsdlsoap:body use="encoded" namespace="http://10.75.68.116/ezwg/services/fingerInterface" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" /> </wsdl:output> </wsdl:operation> </wsdl:binding> <wsdl:service name="FingerInterfaceService"> <wsdl:port name="fingerInterface" binding="impl:fingerInterfaceSoapBinding"> <wsdlsoap:address location="http://qiubiaini.gicp.net:19525/ezwg/services/fingerInterface" /> </wsdl:port> </wsdl:service> </wsdl:definitions>
-
Hi xkm611217,
感谢在MSDN论坛发帖。
对于你这种情况,我建议你查看以下几点。
1. 查看WSDL文件是否正确发布,将WSDL地址复制到IE中打开,查看是否可以访问WSDL文件。
2. 查看是否使用了bind函数绑定SOAP地址。
3. MSSoapInit接受BSTR作为参数。BSTR必须分配SysAllocString。建议你可以使用CComBSTR。
m_soap->MSSoapInit(CComBSTR(L"http://qiubiaini.gicp.net:19525/ezwg/services/fingerInterface?wsdl"), NULL, NULL, NULL);
希望可以帮助到你。
Best Regards,
Sera YuMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com. -
>>谢谢你的回复,这个地址和字符串的问题都不存在,我发现他这个wsdl文件的types节点下没有内容,这里面放的是接口的参数和类型,SoapSerializer30在调用上会把参数名和参数值配对上传,无需这些信息,而SoapClient30是靠对types节点的内容来做后续操作
恭喜你找到了问题原因。你可以查找是否有更新的wsdl文件可以提供给SoapClient30使用,或者继续使用SoapSerializer30。
谢谢你的支持与合作。
Best Regards,
Sera YuMSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.