I've got wcf web-service(basicHttpBinding). Our Delphi7 clients couldn't correct consume it. I've already flatten the WSDL with WCF extras. Ok. Delphi7 wsdl importer generate proxy correct.
Now I've got the problems with input parameters. they always have default values (empty for strings, 0 for int).
Output values from methods delphi7 gets ok. for example:
public string Test(string a)
{
return "Test"+a;
}
This method always return "Test". My logging system fix that I've got empty a at method, so the problem is correct transfer input parameters.
I can't undersand what's wrong
EDIT
proxy:
ISyncer = interface(IInvokable)
['{D46862B0-BDD3-8B80-35A8-A2AC69F24713}']
function Test(const a: String): String; stdcall;
end;
call:
Sync:=(dmMain.HTTPRIO1 as ISyncer);
test:=Sync.Test('5555');
dmMain.HTTPRIO1 has soLiteralParams at options:
init:
InvRegistry.RegisterInvokeOptions(TypeInfo(ISyncer), ioLiteral);
After call I get exception with message:
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"
wsdl fragment:
<xsd:element name="Test">
−
<xsd:complexType>
−
<xsd:sequence>
<xsd:element minOccurs="0" name="a" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
−
<xsd:element name="TestResponse">
−
<xsd:complexType>
−
<xsd:sequence>
<xsd:element minOccurs="0" name="TestResult" nillable="true" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
EDIT2
I research http requests:
.NET
<Test> xmlns="http://tempuri.org/"><a>5555</a></Test>
works correct;
Delph7
<Test xmlns="http://tempuri.org/"><xsd:a>5555</xsd:a></Test>
null input parameter. The problem is in prefix xsd
Delphi uses RPC/Encoded SOAP whereas WCF uses Document/Literal/Wrapped SOAP. So you need to tell Delphi to use the same format. You could do this by specifying soLiteralParams
in the THttpRio.Converter.Options
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With