Announcement Announcement Module
Collapse
No announcement yet.
Which one spring web service use (jax-rpc or jax-ws) ? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Which one spring web service use (jax-rpc or jax-ws) ?

    i have a very basic doubt
    i worked on jax-ws using weblogic application server.
    i am learning spring web service.

    my doubt is which one i am using jax-ws or jax-rpc ?

    my spring configuration looks like

    Code:
     <bean id="helloEndpoint" class="com.mycompany.hello.ws.HelloEndPoint"/>
    
     <bean id="hello" class="org.springframework.ws.wsdl.wsdl11.DefaultWsdl11Definition">
                    <property name="schema" ref="helloSchema" />
                    <property name="portTypeName" value="HelloWorldResource" />
                    <!-- we use a relative uri that will be transformed by spring-ws dep-->
                    <property name="locationUri" value="/helloService/" />
                    <property name="targetNamespace" value="http://mycompany.com/hello/definitions" />
            </bean>
            <bean id="helloSchema" class="org.springframework.xml.xsd.SimpleXsdSchema">
                    <property name="xsd" value="/WEB-INF/hello.xsd" />
            </bean>
    Code:
    <bean class="org.springframework.ws.server.endpoint.mapping.PayloadRootQNameEndpointMapping">
                    <property name="mappings">
                            <props>
                                    <prop key="{http://mycompany.com/hello/schemas}HelloRequest">helloEndpoint</prop>
                            </props>
                    </property>
                    <property name="interceptors">
                            <bean class="org.springframework.ws.server.endpoint.interceptor.PayloadLoggingInterceptor" />
                    </property>
            </bean>

  • #2
    Hi

    You're using ... SpringWS. I mean - it's neither JAX-RPC nor JAX-WS.

    You use pragmatic approach to Web Services. You use transparent mapping of SOAP messages to endpoints (PayloadRootQNameEndpointMapping) - with JAX-WS/JAX-RPC the mapping is hidden in particular implementation (and consists of a mix of URL/payload/SOAPAction header/WS-Addressing).

    You're not using JAX-WS/JAX-RPC, because you're not tied to their APIs.

    Spring is neither replacement nor pure wrapper to JavaEE

    regards
    Grzegorz Grzybek

    Comment


    • #3
      what is the web service protocal ?

      First thanks for your reply
      I can understand your message but it lead me to another doubt

      if i need to write a servlet i can choose j2ee-api or Struts or spring.
      i know that all follow the javax.servlet.Servlet interface

      similarly
      if i need to write a web service i can choose jax-rpc/jax-ws , spring , axis ..etc
      but my doubt is what is the common interface that all follows ?

      Comment


      • #4
        The common interface is wsdl and xml... As Grzegorz already stated you use spring-ws not jax-ws or jax-rpc...

        Comment


        • #5
          Thanks Marten

          With servlets there is always javax.servlet.http.HttpServlet underneath (however you're not writing servlets with SpringMVC or Struts - you're writing controllers/actions).

          With WebServices there is XML underneath. One common (almost) API could be SAAJ (unless you choose Axiom model for Spring). But it's well hidden and is connected with messages, not entire architecture.

          regards
          Grzegorz Grzybek

          Comment


          • #6
            Thanks

            Thank you Grzegorz Grzybek and Marten Deinum .

            Comment

            Working...
            X