[Lazarus] Web-services

Marcos Douglas md at delfire.net
Thu Jul 19 17:27:42 CEST 2012

On Thu, Jul 19, 2012 at 10:18 AM, Ian Godman <ian at gravytrain.co.uk> wrote:
> Hi
> I am trying to get Lazarus to connect to a Java based web service. The
> web service is in Java because its on an existing webserver and will
> provide information and services etc from that site.
> I am using Apache CXF and Jersey for the web services. With Jersey I
> have a working restful webservice, with CXF I have been able to build
> the service but not the client.
> I have used WST to generate the classes from the WSDL which appears to
> work well.
> However when I try to run the client I get the following exception:
> Project webservice raised exception class 'EserviceConfigException' with
> message invalid parameter: 'AProtocolData'
> Searching Google I found that the solution was to add soap_formatterto
> my uses which I have done but still get the same error.
> I have changed to use the wst_CreateInstance_HelloWorldEasy (always
> start with 'hello world' :-) ) and teh invalid parameter error goes away
> to be replaced with
> Project webservice raised exception class 'EXMLReadError' with message:
> in 'stream:' (line 1 pos 145): root element is missing
> The HelloWorld web service is a simple as it can get (almost) being a
> service with a single action. Call hello method  with a string and it
> return the string 'hello ' + the string you supplied.
> I have attached the WDSL to this email used to generate the classes for
> Lazarus.
> I have tried so many options I am now completely confused and absolutely
> certian I am doing it wrong.
> The code I have got to now is:
>   FPC_RegisterHTTP_Transport();
>   try
>     service := wst_CreateInstance_HelloWorldEasy();
>     WriteLn( service.hello('fred') );
>   finally
>   end;
> I know this is not right and reasonable sure I may have been closer to a
> solution some hours ago but now have no faith in my understanding.
> Any assistance very much appreciated.
> Ian

I used Synapse to work with a WebService made in PHP (I just know is
PHP, but I don't have the code).

Using POST, XML and Synapse everything worked.
The WebService is simple and just have 3 methods so, in that case
Synapse worked very well.

Marcos Douglas

More information about the Lazarus mailing list