Results 1 to 7 of 7

Thread: Problem accessing Web Services with JaxRpcPortProxyFactoryBe

Hybrid View

  1. #1
    Join Date
    Mar 2005
    Location
    Switzerland
    Posts
    12

    Default 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. #2
    Join Date
    Aug 2004
    Location
    Tampa, FL
    Posts
    39

    Default

    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.
    Nilesh Kapadia
    http://www.nileshk.com

  3. #3
    Join Date
    Mar 2005
    Location
    Switzerland
    Posts
    12

    Default 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

  4. #4
    Join Date
    Aug 2004
    Location
    Tampa, FL
    Posts
    39

    Default

    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
    Nilesh Kapadia
    http://www.nileshk.com

  5. #5
    Join Date
    Mar 2005
    Location
    Switzerland
    Posts
    12

    Default Thanks

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

  6. #6
    Join Date
    Jan 2005
    Location
    MD
    Posts
    31

    Default

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

  7. #7
    Join Date
    Mar 2005
    Location
    Switzerland
    Posts
    12

    Default Thanks for the hint, too

    Hi rpoetker,

    Thanks for the hint, too.
    Cheers,
    Christoph

Similar Threads

  1. Replies: 13
    Last Post: Jan 5th, 2007, 11:22 PM
  2. Replies: 0
    Last Post: Jun 17th, 2005, 05:05 AM
  3. Spring accessing other non Spring Web Services
    By aanecito in forum Architecture
    Replies: 1
    Last Post: Jun 17th, 2005, 04:42 AM
  4. Replies: 2
    Last Post: May 2nd, 2005, 05:33 AM
  5. Replies: 0
    Last Post: Oct 20th, 2004, 04: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
  •