Announcement Announcement Module
Collapse
No announcement yet.
Problem accessing Web Services with JaxRpcPortProxyFactoryBe Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Problem accessing Web Services with JaxRpcPortProxyFactoryBe

    Hello everybody,

    I have a simple web service running on WebSphere 5.1 which I try to access from a remote client using the JaxRpcPortProxyFactoryBean.

    I get the following exception:

    java.lang.ClassCastException: com.ibm.ws.webservices.engine.xmlsoap.SOAPElement
    at $Proxy0.replyAddress(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:85)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:58)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:60)
    at java.lang.reflect.Method.invoke(Method.java:391)
    at org.springframework.remoting.rmi.RmiClientIntercep torUtils.doInvoke(RmiClientInterceptorUtils.java:9 8)
    (...)

    The configuration I use looks as follows:
    Code:
    <beans>
        <bean id="helloWebService" class="org.springframework.remoting.jaxrpc.JaxRpcPortProxyFactoryBean">
            <property name="serviceInterface">
                <value>com.ibm.wsad.ws.test.ITellerApplicationService</value>
            </property>
            <property name="portInterface">
                <value>com.ibm.wsad.ws.test.ITellerApplicationServiceRemote</value>
            </property>
            <property name="wsdlDocumentUrl">
                <value>http&#58;//localhost&#58;9080/TellerWebService/services/TellerApplicationService/wsdl/TellerApplicationService.wsdl</value>
            </property>
            <property name="namespaceUri">
                <value>http&#58;//test.ws.wsad.ibm.com</value>
            </property>
            <property name="serviceName">
                <value>TellerApplicationServiceService</value>
            </property>
            <property name="portName">
                <value>TellerApplicationService</value>
            </property>
        </bean>
    </beans>
    Can anybody give me a hint to solve this problem?

    Thank you very much for any help.
    Christoph

  • #2
    I am also having some kind of problem that throws a ClassCastException: http://forum.springframework.org/viewtopic.php?t=4816

    What type of web services are these (doc/literal, rpc/encoded?)
    What are you using on the client side? (e.g. Axis?)
    Have you tried consuming this web service using normal methods? (i.e. using generated proxy classes)

    I have gotten Spring JAX-RPC support to work well for rpc/encoded web services, but have yet to get everything working for doc/literal.

    Comment


    • #3
      rpc/encoded works only for simple type

      Hello Nilesh,
      Thank you for your reply. When I switch to rpc/encoded it works, as long as the return type is a simple type, such as String.
      If the return type is a complex type, such as a "DTO" with string and int properties, I get the following exception:

      org.xml.sax.SAXException: WSWS3139E: Error: No deserializer for {http://test.ws.wsad.ibm.com}TellerType

      Does anybody have a hint for this?

      When I use a generated proxy, if works fine, but I would very much like to use the spring proxy...

      Thank you, cheers,
      Christoph

      Comment


      • #4
        I think you need to write code to set the typemapping for each complex type. Check out the jPetstore example.. Look at client\clientContext.xml.. In the Spring 1.2 version look at the code for BeanMappingServicePostProcessor and how that is configured. For Spring 1.1 version look at AxisPortProxyFactoryBean.

        Also, someone appears to have written a solution to do typemapping automatically: http://opensource.atlassian.com/proj...browse/SPR-594

        Comment


        • #5
          Thanks

          Hello Nilesh,
          Thank you very much for your hints.
          Cheers.
          Christoph

          Comment


          • #6
            There is also a section in the spring ref doc on declaring type mappings in the JaxRpcPortProxyFactoryBean: http://static.springframework.org/sp....html#d0e10452

            Comment


            • #7
              Thanks for the hint, too

              Hi rpoetker,

              Thanks for the hint, too.
              Cheers,
              Christoph

              Comment

              Working...
              X