You are viewing a plain text version of this content. The canonical link for it is here.
Posted to wsif-user@ws.apache.org by Jacques-Olivier Goussard <jo...@nuance.com> on 2004/12/03 13:40:29 UTC

RE: Deserialization problems

Hi alek
A question about this. The main advantage (at least for
what I'm doing) of WSIF is its provider agnostic view
of webservices. If WSIF is to keep this, enabling users
to change the binding without having to change their
client code, then complex objects must be represented
in the same way for SOAP or Java binding (to name only
two). Or are you to drop this design ? Will users be
expected to do a
if (outMsg instanceof XmlElement) {
  // Handle SOAP response
} else {
  // Must be a java response
}
?

Java binding does of course use beans.
So IMHO the SDI should at least provide a way
to generate complex objects as beans too.
It seems you have a support for XMLBeans, but as it 
suppose a code generation step (if I'm not mistaken),
it's as usefull as Axis WSDL2Java.
Because I'm integrating WSIF within Struts, my plans
were to try to create a Dynabean de/serializer for
Axis to solve this problem - but I know it's taylored
to my problem.

        /jog

> -----Original Message-----
> From: Aleksander Slominski [mailto:aslom@cs.indiana.edu]
> Sent: Saturday, November 27, 2004 12:44 PM
> To: wsif-user@ws.apache.org
> Subject: Re: Deserialization problems
> 
> 
> SDI <http://www.extreme.indiana.edu/%7Easlom/bnp/sdi/> aims 
> exactly to 
> do this - if i have some time i will post examples how to do 
> message as 
> DOM element and XPath manipulations.
> 
> thanks,
> 
> alek
> 
> Jacques-Olivier Goussard wrote:
> 
> >>Can I do this within WSIF?
> >>    
> >>
> >AFAIK, no, not in the current version.
> >You have to dig into axis to do this.
> >I'll probably have to do the same in a
> >short while, as I've the same problem :)
> >        /jog
> >
> >  
> >
> >>-----Original Message-----
> >>From: Honorez Dylan [mailto:Dylan.Honorez@cronos.be]
> >>Sent: Thursday, November 25, 2004 10:16 AM
> >>To: wsif-user@ws.apache.org
> >>Subject: RE: Deserialization problems
> >>
> >>
> >>Hi,
> >>
> >>Wouldn't it be possible to send the content of the 
> >>soapmessage back as a
> >>String, containing XML? This in case of document-literal style of
> >>course. And how should I do this? Because I looked at the 
> >>WSIF code, it
> >>has a separate method of invoking document-literal style, 
> but it's the
> >>axis call that immediately tries to deserialize it, and I 
> can't touch
> >>the call without messing everything up. 
> >>
> >>Can I do this within WSIF?
> >>
> >>Kind regards,
> >>Dylan Honorez,
> >>dylan.honorez@cronos.be
> >> 
> >>-----Original Message-----
> >>From: Jacques-Olivier Goussard [mailto:jog@nuance.com] 
> >>Sent: woensdag 24 november 2004 15:56
> >>To: wsif-user@ws.apache.org
> >>Subject: RE: Deserialization problems
> >>
> >>No WSIF is not dynamic in that sense. Every schema complex
> >>object must be mapped to a predefined java bean, so that
> >>AXIS can use its bean de/serializer on it.
> >>You could dynamically generate those beans using AXIS
> >>WSDL2Java tool, i.e. 'a la' JSP compilation, but I
> >>guess that's not what you are looking for.
> >>There has been some talks here to give access to the
> >>SOAP message directly, so that you could get a DOM,
> >>but then that makes WSIF API dependent of the provider
> >>(IMHO).
> >>Alternatively, you can dig into AXIS and create a
> >>de/serializer that generates a DOM or some kind of generic
> >>holder (hashmap) from the SOAP messages.
> >>      /jog
> >>
> >>-----Original Message-----
> >>From: Honorez Dylan [mailto:Dylan.Honorez@cronos.be]
> >>Sent: Wednesday, November 24, 2004 9:34 AM
> >>To: wsif-user@ws.apache.org
> >>Subject: RE: Deserialization problems
> >>
> >>
> >>Yes, I looked at the complexSoap sample, because it uses
> >>document-literal. And before invoking, it makes a mapping, 
> which makes
> >>it not dynamic anymore...
> >>
> >>I also tried mapping the response to an object, but that 
> doesn't work.
> >>"Unexpexted element in getIntResponse".
> >>
> >>Seems like WSIF is dynamic for rpc-encoded, but not for
> >>document-literal?
> >>
> >>Kind regards,
> >>Dylan Honorez,
> >>dylan.honorez@cronos.be
> >> 
> >>
> >>-----Original Message-----
> >>From: Jeff Greif [mailto:jgreif@alumni.princeton.edu] 
> >>Sent: woensdag 24 november 2004 15:20
> >>To: wsif-user@ws.apache.org
> >>Subject: Re: Deserialization problems
> >>
> >>Have you looked at the DynamicInvoker sample in the WSIF 
> distribution?
> >>Jeff
> >>----- Original Message ----- 
> >>From: "Honorez Dylan" <Dy...@cronos.be>
> >>To: <ws...@ws.apache.org>
> >>Sent: Wednesday, November 24, 2004 2:25 AM
> >>Subject: RE: Deserialization problems
> >>
> >>
> >>Doesn't making a mapping make it static instead of dynamic? 
> >>That's just
> >>what I don't want to do. What I want to do is having the 
> BPEL process
> >>invoke any service with WSIF. 
> >>
> >>
> >>
> >> 
> >>  
> >>
> >>
> >> 
> >>  
> >>
> >>
> >>    
> >>
> >
> >  
> >
> 
> 
> -- 
> The best way to predict the future is to invent it - Alan Kay
> 
> 
>  
>   
> 
> 

Re: Deserialization problems

Posted by Aleksander Slominski <as...@cs.indiana.edu>.
Jacques-Olivier Goussard wrote:

>A question about this. The main advantage (at least for
>what I'm doing) of WSIF is its provider agnostic view
>of webservices. 
>
agreed - this is whole WSDL as interface to any service idea

>If WSIF is to keep this, enabling users
>to change the binding without having to change their
>client code, then complex objects must be represented
>in the same way for SOAP or Java binding (to name only
>two). 
>
yes!

>Or are you to drop this design ? 
>
no

>Will users be
>expected to do a
>if (outMsg instanceof XmlElement) {
>  // Handle SOAP response
>} else {
>  // Must be a java response
>}
>?
>  
>
i was thinking more about declarative style: description of binding 
declares what kind of XML Infoset it can accept as input message and it 
is binding + type mapping/conversion job to try best to do deliver.

>Java binding does of course use beans.
>  
>
that is where i am not 100% sure about. i thin it is simple for Java but 
Java Beans are not consistent with XML Schemas (or whatever is 
description of messages in WSDL). Xmlbeans may be better ...

>So IMHO the SDI should at least provide a way
>to generate complex objects as beans too.
>  
>
agreed. even if Java Beans are imperfect there is no reason why not to 
support them if users want it :)

>It seems you have a support for XMLBeans, but as it 
>suppose a code generation step (if I'm not mistaken),
>it's as usefull as Axis WSDL2Java.
>  
>
XmlBeans requires to compile XmlSchema to generate .class files - you 
can look on Java Beans that they require .java schema classes to 
generate .class as well

>Because I'm integrating WSIF within Struts, my plans
>were to try to create a Dynabean de/serializer for
>Axis to solve this problem - but I know it's taylored
>to my problem.
>  
>
if you have example code please send it or put it in Jira and i will 
sure try to integrate it in SDI.

thanks,

alek

> 
>
>>-----Original Message-----
>>From: Aleksander Slominski [mailto:aslom@cs.indiana.edu]
>>Sent: Saturday, November 27, 2004 12:44 PM
>>To: wsif-user@ws.apache.org
>>Subject: Re: Deserialization problems
>>
>>
>>SDI <http://www.extreme.indiana.edu/%7Easlom/bnp/sdi/> aims 
>>exactly to 
>>do this - if i have some time i will post examples how to do 
>>message as 
>>DOM element and XPath manipulations.
>>
>>thanks,
>>
>>alek
>>
>>Jacques-Olivier Goussard wrote:
>>
>>    
>>
>>>>Can I do this within WSIF?
>>>>   
>>>>
>>>>        
>>>>
>>>AFAIK, no, not in the current version.
>>>You have to dig into axis to do this.
>>>I'll probably have to do the same in a
>>>short while, as I've the same problem :)
>>>       /jog
>>>
>>> 
>>>
>>>      
>>>
>>>>-----Original Message-----
>>>>From: Honorez Dylan [mailto:Dylan.Honorez@cronos.be]
>>>>Sent: Thursday, November 25, 2004 10:16 AM
>>>>To: wsif-user@ws.apache.org
>>>>Subject: RE: Deserialization problems
>>>>
>>>>
>>>>Hi,
>>>>
>>>>Wouldn't it be possible to send the content of the 
>>>>soapmessage back as a
>>>>String, containing XML? This in case of document-literal style of
>>>>course. And how should I do this? Because I looked at the 
>>>>WSIF code, it
>>>>has a separate method of invoking document-literal style, 
>>>>        
>>>>
>>but it's the
>>    
>>
>>>>axis call that immediately tries to deserialize it, and I 
>>>>        
>>>>
>>can't touch
>>    
>>
>>>>the call without messing everything up. 
>>>>
>>>>Can I do this within WSIF?
>>>>
>>>>Kind regards,
>>>>Dylan Honorez,
>>>>dylan.honorez@cronos.be
>>>>
>>>>-----Original Message-----
>>>>From: Jacques-Olivier Goussard [mailto:jog@nuance.com] 
>>>>Sent: woensdag 24 november 2004 15:56
>>>>To: wsif-user@ws.apache.org
>>>>Subject: RE: Deserialization problems
>>>>
>>>>No WSIF is not dynamic in that sense. Every schema complex
>>>>object must be mapped to a predefined java bean, so that
>>>>AXIS can use its bean de/serializer on it.
>>>>You could dynamically generate those beans using AXIS
>>>>WSDL2Java tool, i.e. 'a la' JSP compilation, but I
>>>>guess that's not what you are looking for.
>>>>There has been some talks here to give access to the
>>>>SOAP message directly, so that you could get a DOM,
>>>>but then that makes WSIF API dependent of the provider
>>>>(IMHO).
>>>>Alternatively, you can dig into AXIS and create a
>>>>de/serializer that generates a DOM or some kind of generic
>>>>holder (hashmap) from the SOAP messages.
>>>>     /jog
>>>>
>>>>-----Original Message-----
>>>>From: Honorez Dylan [mailto:Dylan.Honorez@cronos.be]
>>>>Sent: Wednesday, November 24, 2004 9:34 AM
>>>>To: wsif-user@ws.apache.org
>>>>Subject: RE: Deserialization problems
>>>>
>>>>
>>>>Yes, I looked at the complexSoap sample, because it uses
>>>>document-literal. And before invoking, it makes a mapping, 
>>>>        
>>>>
>>which makes
>>    
>>
>>>>it not dynamic anymore...
>>>>
>>>>I also tried mapping the response to an object, but that 
>>>>        
>>>>
>>doesn't work.
>>    
>>
>>>>"Unexpexted element in getIntResponse".
>>>>
>>>>Seems like WSIF is dynamic for rpc-encoded, but not for
>>>>document-literal?
>>>>
>>>>Kind regards,
>>>>Dylan Honorez,
>>>>dylan.honorez@cronos.be
>>>>
>>>>
>>>>-----Original Message-----
>>>>From: Jeff Greif [mailto:jgreif@alumni.princeton.edu] 
>>>>Sent: woensdag 24 november 2004 15:20
>>>>To: wsif-user@ws.apache.org
>>>>Subject: Re: Deserialization problems
>>>>
>>>>Have you looked at the DynamicInvoker sample in the WSIF 
>>>>        
>>>>
>>distribution?
>>    
>>
>>>>Jeff
>>>>----- Original Message ----- 
>>>>From: "Honorez Dylan" <Dy...@cronos.be>
>>>>To: <ws...@ws.apache.org>
>>>>Sent: Wednesday, November 24, 2004 2:25 AM
>>>>Subject: RE: Deserialization problems
>>>>
>>>>
>>>>Doesn't making a mapping make it static instead of dynamic? 
>>>>That's just
>>>>what I don't want to do. What I want to do is having the 
>>>>        
>>>>
>>BPEL process
>>    
>>
>>>>invoke any service with WSIF. 
>>>>
>>>>
>>>>
>>>>
>>>> 
>>>>
>>>>
>>>>
>>>> 
>>>>
>>>>
>>>>   
>>>>
>>>>        
>>>>
>>> 
>>>
>>>      
>>>
>>-- 
>>The best way to predict the future is to invent it - Alan Kay
>>
>>
>> 
>>  
>>
>>
>>    
>>
>
>  
>


-- 
The best way to predict the future is to invent it - Alan Kay


Re: Deserialization problems

Posted by Michael Schuerig <mi...@schuerig.de>.
On Friday 03 December 2004 13:40, Jacques-Olivier Goussard wrote:
> Because I'm integrating WSIF within Struts, my plans
> were to try to create a Dynabean de/serializer for
> Axis to solve this problem - but I know it's taylored
> to my problem.

I think DynaBeans support in WSIF and Axis would be great. Especially in 
cases where services are called dynamically.

Michael

-- 
Michael Schuerig                            This is not a false alarm
mailto:michael@schuerig.de                         This is not a test
http://www.schuerig.de/michael/                      --Rush, Red Tide