Tom Kronos
Tom Kronos

Reputation: 31

Delphi <-> c# Webservice SOAP Request with missing parameters values

I need to implement SOAP communication between client in Delphi7 and .NET Webservice (ASMX). Very old projects/technnologies, I know.

I have written webservice, but auto-created class via WSDL Importer (based on THTTPRIO) is not working properly, I cant pass values of parameters into webservice. In other words, method in webservice gets called, but all its parameters have default value. I could parse xml request myself, but raw xml is not accessible in WebMethod. I hope, Im just missing some method attribute. Any idea?

I used network sniffer to ensure, that parameters are send to service, it looks like this:

POST /Lib/ASPX/WSService.asmx HTTP/1.1
SOAPAction: "WS/GetMessages"
Content-Type: text/xml
User-Agent: Borland SOAP 1.2
Host: localhost:54561
Content-Length: 480
Connection: Keep-Alive
Cache-Control: no-cache

<?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-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<NS1:GetMessages xmlns:NS1="WS">
<id xsi:type="xsd:int">12345</id>
</NS1:GetMessages>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

And header of method in webservice, which gets called with parameter id=0

[WebMethod]
public List<HelpDeskView> GetMessages(int id) 

Upvotes: 1

Views: 572

Answers (1)

Tom Kronos
Tom Kronos

Reputation: 31

I have found solution. At the end of auto-generated Unit, in initialization section, there was missing this line:

InvRegistry.RegisterInvokeOptions(TypeInfo(Service1Soap), ioDocument);

Upvotes: 2

Related Questions