You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@synapse.apache.org by Eugeny N Dzhurinsky <bo...@redwerk.com> on 2007/10/22 14:01:20 UTC

synapse evaluation question

Hello!

I need to develop an application, which should be able to call ANY service,
described in WSDL, without run-time compilation or code generation. In
general, I have to deal with some container class, which internal structure is
something like a map - there are name and value pairs, and it is possible to
get and set a value of certain field. This class is to be used as a input
parameter for method call, and it will be used as a returning result.

So for example if SOAP method getSomething requires 2 parameters: username,
password, there will be corresponding fields in the parameter object (and they
could be accessed with obj.get("username"), obj.get("password");). And
resulting object with some properties will be mapped to the instance of the
same parameter class in the same way.

Is it possible to configure/extend Synapse somehow?

Thank you in advance!

-- 
Eugene N Dzhurinsky

Re: synapse evaluation question

Posted by Paul Fremantle <pz...@gmail.com>.
Eugene

I think really what you need to do is to walk the WSDL/schema of the service
and build up an OMElement request and then use the Axis2 ServiceClient API
to invoke that service. Another option would be to dynamically run
WSDL2Java, compile the stub and then classload the resulting object. You
could then use reflection to walk the data objects.

While Synapse can invoke any service without WSDL, it doesn't help you in
the task of getting the right request XML dynamically. You still have to
figure out what the XML request should be.

Paul

On 10/22/07, Eugeny N Dzhurinsky <bo...@redwerk.com> wrote:
>
> On Mon, Oct 22, 2007 at 06:16:14PM +0530, Asankha C. Perera wrote:
> > Hi Eugeny
> >> I need to develop an application, which should be able to call ANY
> >> service,
> >> described in WSDL, without run-time compilation or code generation.
> > This is possible with Synapse.. please see samples from the Synapse main
> > page..
>
> Great, thank you. However after looking at sample it's still unclear for
> me
> how can I invoke any service? I already have a test service to create
> "dynamic
> bindings" for and I would like to start from scratch (or some stub?) with
> Synapse, create a caller class, send a request and get a response? Could
> you
> please guide me or point to which classes I need to take a look at?
>
> > I do not quite understand what you mean here.. it seems like you always
> > pass in a bunch of name-value pairs to all of your services and get back
> > another set of name-value pairs as the reply? So does this mean all the
> > services are like this - i.e. without any use of complex types etc?
>
> Well, not really. In fact, I need to resolve the structure of request, and
> find which objects of some type needs to be passed. So if there is some
> object
> of complex type, which has another object as a complex type, I will need
> to
> create some dynamic binding (create the XML or whatever structure) which
> will
> be understood by the remote service.
>
> So I need to be able to prepare completely dynamic requests having list of
> name/value pairs, where each request field will be filled from the "data
> capsule" object.
>
> --
> Eugene N Dzhurinsky
>
>


-- 
Paul Fremantle
Co-Founder and VP of Technical Sales, WSO2
OASIS WS-RX TC Co-chair

blog: http://pzf.fremantle.org
paul@wso2.com

"Oxygenating the Web Service Platform", www.wso2.com

Re: synapse evaluation question

Posted by Eugeny N Dzhurinsky <bo...@redwerk.com>.
On Mon, Oct 22, 2007 at 06:16:14PM +0530, Asankha C. Perera wrote:
> Hi Eugeny
>> I need to develop an application, which should be able to call ANY 
>> service,
>> described in WSDL, without run-time compilation or code generation.
> This is possible with Synapse.. please see samples from the Synapse main 
> page..

Great, thank you. However after looking at sample it's still unclear for me
how can I invoke any service? I already have a test service to create "dynamic
bindings" for and I would like to start from scratch (or some stub?) with
Synapse, create a caller class, send a request and get a response? Could you
please guide me or point to which classes I need to take a look at?

> I do not quite understand what you mean here.. it seems like you always 
> pass in a bunch of name-value pairs to all of your services and get back 
> another set of name-value pairs as the reply? So does this mean all the 
> services are like this - i.e. without any use of complex types etc?

Well, not really. In fact, I need to resolve the structure of request, and
find which objects of some type needs to be passed. So if there is some object
of complex type, which has another object as a complex type, I will need to
create some dynamic binding (create the XML or whatever structure) which will
be understood by the remote service.

So I need to be able to prepare completely dynamic requests having list of
name/value pairs, where each request field will be filled from the "data
capsule" object.

-- 
Eugene N Dzhurinsky

Re: synapse evaluation question

Posted by "Asankha C. Perera" <as...@wso2.com>.
Hi Eugeny
> I need to develop an application, which should be able to call ANY service,
> described in WSDL, without run-time compilation or code generation.
This is possible with Synapse.. please see samples from the Synapse main 
page..
> In general, I have to deal with some container class, which internal structure is
> something like a map - there are name and value pairs, and it is possible to
> get and set a value of certain field. This class is to be used as a input
> parameter for method call, and it will be used as a returning result.
>
> So for example if SOAP method getSomething requires 2 parameters: username,
> password, there will be corresponding fields in the parameter object (and they
> could be accessed with obj.get("username"), obj.get("password");). And
> resulting object with some properties will be mapped to the instance of the
> same parameter class in the same way.
>   
I do not quite understand what you mean here.. it seems like you always 
pass in a bunch of name-value pairs to all of your services and get back 
another set of name-value pairs as the reply? So does this mean all the 
services are like this - i.e. without any use of complex types etc?

asankha

---------------------------------------------------------------------
To unsubscribe, e-mail: synapse-user-unsubscribe@ws.apache.org
For additional commands, e-mail: synapse-user-help@ws.apache.org