相关疑难解决方法(0)

WCF Delphi7方法输入参数

我有wcf web-service(basicHttpBinding).我们的Delphi7客户端无法正确使用它.我已经使用WCF附加功能展平了WSDL.好.Delphi7 wsdl导入器生成代理正确.

现在我遇到了输入参数的问题.它们总是有默认值(对于字符串为空,对于int为0).

方法delphi7的输出值可以正常.例如:

        public string Test(string a)
        {
              return "Test"+a;
        }
Run Code Online (Sandbox Code Playgroud)

此方法始终返回"测试".我的日志系统修复了我已经空了一个方法,所以问题是正确的传输输入参数.

我不能忽视什么是错的

编辑

代理:

ISyncer = interface(IInvokable)
  ['{D46862B0-BDD3-8B80-35A8-A2AC69F24713}']
    function  Test(const a: String): String; stdcall;
  end;
Run Code Online (Sandbox Code Playgroud)

呼叫:

Sync:=(dmMain.HTTPRIO1 as ISyncer);
test:=Sync.Test('5555');
Run Code Online (Sandbox Code Playgroud)

dmMain.HTTPRIO1在选项中有soLiteralParams:

在里面:

InvRegistry.RegisterInvokeOptions(TypeInfo(ISyncer), ioLiteral);
Run Code Online (Sandbox Code Playgroud)

通话结束后,我收到消息的异常:

Error deserializtion message body for operation Test. 
Operation formatter detects ivalid message body. Expecting node type "Element"
with name "Test" and namespace "http://tempuri.org". Actually node type "Element"
with name "xsd:String" and namespace "http://w3.org/2001/XMLSchema"
Run Code Online (Sandbox Code Playgroud)

wsdl片段:

<xsd:element name="Test">
?
<xsd:complexType>
?
<xsd:sequence>
<xsd:element minOccurs="0" …
Run Code Online (Sandbox Code Playgroud)

.net delphi wcf wsdl web-services

5
推荐指数
1
解决办法
1706
查看次数

标签 统计

.net ×1

delphi ×1

wcf ×1

web-services ×1

wsdl ×1