#1 2015-06-11 11:39:44

cypriotcalm
Member
Registered: 2015-02-18
Posts: 122

how to consume a WCF service

Hello Arnaud,

I would like to consume a WCF service (SOAP based with a WSDL file). I also have an address http://localhost:59997/HostDevServer/HelloWorldService.svc. I also know that this service offers a method Add(int a, int b).

1. How do I consume this service with mORMot and with a WSDL? I have imported the WSDL file and have an interface. How do I use it on the client side?
2. How do I consume such service if I don't have any WSDL file, but I know the method name and its signature?

Could you provide some sample code or point me to an appropriate sample project if there is one?

I have tried something like this, but without success:

var
  aModel: TSQLModel;
  aClient: TSQLRestClientURI;
begin
  aModel := TSQLModel.Create([], 'http://localhost:59997/HostDevServer/HelloWorldService.svc');
  aClient := TSQLRestClientURI.Create(aModel);
  ShowMessage(aClient.CallBackGetResult('Add', ['a',3,'b',2]));
  ...
end

Thank you!

Offline

#2 2015-06-11 13:54:01

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: how to consume a WCF service

mORMot does not support SOAP.
SOAP is XML based, whereas we use JSON.
SOAP is complex, and WCF has its own flavor, difficult to work with from other systems (even from Java AFAIR).

The easiest is to publish your WCF service as REST.

Offline

Board footer

Powered by FluxBB