Announcement Announcement Module
Collapse
No announcement yet.
unable to Register JAX-RPC Bean Mappings Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • unable to Register JAX-RPC Bean Mappings

    Hi All,

    I've been trying to call an AXIS SOAP webservice, and I followed the reference docs on
    http://static.springsource.org/sprin...g-web-services

    and in my config I use the newly created class that extends JaxRpcPortProxyFactoryBean, now what I noticed is that the application does not enter the postProcessJaxRpcService method!

    my code:

    Code:
    package com.test;
    
    
    import javax.xml.namespace.QName;
    import javax.xml.rpc.encoding.TypeMapping;
    import javax.xml.rpc.encoding.TypeMappingRegistry;
    
    import org.apache.axis.client.Service;
    import org.apache.axis.encoding.ser.BeanDeserializerFactory;
    import org.apache.axis.encoding.ser.BeanSerializerFactory;
    import org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean;
    
    
    @SuppressWarnings("all")
    public class AxisPortProxyFactoryBean extends JaxRpcPortProxyFactoryBean {
    
        
    	protected void postProcessJaxRpcService(Service service) {
    		TypeMappingRegistry registry = service.getTypeMappingRegistry();
            TypeMapping mapping = registry.createTypeMapping();
            //TODO Register Bean Mappings
            registerBeanMapping(mapping, SomeClass.class, "PcspArg");
            registry.register("http://schemas.xmlsoap.org/soap/encoding/", mapping);
        }
    
        protected void registerBeanMapping(TypeMapping mapping, Class type, String name) {
            QName qName = new QName("http://localhost/jboss-net/services/PcspI01Service", name);
            mapping.register(type, qName, new BeanSerializerFactory(type, qName), new BeanDeserializerFactory(type, qName));
        }
        
    }
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
    
    	
    	<bean id="cpWebservices"
    		class="com.test.AxisPortProxyFactoryBean">
    		<property name="serviceInterface" value="com.test.CPWebservices" />
    		<property name="wsdlDocumentUrl"
    			value="http://localhost/jboss-net/services/PcspI01Service?wsdl" />
    		<property name="namespaceUri" value="http://localhost/jboss-net/services/PcspI01Service" />
    		<property name="serviceName" value="PcspI01ServiceRemoteService" />
    		<property name="portName" value="PcspI01Service" />
    	</bean>
    
    </beans>
    Last edited by cutout33; Dec 14th, 2010, 04:41 AM.

  • #2
    I forgot to add the error am having


    Code:
    Caused by: org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://www.packetcable.com/pcsp/i01}ArrayOfPcspArg
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildInputParameter(JAXRPCMetaDataBuilder.java:266)
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.buildParameterMetaDataRpc(JAXRPCMetaDataBuilder.java:566)
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCMetaDataBuilder.setupOperationsFromWSDL(JAXRPCMetaDataBuilder.java:210)
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaDataInternal(JAXRPCClientMetaDataBuilder.java:223)
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:135)
    	at org.jboss.ws.metadata.builder.jaxrpc.JAXRPCClientMetaDataBuilder.buildMetaData(JAXRPCClientMetaDataBuilder.java:87)
    	at org.jboss.ws.core.jaxrpc.client.ServiceImpl.<init>(ServiceImpl.java:111)
    	at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
    	at org.jboss.ws.core.jaxrpc.client.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
    	at org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory.createService(LocalJaxRpcServiceFactory.java:297)
    	at org.springframework.remoting.jaxrpc.LocalJaxRpcServiceFactory.createJaxRpcService(LocalJaxRpcServiceFactory.java:233)
    	at org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.prepare(JaxRpcPortClientInterceptor.java:377)
    	at org.springframework.remoting.jaxrpc.JaxRpcPortClientInterceptor.afterPropertiesSet(JaxRpcPortClientInterceptor.java:349)
    	at org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean.afterPropertiesSet(JaxRpcPortProxyFactoryBean.java:73)
    	at com.billz.poc.provisioning.handlers.AxisPortProxyFactoryBean.afterPropertiesSet(AxisPortProxyFactoryBean.java:19)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1460)
    	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1398)
    	... 159 more

    Comment

    Working...
    X