Renier Rhode wrote:
Not sure if it may be case sensitive so this line

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

should maybe read

      registerBeanMapping(mapping,
StoreDocumentResponse.class,"storeDocumentResponse");


Yeah, did try this yesterday and no dice :-(


But we're using XFire now, but have consumed Axis web services using the
Spring Proxy before we chucked Axis.


Would you mind posting an example for XFire? Would be greatly
appreciated Renier :-)


IMHO, XFire is faster and much simpler than Axis, and plays very nicely with
Spring.



Cheers,

Renier



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





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://localhost/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:

Quote:org.xml.sax.SAXException: Deserializing parameter

'storeDocumentResponse': could not find deserializer for type

{http://localhost/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.)



I have seen several posting about encoding, etc and trying doing:

Code:

//register the mapping

       registry.register("", mapping);

But that just generated more exceptions:

Quote:org.xml.sax.SAXException: Bad types (interface

javax.xml.soap.SOAPElement -> class

za.co.sanlam.cm.cmdocument.dto.StoreDocumentReques t) Message being

parsed:



What underlying web service framework are you using? I have used Axis

2.1, but currently reverted to Axis 1.4 since I was able to get

further.


--~--~---------~--~----~------------~-------~--~----~
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