Announcement Announcement Module
Collapse
No announcement yet.
Axis 1.4 and Spring 2.0.1 : Deserializer (yet again) Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Axis 1.4 and Spring 2.0.1 : Deserializer (yet again)

    Hi

    Please help - feeling like a real dumb@ss at this stage. I just can't seem to get my Spring-wrapped web service client working. As a stand-alone Axis web service client, my code works fine.

    I have generated the Java classes using Axis 1.4 using wsdl2java and have created a class extended JaxRpcPortProxyFactoryBean and added mappings for the generated classes.

    Code:
    public class CmPortProxyFactoryBean extends JaxRpcPortProxyFactoryBean {
        
        /** The namespace URI for the Content Manager web service's dto classes. */
        public static final String CM_DTO_NAMESPACE 
            = "http://i4c.sanlam.co.za/cm/dto/cmdocument/2006/01/cmdocument.xsd";
            
        protected void postProcessJaxRpcService(Service service) {       
            TypeMappingRegistry registry = service.getTypeMappingRegistry();              
            TypeMapping mapping = registry.createTypeMapping();       
           //add the classes to the mapping
           registerBeanMapping(mapping, ApplicationError.class, "ApplicationError");       
           registerBeanMapping(mapping, AttributeData.class, "AttributeData");
           registerBeanMapping(mapping, StoreDocumentRequest.class, "StoreDocumentRequest");                                
           registerBeanMapping(mapping, StoreDocumentResponse.class, "StoreDocumentResponse");
           registerBeanMapping(mapping, StoreDocumentResult.class, "StoreDocumentResult");
           
           .....
           
           //register the mapping
           registry.register("http://schemas.xmlsoap.org/soap/encoding/", mapping);
        }
        
        protected void registerBeanMapping(TypeMapping mapping, Class type, String name) {
           QName qName = new QName(CM_DTO_NAMESPACE, name);
           mapping.register(type, 
                            qName, 
                            new BeanSerializerFactory(type, qName),
                            new BeanDeserializerFactory(type, qName));       
        }
    }
    I can call the web service and see the expected SOAP/XML being returned from the web service but I keep getting the following exception:
    org.xml.sax.SAXException: Deserializing parameter 'storeDocumentResponse': could not find deserializer for type {http://i4c.sanlam.co.za/cm/dto/cmdocument/2006/01/cmdocument.xsd}>storeDocumentResponse
    (I am not sure why there is a > before the storeDocumentResponse element but adding variations of the element's name does not help.)

    Please can someone help me out? I did see several posting about encoding, etc and trying doing:
    Code:
    //register the mapping
           registry.register("", mapping);
    But that just generated more exceptions:
    org.xml.sax.SAXException: Bad types (interface javax.xml.soap.SOAPElement -> class za.co.sanlam.cm.cmdocument.dto.StoreDocumentReques t) Message being parsed:
    Any ideas/help would be (greatly) appreciated.

    Thanks
    Aisling
Working...
X