Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: SimpleWsdl11Definition - xsd files

  1. #11
    Join Date
    May 2005
    Posts
    13

    Default This works but...

    Quote Originally Posted by adrian View Post
    Just encountered this issue and would like to share how it is done as I couldn't find it in the reference doc or in this forum.

    This issue is supposed to be fixed in 1.5.3 as per JIRAs http://jira.springframework.org/browse/SWS-281 and http://jira.springframework.org/browse/SWS-346. Unfortunately, an example is not given or even the handler class name. Anyway, here is one approach.

    Code:
    	<bean id="MyService" class="org.springframework.ws.wsdl.wsdl11.SimpleWsdl11Definition">
        		<constructor-arg value="/wsdl/MyService.wsdl"/>
    	</bean>
    	
    	<bean id="MySchemaA" class="org.springframework.xml.xsd.SimpleXsdSchema">
    		<property name="xsd" value="/wsdl/MySchemaA.xsd" />
    	</bean>
    	<bean id="MySchemaB" class="org.springframework.xml.xsd.SimpleXsdSchema">
    		<property name="xsd" value="/wsdl/MySchemaB.xsd" />
    	</bean>
    where MyService imports MySchemaA and MySchemaA imports MySchemaB. Then all of them are exposed based on their bean names i.e. http://someUrl/someContext/MyService.wsdl, http://someUrl/someContext/MySchemaA.xsd, http://someUrl/someContext/MySchemaB.xsd.

    Yes, it is that simple but it took me sometime to figure it out. I initially thought that you still need to declare as a bean the handler like

    Code:
    	<bean lass="org.springframework.ws.transport.http.XsdSchemaHandlerAdapter"/>
    so I had to find out the handler class name and how it is supposed to work. But after checking the MessageDispatcherServlet code, it creates that handler automatically for you if none is found. In the end, it is just a matter of declaring the schemas together with SimpleWsdl11Definition.

    This is just one approach. Maybe CommonsXsdSchemaCollection can also be used but haven't tried it.

    Hope this helps.

    Arjen, if this is the correct approach to expose imported XSDs, perhaps it could be mentioned in Section 5.3 of the reference doc? It would save a lot of time to those new to this.

    Thanks.
    I have been unable to get a "correct" schema location in my wsdl (the schema location is not re-written in the import). Were you able to to get a schema location of http://someUrl/someContext/MySchemaA.xsd in your wsdl without hard coding it? My reading of the (closed) jira issues is that this was not implemented. Arjen, is there an open issue or plans to implement some schema location re-writing in the SimplwWsdl11Definition?

  2. #12
    Join Date
    May 2009
    Posts
    18

    Default Alternate Solution

    An alternate solution is to use Spring's ResourceServlet to serve WSDLs/XSDS. http://forum.springsource.org/showthread.php?t=91536

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •