Thank you for your answer.
I made my hands dirty and it really seems to be possible,
but I don't know how to register castor's (de)serialisers within wsif.
Here are the details:
I tried to setup the required mappings.
WSIFService offers the two methods mapType and mapPackage
to register a xml<-->java mapping.
=== Listing 1, Extract from WSIFService Interface ====================
/**
* Inform WSIF that a particular XML type (referred to in the WSDL)
* actually maps to a particular Java class. Use this method when there
* is no schema definition for this type, or when the mapping is
* sufficiently complicated that WSIF does not understand the schema
* definition. Calling this method overrides whatever schema is present
* in the WSDL for this type.
* @param xmlType the fully qualified XML type name
* @param javaType the java class that this type maps to
* @exception WSIFException if something goes wrong
*/
public void mapType(QName xmlType, Class javaType) throws WSIFException;
/**
* Add an association between a namespace URI and and a Java package.
* This enables WSIF to map schema definitions to real java classes.
* @param namespace The namespace URI
* @param packageName The full package name
* @exception WSIFException if something goes wrong
*/
public void mapPackage(String namespace, String packageName)
throws WSIFException;
======================================================================
As expected, I got an exception:
=== Listing 2, Exception =============================================
java.io.IOException: No serializer found for class
de.fhg.iao.kompass.binding.FreightType in registry [EMAIL PROTECTED]
at
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1267)
at
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:778)
at
org.apache.axis.encoding.ser.BeanSerializer.serialize(BeanSerializer.java:176)
at
org.apache.axis.encoding.SerializationContext.serializeActual(SerializationContext.java:1248)
at
org.apache.axis.encoding.SerializationContext.serialize(SerializationContext.java:778)
at org.apache.axis.message.RPCParam.serialize(RPCParam.java:177)
at org.apache.axis.message.RPCElement.outputImpl(RPCElement.java:372)
at org.apache.axis.message.MessageElement.output(MessageElement.java:896)
at org.apache.axis.message.SOAPBody.outputImpl(SOAPBody.java:139)
at org.apache.axis.message.SOAPEnvelope.outputImpl(SOAPEnvelope.java:483)
at org.apache.axis.message.MessageElement.output(MessageElement.java:896)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:297)
at org.apache.axis.SOAPPart.writeTo(SOAPPart.java:271)
at org.apache.axis.SOAPPart.saveChanges(SOAPPart.java:482)
at
org.apache.axis.attachments.AttachmentsImpl.getAttachmentCount(AttachmentsImpl.java:519)
at org.apache.axis.Message.getContentType(Message.java:475)
at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:293)
at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:88)
at
org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:147)
at org.apache.axis.client.Call.invokeEngine(Call.java:2735)
at org.apache.axis.client.Call.invoke(Call.java:2718)
at org.apache.axis.client.Call.invoke(Call.java:2394)
at org.apache.axis.client.Call.invoke(Call.java:2317)
at org.apache.axis.client.Call.invoke(Call.java:1774)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invokeAXISDocStyle(Unknown
Source)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.invokeRequestResponseOperation(Unknown
Source)
at
org.apache.wsif.providers.soap.apacheaxis.WSIFOperation_ApacheAxis.executeRequestResponseOperation(Unknown
Source)
at
de.fhg.iao.kompass.clients.wsif.WSIFCastorClient.requestService(WSIFCastorClient.java:76)
at
de.fhg.iao.kompass.tests.WSIFCastorClientTest.run(WSIFCastorClientTest.java:86)
at
de.fhg.iao.kompass.tests.WSIFCastorClientTest.main(WSIFCastorClientTest.java:39)
======================================================================
because de.fhg.iao.kompass.binding.FreightType is a generated Castor-Class
and I did not yet tell the apacheaxis-provider
to use the castor (de)serializers
org.apache.axis.encoding.ser.castor.CastorSerializer
org.apache.axis.encoding.ser.castor.CastorDeserializer
instead of axis' standard bean(de)serializer
org.apache.axis.encoding.ser.BeanSerializer
org.apache.axis.encoding.ser.BeanDeserializer
(The non-WSIF Axis Client does this by calling
org.apache.axis.client.Call's
public void registerTypeMapping(Class javaType, QName xmlType,
SerializerFactory sf,
DeserializerFactory df)
in the generated class XYZSoapBindingStub.)
So how can I register the Castor (De)Serializers when using WSIF?
(Using latest cvs versions of both ws-axis and ws-wsif)
Thanks,
Michel
-----Urspr�ngliche Nachricht-----
Von: Aleksander Slominski [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 10. August 2004 18:26
An: [EMAIL PROTECTED]
Betreff: Re: Experience with Castor and WSIF?
Zedler, Michel wrote:
Hi all,
I successfully integrated the castor data binding framework (www.castor.org)
into axis. Now I don't want wo lose the benefits of WSIF when
calling my service from the client side.
I guess, that WSIF would need to be capable of marshalling and unmarshalling
castor generated objects from and to XML.
Is there any way to make WSIF and Castor play together?
i think that AXIS-SOAP provider may work after you manage to setup required mappings -
did you try?
however when thinking about it my opinion is that WSIF should depend more on XML
Infoset when passing data to providers and not Java objects - if Java object is passed
to provider and provider does not know how to deal with it it should ask WSIF runtime
to convert it to preferred XML representation (DOM, SAX events, whatnot) - if we had
this then this would be the place where to plug Castor for *all* providers - alas we
do not have this capability ...
thanks,
alek
--
The best way to predict the future is to invent it - Alan Kay