On Tue, 23 Sep 2003 16:41:31 +0200, Stefano Mazzocchi <[EMAIL PROTECTED]>
wrote:

>> Wouldn’t it be great if we could load a web service dynamically as an
>> object in Flow Script simply by passing it the URI of its WSDL file?
>>
>> var fooWS = loadWebService('http://foo.bar/webservice?wsdl');
>> var value = fooWS.someRemoteMethod(1,'text');
>
>yes, that would be very cool.

Thanks for the positive comment :)

>> Is there anyone who would like to see this functionality implemented?
>
>I wouldn't personally know what to do with it (I still have to find a
>web service I need to access that way), but for sure it wouldn't hurt
>from a marketing perspective, rather the opposite.

Cool, it doesnt look like it will be that hard to code up so I'll get to
work on it. I'm sure someone will find a use for it. As for helping with
cocoons marketing, the more the better.

>> Has anyone got any suggested use cases?
>
>you might connect to the web service of a credit card company to find
>out if the card exists, if it has enough coverage and proceed the flow
>accordingly.

Good one, thanks..

>> Food for thought… Exposing Flow Scripts as Web Services
>>
>> Wouldn’t it be cool if you could expose flow scripts as web services?
>> Even
>> better would be to automatically generate the corresponding WSDL file
>> as
>> well.
>
>Hmmm, not sure I follow you here. Care to elaborate more?

Sure, i'm still a bit skechy on the details. But as you said a webservice
is a remote method that returns a simple type (number,string,array) or a
complex type as xml. A flow script /+ pipeline can do the same thing.

There would need to be some way to tell the sitemap which functions to
expose as webservices. This could perhaps be done using WSDL or some other
mapping approch.

There are other issues arround the sitemap processing xml requests, but I
think your concept of extractors would fix this. An extractor would need
to take the xml soap request and convert the data types before calling the
flow script function.

// this function just adds the two numbers together
// as the function returns without calling sendPage
// or sendPageAndWait the result would be encoded as
// a soap response automaticaly.

function simpleCalc(num1,num2){
    var result = num1 + num2;
    return result;
}

// this function takes an account bean object
// it does not return a value directly instead it calls a pipeline
// using sendPage the pipeline would then produce the soap response

function createAccount(accountObj){
    var id = bizBackend.createAccount(accountObj);
    if(id > 0){
        cocoon.sendPage('soap/success.jx',{id:id,accountObj:accountObj})
    }
    else{
        cocoon.sendPage('soap/fail.jx',{accountObj:accountObj});
    }
}

Hope that makes sence...

Hmm, giving what I just suggested It seems that the WSDL would have to be
in place first and could and so could not be autogenerated .. but I may be
wrong.

Thanks for the comments.

Luke



-----------------------------------------

This email was sent using FREE Catholic Online Webmail.
http://webmail.catholic.org/




Reply via email to