Announcement Announcement Module
Collapse
No announcement yet.
Separate WSDLs or a single WSDL for CRUD functions? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Originally posted by poutsma
    I could add the 'relative path' solution, though. Basically, I only have to check whether the location starts with a slash, and then do the magic. Would that solve your problem?
    That might be better. I also wonder if there is any way to completely generate the URL (i.e. not use the original source) using the HttpServletRequest and the information in web.xml. Can that be retrieved using the one of the other Servlet APIs?

    Currently my web.xml contains the following:
    Code:
    	<servlet-mapping>
    		<servlet-name>pcc-ws</servlet-name>
    		<url-pattern>/services</url-pattern>
    	</servlet-mapping>
    	<servlet-mapping>
    		<servlet-name>pcc-ws</servlet-name>
    		<url-pattern>/wsdl/PccService.wsdl</url-pattern>
    	</servlet-mapping>
    	<mime-mapping>
    		<extension>xsd</extension>
    		<mime-type>text/xml</mime-type>
    	</mime-mapping>
    	<welcome-file-list>
    		<welcome-file>index.html</welcome-file>
    		<welcome-file>index.jsp</welcome-file>
    	</welcome-file-list>
    Shannon Kendrick

    Comment


    • #17
      I don't think completely generating the URL is possible. The problem is that with both the web.xml and the *-servlet.xml, you're extremely flexible with regard to were handlers are bound. Basically, you can determine which handler an incoming URL handles, but you cannot get a list of all handlers and the URLs they're mapped on. This mostly has to do with the wildcards in both files (e.g. /services/*). So, there's basically now way to determine where the Web services are bound.

      I will implement the relative location fix soon this evening.

      Comment


      • #18
        It's done. Try a nightly build tomorrow. You can now use both absolute paths and relative paths in the location field. From the javadoc:

        If the property transformLocations is set to true, this adapter will change location attributes in the WSDL definition to reflect the URL of the incoming request. If the location
        field in the original WSDL is an absolute path, the scheme, hostname, and port will be changed. If the location is a relative path, the scheme, hostname, port, and context path will be prepended. This behavior can be customized by overriding the transformLocation() method.

        For instance, if the location attribute defined in the WSDL is http://localhost:8080/context/services/myService, and the request URI for the WSDL is http://example.com/context/myService.wsdl, the location will be changed to http://example.com/context/services/myService.

        If the location attribute defined in the WSDL is /services/myService, and the request URI for the WSDL is http://example.com:8080/context/myService.wsdl, the location will be changed to http://example.com:8080/context/services/myService.

        Comment


        • #19
          Hi,

          could you please post an extract of your Spring configuration, showing declarations of WsdlDefinitionHandlerAdapter, SimpleWsdl11Definition and their mapping ?

          Thanks,
          Damien.

          Comment


          • #20
            Yes i can.
            Cheers,

            Ingo

            Code:
            <bean id="wsdlDefinitionHandlerAdapter" class="org.springframework.ws.transport.http.WsdlDefinitionHandlerAdapter">
                    <description> ... </description>
                    <property name="transformLocations" value="true"/>
                </bean>
            
                <bean id="handlerMapping"
                      class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
                    <description>           ...        </description>
                    <property name="defaultHandler" ref="messageDispatcher"/>
                    <property name="mappings">
                        <props>
                            <prop key="/services/*">messageDispatcher</prop>
                            <prop key="/eim.wsdl">eimWsdl</prop>
                        </props>
                    </property>
                </bean>
            
            
            
            
            <bean id="eimWsdl" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
            	    <description> ... </description>
                    <property name="wsdl" value="/eim.wsdl"/>
                </bean>

            Comment


            • #21
              Could you please, post the definition of the 'messageDispatcher' bean?

              Comment


              • #22
                There isn't much to see.

                Code:
                    <bean id="messageDispatcher" class="org.springframework.ws.soap.server.SoapMessageDispatcher">
                        <description>
                            The MessageDispatcher is responsible for routing messages to endpoints.
                        </description>
                        <property name="endpointMappings">
                            <list>
                            	<ref local="soapActionMapping"/>   
                                <!-- <ref local="payloadMapping"/> -->
                            </list>
                        </property>
                        <property name="endpointExceptionResolvers">
                            <list>
                                <ref bean="endpointExceptionResolver"/>
                            </list>
                        </property>
                    </bean>

                Comment


                • #23
                  By the way, all those bean definitions (messageDispatcher, wsdlDefinitionHandlerAdapter, handlerMapping) for which type of dispatcher (org.springframework.web.servlet.DispatcherServlet or org.springframework.ws.transport.http.MessageDispa tcherServlet)?

                  If i put those definitions for MessageDispatcherServlet than urls (/services/*, /eim.wsdl) are not accessible and also i can not access my web services (it saying that there are no endpointMapping found).

                  Comment


                  • #24
                    The MessageDispatcherServlet is basically a convenient facade over the DispatcherServlet and the handler adapters. So if you use the MessageDispatcherServlet, there is no need to configure the handler adapters any more.

                    Comment

                    Working...
                    X