Results 1 to 3 of 3

Thread: JAXRPC web service - Deserializing problems

  1. #1
    Join Date
    Feb 2005
    Posts
    4

    Default JAXRPC web service - Deserializing problems

    Hi there,

    I'm trying to connect to a web service using JAXRPC and Spring and I'm using the JPetstore example as my reference application.

    I'm getting a strange error saying:
    The following exception was logged org.xml.sax.SAXException: Deserializing parameter '***name of my return type here***': could not find deserializer for type {***namespace***}***name of my return type here***

    My return type from the web service call is a simple value object with a String member variable. I was under the impression that I should not have to specify a custom deserializer for such a simple value object.

    I have connected directly to the web service using stubs I generated using wsdl2java, so I know there's nothing wrong with the web service.

    Might someone be able to offer me advice on this?

  2. #2
    Join Date
    Sep 2004
    Posts
    127

    Default

    I think you need to register any custom type, even if it's really simple.

    I'm currently trying to access a SOAP service as is shown in chapter 16 of Pro Spring, and I'm also running into "could not find deserializer for type" error messages - even though I did do everything by the book.

  3. #3
    Join Date
    Feb 2005
    Posts
    4

    Default

    Hi there,

    I was able to fix the problem I was having earlier on in the post.
    This is what I did.
    This is my clientContext.xml file ... much like the clientContext.xml file in the JPetStore example.
    Code:
    <bean id="jaxRpcProxy" class="*** create a class which extends org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean***">
      <property name="serviceInterface">
    	<value>***put the class name corresponding to your service interface in here***</value>
      </property>
      <property name="portInterface">
    	<value>***put the class name corresponding to your port interface in here &#40;this should throw a remote exception&#41;***</value>
      </property>
      <property name="serviceFactoryClass">
    	<value>org.apache.axis.client.ServiceFactory</value>
      </property>
      <property name="wsdlDocumentUrl">
    	<value>*** put the location of your wsdl file in here***</value>
      </property>
      <property name="namespaceUri">
    	<value>*** namespace for the wsdl goes in here***</value>
      </property>
      <property name="serviceName">
    	<value>*** name of the service you are trying to connect to goes in here***</value>
      </property>
      <property name="portName">
      	<value>*** The port name in your wsdl file goes in here***</value>
      </property>
      <property name="endpointAddress">
      	<value>*** The endpoint address goes in here***</value>
      </property>		
    </bean>
    I had left out the endpointAddress property and I think this is what led to my original error.

    The class that you create which extends org.springframework.remoting.jaxrpc.JaxRpcPortProx yFactoryBean should look like AxisPortProxyFactoryBean in the JPetStore example. Its probably a good idea to register all classes which you are serializing and deserializing in this code.

    Hope this clears up issues for anyone who was having the same problem as I was.

Similar Threads

  1. Replies: 1
    Last Post: Jun 3rd, 2008, 04:20 AM
  2. Replies: 1
    Last Post: Jul 12th, 2005, 02:39 AM
  3. Replies: 9
    Last Post: Feb 8th, 2005, 09:25 PM
  4. Creating a proper service layer?
    By infectedrhythms in forum Architecture
    Replies: 5
    Last Post: Jan 5th, 2005, 06:32 PM
  5. jaxrpc service testing
    By TheCodeJunkie in forum Remoting
    Replies: 0
    Last Post: Aug 26th, 2004, 09:41 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •