Announcement Announcement Module
Collapse
No announcement yet.
Jibx Marshaller with spring-ws Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Jibx Marshaller with spring-ws

    Hi,

    I am new to spring-ws. I am trying to run echo sample using jibx marshaller. I am able to see wsdl file but when i am trying to access the web service using client program .. its giving me error saying

    "org.springframework.ws.server.MessageDispatch er dispatch No endpoint mapping found for [SaajSoapMessage EchoRequest]"


    Does any body used spring-ws with jibx? Please i am stuck on this. Any thoughs or link will help me.

    Thanks!

  • #2
    Hi,

    I am stuch at the point where i have no idea why am i getting this error. I am using Jdk1.4.2, WAS 6.0, Spring-ws 1.5 and spring 2.0 .my wsdl file is:

    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:schema="http://localhost:9080/spring-ws-marshaller/services/echo/schemas" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://localhost:9080/spring-ws-marshaller/services/echo/schemas">
    - <wsdl:types>
    - <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:ec="http://localhost:9080/spring-ws-marshaller/services/echo/schemas" elementFormDefault="qualified" targetNamespace="http://localhost:9080/spring-ws-marshaller/services/echo/schemas">
    - <xs:element name="EchoRequest">
    - <xs:complexType>
    - <xs:all>
    <xs:element name="name" type="xs:string" />
    </xs:all>
    </xs:complexType>
    </xs:element>
    - <xs:element name="EchoResponse">
    - <xs:complexType>
    - <xs:all>
    <xs:element name="message" type="xs:string" />
    </xs:all>
    </xs:complexType>
    </xs:element>
    - <!--
    <xs:complexType name="EchoType">
    <xs:sequence>
    <xs:element name="name" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    <xs:complexType name="ReturnType">
    <xs:sequence>
    <xs:element name="message" type="xs:string"/>
    </xs:sequence>
    </xs:complexType>

    -->
    </xs:schema>
    </wsdl:types>
    - <wsdl:message name="EchoResponse">
    <wsdlart element="schema:EchoResponse" name="EchoResponse" />
    </wsdl:message>
    - <wsdl:message name="EchoRequest">
    <wsdlart element="schema:EchoRequest" name="EchoRequest" />
    </wsdl:message>
    - <wsdlortType name="Echo">
    - <wsdl:operation name="Echo">
    <wsdl:input message="schema:EchoRequest" name="EchoRequest" />
    <wsdl:output message="schema:EchoResponse" name="EchoResponse" />
    </wsdl:operation>
    </wsdlortType>
    - <wsdl:binding name="EchoBinding" type="schema:Echo">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="Echo">
    <soap:operation soapAction="" />
    - <wsdl:input name="EchoRequest">
    <soap:body use="literal" />
    </wsdl:input>
    - <wsdl:output name="EchoResponse">
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="EchoService">
    - <wsdlort binding="schema:EchoBinding" name="EchoPort">
    <soap:address location="http://localhost:9080/spring-ws-marshaller/services" />
    </wsdlort>
    </wsdl:service>
    </wsdl:definitions>



    and the SOAP request i am sending to the webservice looks like -

    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Header/><soapenv:Body><EchoRequest>
    <name>Test Message</name>

    </EchoRequest></soapenv:Body></soapenv:Envelope>

    Bean definition for the client program is :


    <?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-2.0.xsd">

    <bean id="echoClient" class="com.jpmc.ws.client.EchoClient">


    <property name="defaultUri" value="http://localhost:8080/spring-ws-marshaller/services"/>
    <property name="request" value="classpath:com/jpmc/ws/client/echo.xml"/>
    <property name="marshaller" ref="marshaller" />
    <property name="unmarshaller" ref="marshaller"/>
    </bean>
    <bean id="marshaller" class="org.springframework.oxm.jibx.JibxMarshaller ">
    <property name="targetClass" value="com.jpmc.ws.echo.EchoRequest"/>
    <!-- <property name="bindingName" value="classpath:jibxBinding/echoRequest-binding.xml"/>-->
    <property name="encoding" value="UTF-8" />
    <property name="indent" value="2" />
    </bean>

    <!-- <bean id="messageSender" class="org.springframework.ws.transport.http.HttpU rlConnectionMessageSender" /> -->
    </beans>


    server side bean is:


    <?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-2.0.xsd">

    <bean id="echoEndpoint" class="com.jpmc.ws.endpoint.EchoEndpoint">
    <property name="marshaller"><ref bean="marshaller"/></property>
    <property name="unmarshaller"><ref bean="marshaller"/></property>
    <property name="echoService"><ref bean="echoService"/></property>
    </bean>
    <bean id="marshaller" class="org.springframework.oxm.jibx.JibxMarshaller ">
    <property name="targetClass" value="com.jpmc.ws.echo.EchoRequest"/>
    <!-- <property name="bindingName" value="classpath:jibxBinding/echoRequest-binding.xml"/>-->
    <property name="encoding" value="UTF-8" />
    <property name="indent" value="2" />
    </bean>
    <bean id="echoService" class="com.jpmc.ws.service.EchoServiceImpl"/>

    <bean class="org.springframework.ws.server.endpoint.mapp ing.PayloadRootQNameEndpointMapping">
    <property name="mappings">
    <props>
    <prop key="{http://localhost:9080/spring-ws-marshaller/services/echo/schemas}EchoRequest"
    >echoEndpoint</prop>
    </props>
    </property>
    <property name="interceptors">
    <bean
    class="org.springframework.ws.server.endpoint.inte rceptor.PayloadLoggingInterceptor"
    />
    </property>
    </bean>
    <bean id="messageFactory" class="org.springframework.ws.soap.saaj.SaajSoapMe ssageFactory">
    <property name="messageFactory">
    <bean class="com.sun.xml.messaging.saaj.soap.MessageFact oryImpl"></bean>
    </property>
    </bean>
    <bean id="echo" class="org.springframework.ws.wsdl.wsdl11.DynamicW sdl11Definition">
    <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="http://localhost:9080/spring-ws-marshaller/services"/>
    </bean>
    </property>
    </bean>



    </beans>

    I am getting this error:


    [4/13/08 12:22:52:473 EDT] 0000002e MessageDispat I org.springframework.web.servlet.FrameworkServlet initServletBean FrameworkServlet 'spring-ws-marshaller': initialization completed in 1078 ms
    [4/13/08 12:22:52:473 EDT] 0000002e ServletWrappe A SRVE0242I: [IRISWS] [/spring-ws-marshaller] [spring-ws-marshaller]: Initialization successful.
    [4/13/08 12:22:52:582 EDT] 0000002e EndpointNotFo W org.springframework.ws.server.MessageDispatcher dispatch No endpoint mapping found for [SaajSoapMessage EchoRequest]


    Please help me. Am i doing something wrong?
    Thanks!

    Comment


    • #3
      Also i am using Jibx 1.1 for marshalling and unmarshalling the xml. Please let me know if someone has used Spring-ws with jibx.


      Thanks!
      Supriya

      Comment


      • #4
        Well, the code you pasted is pretty much unreadable, since you didn't use the [code] tags.

        But at any rate:

        Code:
        [4/13/08 12:22:52:582 EDT] 0000002e EndpointNotFo W org.springframework.ws.server.MessageDispatcher dispatch No endpoint mapping found for [SaajSoapMessage EchoRequest]
        means that a SOAP message was sent with EchoRequest as the payload element, and no namespace. Otherwise it would look something like: SaajSoapMessage {http://somenamespace}EchoRequest. In order for the request to be mapped to an endpoint, there has to be a namespace.

        Comment


        • #5
          Thnaks for the reply. I was able to resolve the problem. I have one question ... i was using saaj with JibxMarshaller but it gave me UnSupportedError but when i used Axiom .. it worked fine ... So just wanted to confirm if we can use JibxMarshaller with Saaj or not?


          Thanks!

          Comment

          Working...
          X