【发布时间】:2011-09-26 11:59:17
【问题描述】:
我有一个基于 basicHTTPBinding 的 WCF 服务。我从 Delphi 7 和 .NET 表单中调用此服务。 D7 客户端能够成功调用具有原始输入和输出类型的操作。但是,当调用具有复杂类型的操作时,Web 服务会将复杂类型接收为 NULL。 .Net 客户端工作正常。这是从 Fiddler 检索到的请求标头。
德尔福客户端
<?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">
<SOAP-ENV:Body>
<GetDataUsingDataContract xmlns="http://tempuri.org/">
<composite xmlns="http://schemas.datacontract.org/2004/07/DelphiService2">
<BoolValue>true</BoolValue>
<StringValue>Test</StringValue>
</composite>
</GetDataUsingDataContract>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
.Net 客户端
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<GetDataUsingDataContract xmlns="http://tempuri.org/">
<composite xmlns:a="http://schemas.datacontract.org/2004/07/DelphiService2" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
<a:BoolValue>true</a:BoolValue>
<a:StringValue>test</a:StringValue>
</composite>
</GetDataUsingDataContract>
</s:Body>
</s:Envelope>
【问题讨论】: