Results 1 to 2 of 2

Thread: Axis/Jax-Rpc: postProcessJaxRpcService isn't getting called

  1. #1
    Join Date
    Jun 2006
    Posts
    6

    Default Axis/Jax-Rpc: postProcessJaxRpcService isn't getting called

    Help!

    I'm trying to use a web service that returns a complex object, and I'm getting a "could not find deserializer for type" error. As per the numerous posts, I implemented a new PortProxyFactoryBean (extended JaxRpxPortProxyFactoryBean) and implemented postProcessJaxRpcService, which calls registerBeanMapping (see code).

    After setting up my mappings for the missing types and running again, I am still getting the same error. I've stepped through the code, and the mapping doesn't contain my new entries. Placing a breakpoint at the start of postProcessJaxRpxService never breaks...

    Any ideas?


    Kyle Mallory


    Code:
    public class AxisTLRPortProxyFactoryBean extends JaxRpcPortProxyFactoryBean {
    
    	protected void postProcessJaxRpcService(Service service) {
    		TypeMappingRegistry registry = (TypeMappingRegistry) service.getTypeMappingRegistry();
    		TypeMapping mapping = (TypeMapping) registry.createTypeMapping();
    		
    		registerBeanMapping(mapping, TLRResponse.class,		"TLRResponse");
    		registerBeanMapping(mapping, NameQueryResponse.class,	"NameQueryResponse");
    		registerBeanMapping(mapping, NameQueryRow.class,		"NameQueryRow");
    		
    		registry.register("http://schemas.xmlsoap.org/soap/encoding/", mapping);
    	}
    
    	protected void registerBeanMapping(TypeMapping mapping, Class type, String name) {
    		QName qName = new QName("http://shared.tlr.service.uii.org", name);
    		mapping.register(type, qName,
    		    new BeanSerializerFactory(type, qName),
    		    new BeanDeserializerFactory(type, qName));
    	}
    }

    HTML Code:
    <?xml version="1.0" ?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    
    <beans>
        <bean name="/query/index.html" class="org.uii.app.tlr.controllers.QueryController">
    		<property name="tlrService" ref="tlrClient"/>
    	</bean>
        <bean id="messageSource" class="org.springframework.context.support.ResourceBundleMessageSource">
            <property name="basename"><value>messages</value></property>
        </bean>
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass"><value>org.springframework.web.servlet.view.JstlView</value></property>
            <property name="prefix"><value>/WEB-INF/jsp/</value></property>
            <property name="suffix"><value>.jsp</value></property>
        </bean>
    	
    	<bean id="tlrClient" class="org.uii.app.tlr.client.AxisTLRPortProxyFactoryBean">
    		<property name="serviceFactoryClass"><value>org.apache.axis.client.ServiceFactory</value></property>
    		<property name="serviceInterface"><value>org.uii.service.tlr.client.ITLRWebService</value></property>
    		<property name="serviceName"><value>TLRWebService</value></property>
    
    		<property name="wsdlDocumentUrl"><value>http://localhost/tlr-service/ws/tlr?wsdl</value></property>
    		<property name="namespaceUri"><value>http://mydomain.tld/tlr/service</value></property>
    	
    		<property name="portName"><value>tlr</value></property>
    	</bean>
    </beans>

  2. #2
    Join Date
    Jun 2006
    Posts
    6

    Default A reoccuring theme...

    So, I found my answer through another topic (other methods of JaxRpcPortProxyFactoryBean not executing), which gave me some clues for where to look.

    I'll post for others reference, and encourage someone on the Spring team to note this somewhere else, since it seems to be common in a number of dissimilar topics.

    The issue involves importing different/alternate version of the same fundamental class, which apparently does not invalidate the compiler (thus still compiling the code and executing without error).

    In my particular case, I was importing "org.apache.axis.*.Service" (Eclipse recommended this as the import for the Service parameter required to postProcessJaxRpcService).

    Changing the import for Service from the org.apache.axis.* to javax.xml.rpm.Service fixed the problem and executed the method correctly.

    It seems that in these other topics, there is some confusion about which imports should be used to resolve conflicts, particularly where there are many alternates (axis/jax-rpc) that still maintain the interface fingerprint allowing the code to compile and execute.


    KM

Posting Permissions

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