中国开发网: 论坛: 程序员情感CBD: 贴子 352913
haitao
刚才用d7做了一个类似的服务,让C#客户端来访问,返回结果好像是对的,但是C#说:出现异常:未将对象引用设置到对象的实例。
刚才用d7做了一个类似的服务,让C#客户端来访问,返回结果好像是对的,
但是C#说:出现异常:未将对象引用设置到对象的实例。
请求:
POST /cgid/soapapp.dll/soap/IsoapTest HTTP/1.1
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; MS Web Services Client Protocol 1.1.4322.2300)
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://host/dir/WebService/GetCardType"
Content-Length: 402
Expect: 100-continue
Connection: Keep-Alive
Host: 192.128.0.245

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><GetCardType xmlns="http://host/dir/WebService/"><sProviderCode>0001</sProviderCode><sProviderName /><iRetState>0</iRetState></GetCardType></soap:Body></soap:Envelope>



返回:
HTTP/1.0 200 OK
Content-Type: text/xml
Content-Length: 585

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body SOAP-ENC:encodingStyle="http://schemas.xmlsoap.org/soap/envelope/"><NS1:GetCardTypeResponse xmlns:NS1="urn:UnitSoapTestIntf-IsoapTest"><sProviderName xsi:type="xsd:string">[Name{0001}namE]</sProviderName><iRetState xsi:type="xsd:int">4</iRetState></NS1:GetCardTypeResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>


服务的实现:
procedure TsoapTest.GetCardType(sProviderCode: String;
var sProviderName: String; var iRetState: Integer);
begin
sProviderName:='[Name{'+sProviderCode+'}namE]';
iRetState:=length(sProviderCode);
end;
我的blog:http://szhaitao.blog.hexun.com & http://www.hoolee.com/user/haitao
--以上均为泛泛之谈--
不尽牛人滚滚来,无边硬伤纷纷现 人在江湖(出来的),哪能不挨刀(总归是要的)
网络对话,歧义纷生;你以为明白了对方的话,其实呢?

您所在的IP暂时不能使用低版本的QQ,请到:http://im.qq.com/下载安装最新版的QQ,感谢您对QQ的支持和使用

相关信息:


欢迎光临本社区,您还没有登录,不能发贴子。请在 这里登录