Webservice with functions/procedures

daniel.webart

New Member
Staff,

I'm trying to create a webservice (with name retornaString) with a function that returns a value to me, follows the font. P simple:

RetornaString FUNCTION RETURNS CHARACTER ().
DEFINE VARIABLE c-msg-xml AS CHAR NO-UNDO.

ASSIGN-c-xml msg = "Test Webservice".

RETURN c-msg-xml.
END FUNCTION.


Then create the wsdl with proxygen (as non-persistent), the public protools, all right, except that when I call in soapUI to test it returns me no error, but not to me returns the string "Test Webservice" too. After that I was creating a test script in php consuming the webservice like this:



<php
$ clientSoap = new SoapClient ("http://localhost:5162/wsa/wsa1/wsdl?targetURI=urn:retornaString");
$ result = $ clientSoap-> retornaString ();
echo ($ result);
?>


And the log php returns me an error saying the function does not exist in retornaString webservice. My question is: is it possible to create webservices with functions or procedures and call them that way? If so where am I wrong?

Thanks to everyone now.
 
You can only call internal procedures or functions in PERSISTENT procedures. That means that you must add them as PERSISTENT in proxygen.

Heavy Regards, RealHeavyDude.
 
Back
Top