If you use complex types using the JaxRpcPortProxyFactoryBean you need to
extend this class as such :



public class MyWebServiceProxyFactoryBean extends JaxRpcPortProxyFactoryBean
{



       public MyWebServiceProxyFactoryBean () {

              super();

      }



      protected void registerBeanMapping(TypeMapping mapping, Class type,
String name) {

              QName qName = new QName("http://vo.myapp.mycompany.com";,
name);

              mapping.register(type, qName, new
BeanSerializerFactory(type,qName), new BeanDeserializerFactory(type,
qName));

      }



      protected void postProcessJaxRpcService(Service service) {

              super.postProcessJaxRpcService(service);

              TypeMappingRegistry registry =
service.getTypeMappingRegistry();

              TypeMapping mapping = registry.createTypeMapping();

              registerBeanMapping(mapping, MyValueObject1.class, "
MyValueObject1");

              registerBeanMapping(mapping, MyValueObject2.class, "
MyValueObject2");

              registry.register("", mapping);

      }

}



And register this class in your spring context.



Hope it helps.



Cheers,

Renier



-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: 15 January 2007 15:44
To: CTJUG Forum
Subject: [CTJUG Forum] Consuming a web service using spring





Hi



Has anyone successfully consumed a web service using Spring?

I am attempting to use Axis 1.4 generated dto classes and extending

Spring' s (2.0.1) JaxRpcPortProxyFactoryBean class.



I keep getting an error when the Spring web service client attempts to

deserialize what seems to be valid XML returned from the web service:



DEBUG CmPortProxyFactoryBean - Invoking operation 'storeDocument' as

JAX-RPC dynamic call

ERROR Call - Exception:

org.xml.sax.SAXException: Deserializing parameter

'storeDocumentResponse': could not find deserializer for type

{http://localhost/cmdocument/2006/01/cmdocument.xsd}>storeDocumentResponse

at org.apache.axis.message.RPCHandler.onStartChild(RPCHandler.java:277)

at

org.apache.axis.encoding.DeserializationContext.startElement(Deserialization
Context.java:1035)

at

org.apache.axis.message.SAX2EventRecorder.replay(SAX2EventRecorder.java:165)

at

org.apache.axis.message.MessageElement.publishToHandler(MessageElement.java:
1141)

at org.apache.axis.message.RPCElement.deserialize(RPCElement.java:236)

at org.apache.axis.message.RPCElement.getParams(RPCElement.java:384)

at org.apache.axis.client.Call.invoke(Call.java:2467)

at org.apache.axis.client.Call.invoke(Call.java:2366)

at org.apache.axis.client.Call.invoke(Call.java:1812)

at

org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.performJaxRp
cCall(JaxRpcPortClientInterceptor.java:592)



Any ideas?



Thanks







--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CTJUG 
Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/CTJUG-Forum
For the ctjug home page see http://www.ctjug.org.za
-~----------~----~----~----~------~----~------~--~---

Reply via email to