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

  • #16
    Originally posted by Arjen Poutsma View Post
    No, it does not mean that. Spring-WS 1.0.2 and Spring 2.5 work together, but you have to put the spring-webmvc.jar on the classpath explicitly. The classes in this jar used to be part of spring.jar (the uberjar), but since 2.5, that's not the case any more.

    Ok thanks.

    I'm fighting with my maven 2 dependencies configuration excluding some to avoid conflict ... but now it seems to work.

    Thanks again

    Comment


    • #17
      Originally posted by Arjen Poutsma View Post
      You can set the locationUri in the XsdBasedSoap11Wsdl4jDefinitionBuilder. Just change it from a HTTP location to a jms location. Note that this could mean that you need to have multiple WSDLs, one for HTTP and one for JMS. You can't specify the connection url in there, because I think that is ActiveMQ-specific.



      You currently can't. That might be a nice feature to add.



      You can define a replyToName in the jsm uri, i.e. jms:requestQueue?replyToName=responseQueue



      You mean the connection factory name and others? These properties are not supported, since in spring you either don't use JNDI for getting a connectionfactory, or use <jee:jndi-lookup/> to inject a connectionfactory into the messagesender.

      I hope you like the JMS support .


      Thanks for your great support Arjen,

      while iam using the jms uri by specifying the replyToName i got the following exception.

      org.springframework.web.util.NestedServletExceptio n: Request processing failed; nested exception is java.lang.ClassCastException: org.apache.activemq.command.ActiveMQTextMessage
      org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:488)
      org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:441)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)

      root cause

      java.lang.ClassCastException: org.apache.activemq.command.ActiveMQTextMessage
      org.springframework.ws.transport.jms.JmsSenderConn ection.onReceiveBeforeRead(JmsSenderConnection.jav a:195)
      org.springframework.ws.transport.AbstractWebServic eConnection.receive(AbstractWebServiceConnection.j ava:46)
      org.springframework.ws.client.core.WebServiceTempl ate.sendAndReceive(WebServiceTemplate.java:412)
      org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 266)
      org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 254)
      org.springframework.ws.client.core.WebServiceTempl ate.marshalSendAndReceive(WebServiceTemplate.java: 246)
      com.wsgc.services.atp.client.integration.wsclient. jms.impl.FindATPClientJMSImpl.sendMessage(FindATPC lientJMSImpl.java:92)
      com.wsgc.services.atp.client.integration.wsclient. jms.impl.FindATPClientJMSImpl.findATP(FindATPClien tJMSImpl.java:55)
      com.wsgc.services.atp.client.services.impl.ATPMana gerImpl.findATPByJmsCall(ATPManagerImpl.java:18)
      com.wsgc.services.atp.client.web.controller.FindAT PFormController.onSubmit(FindATPFormController.jav a:62)
      org.springframework.web.servlet.mvc.SimpleFormCont roller.processFormSubmission(SimpleFormController. java:267)
      org.springframework.web.servlet.mvc.AbstractFormCo ntroller.handleRequestInternal(AbstractFormControl ler.java:265)
      org.springframework.web.servlet.mvc.AbstractContro ller.handleRequest(AbstractController.java:153)
      org.springframework.web.servlet.mvc.SimpleControll erHandlerAdapter.handle(SimpleControllerHandlerAda pter.java:48)
      org.springframework.web.servlet.DispatcherServlet. doDispatch(DispatcherServlet.java:858)
      org.springframework.web.servlet.DispatcherServlet. doService(DispatcherServlet.java:792)
      org.springframework.web.servlet.FrameworkServlet.p rocessRequest(FrameworkServlet.java:476)
      org.springframework.web.servlet.FrameworkServlet.d oPost(FrameworkServlet.java:441)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:710)
      javax.servlet.http.HttpServlet.service(HttpServlet .java:803)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:96)


      Can i use the soap over jms over the Spring 1.0.2 version by adding the jars necessary or i should change all my spring WS dependencies to 1.5.

      Comment


      • #18
        The error you get is from receiving a JMS TextMessage response to the BytesMessage you sent as a request. Spring-WS uses BytesMessages at both server and client-side. I've improved the code in svn, now it throws an more illustrative exception in this case.

        Are you using Spring-WS at the server side here as well?

        Comment


        • #19
          Originally posted by Arjen Poutsma View Post
          The error you get is from receiving a JMS TextMessage response to the BytesMessage you sent as a request. Spring-WS uses BytesMessages at both server and client-side. I've improved the code in svn, now it throws an more illustrative exception in this case.

          Are you using Spring-WS at the server side here as well?
          I am using Spring-WS for both client and service.I didnt write any code for handling jms.i just used the WebServiceTemplate(with JmsMessageSender ) at the client side and WebServiceMessageListener on the server side.

          It worked fine if i did not give any replyTo property when i mentioned the replyTo property i am getting the above error.

          Comment


          • #20
            XStreamMarshaller and XSL

            I would like to use XStream combined with XSL to do marshalling/unmashalling. Would it be possible to have the xstream object in XStreamMarshaller made protected instead of private so that it could be use in sub-classes?

            Dan

            Comment


            • #21
              Protected fields opens a whole range of issues, but there is a getXStream() method, which you can use.

              Comment


              • #22
                WSDL for SOAP over JMS

                Sorry to be resurrecting this old thread, but I found this to be very useful.

                Originally posted by Arjen Poutsma View Post
                You can set the locationUri in the XsdBasedSoap11Wsdl4jDefinitionBuilder. Just change it from a HTTP location to a jms location. Note that this could mean that you need to have multiple WSDLs, one for HTTP and one for JMS. You can't specify the connection url in there, because I think that is ActiveMQ-specific.
                Following the above hint from Arjen, I have defined my beans as shown below for SOAP over JMS. I have two problems:
                1. My WSDL still says the transport is http. (<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>) I was expecting soap/jms.
                2. Is the value for locationUri in the bean definition for WSDL correct? How could I verify this? I wish the class docs for XsdBasedSoap11Wsdl4jDefinitionBuilder had some info about the URI for JMS.

                Thanks in advance for any help you could provide in resolving these issues!

                Here are my bean definitions for WSDL generation and message listener.

                Code:
                    <bean class="org.springframework.jms.listener.DefaultMessageListenerContainer">
                        <property name="connectionFactory" ref="connectionFactory"/>
                        <property name="destinationName" value="RequestQueue"/>
                        <property name="messageListener">
                            <bean class="org.springframework.ws.transport.jms.WebServiceMessageListener">
                                <property name="messageFactory" ref="messageFactory"/>
                                <property name="messageReceiver" ref="messageDispatcher"/>
                            </bean>
                        </property>
                    </bean>
                
                    <bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher">
                        <property name="endpointMappings">
                            <bean
                              class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
                                <property name="defaultEndpoint">
                                    <ref bean="echoEndpoint"/>
                                </property>
                            </bean>
                        </property>
                    </bean>
                    
                    <bean id="echo" class="org.springframework.ws.wsdl.wsdl11.DynamicWsdl11Definition">
                		<property name="builder">
                			<bean
                				class="org.springframework.ws.wsdl.wsdl11.builder.XsdBasedSoap11Wsdl4jDefinitionBuilder">
                				<property name="schema" value="/WEB-INF/echo.xsd"/>
                				<property name="portTypeName" value="Echo"/>
                				<property name="locationUri" value="jms:/RequestQueue"/>
                			</bean>
                		</property>
                	</bean>

                Comment

                Working...
                X