Page 3 of 4 FirstFirst 1234 LastLast
Results 21 to 30 of 33

Thread: Handling multiple xsd's in wsdl

  1. #21

    Default

    Am specifying the url: http://localhost:8080/mtom-name/mtom/mtom.wsdl

    Which is same URL I specify on the browser too. And when I try accessing the common.xsd as http://localhost:8080/mtom-name/mtom/common.xsd, I get HTTP 405 error.

    And the common.xsd is in the /WEB-INF directory. And I have tried variations as follows in the spring servlet xml:

    <bean class="org.springframework.ws.wsdl.wsdl11.builder. XsdBasedSoap11Wsdl4jDefinitionBuilder">

    <property name="schema" value="/WEB-INF/schema.xsd"/>
    <property name="followIncludeImport" value="true"/>

    <!--
    <property name="schema" value="/WEB-INF/schema.xsd" />
    <property name="schemaLocation" value="classpath:schema.xsd" />
    -->

    <!--
    <property name="schema" value="/WEB-INF/schema.xsd"/>
    <property name="schemaLocation" value="/WEB-INF/common.xsd" />
    <property name="followIncludeImport" value="true"/>
    -->

    <!--
    <property name="schema" value="/xsd/schema.xsd" />
    <property name="schemaLocation" value="/xsd/common.xsd" />
    <property name="followIncludeImport" value="true"/>
    <property name="locationUri" value="http://${webService.host}/LHService/services" />
    <property name="prefix" value="tns" />
    <property name="schemaPrefix" value="schema" />
    <property name="targetNamespace" value="http://www.springframework.org/ws/samples/mtom/schema" />
    -->

    <property name="portTypeName" value="ImageRepository"/>
    <property name="locationUri" value="http://localhost:8080/mtom/"/>
    </bean>

    Thanks
    Sunil

  2. #22
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by Eugene Westerhof View Post
    Hi,

    I have added the the followIncludeImport attr to the WSDL builder

    <property name="builder">
    <bean class="...XsdBasedSoap11Wsdl4jDefinitionBuilder">
    <property name="schema" value="/WEB-INF/mySchema.xsd"/>
    <property name="followIncludeImport" value="true"/>
    <property name="portTypeName" value="mySchema"/>
    <property name="locationUri" value=".../Server/services"/>
    </bean>
    </property>

    However, the xsd's included in mySchema still do not show up in the WSDL (only as <xs:include schemaLocation="included.xsd" />). Am I forgetting something?
    The followIncludeImport only reads the included.xsd to find request and response elements. It doesn't inline the XSD, so you still end up with a include statement.

    I suppose we could inline the schema with an include (yet another property for the XsdBasedSoap11Wsdl4jDefinitionBuilder ), but we can't do this for imports, because they can have another target namespace.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  3. #23
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by sunil_g1 View Post
    Am specifying the url: http://localhost:8080/mtom-name/mtom/mtom.wsdl

    Which is same URL I specify on the browser too. And when I try accessing the common.xsd as http://localhost:8080/mtom-name/mtom/common.xsd, I get HTTP 405 error.

    And the common.xsd is in the /WEB-INF directory. And I have tried variations as follows in the spring servlet xml:
    The trick is to put common.xsd in the root of the web archive, not in WEB-INF. That exposes it to browsers and other clients. Also, you have to make sure that your web.xml (not the spring servlet xml) does not contain a servlet mapping for common.xsd.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  4. #24

    Default

    Have copied the common.xsd to the webcontext root. But I still get the same error. Have also tried copying both the xsd's to the web context root & pointing the schema in spring servlet xml as follows:

    <property name="schema" value="schema.xsd"/>

    Here's my web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>MyCompany HR Holiday Service</display-name>

    <servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.Messag eDispatcherServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>spring-ws</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>

    </web-app>

    Thanks
    Sunil

  5. #25

    Default

    Quote Originally Posted by Arjen Poutsma View Post
    The followIncludeImport only reads the included.xsd to find request and response elements. It doesn't inline the XSD, so you still end up with a include statement.

    I suppose we could inline the schema with an include (yet another property for the XsdBasedSoap11Wsdl4jDefinitionBuilder ), but we can't do this for imports, because they can have another target namespace.
    Thanks Arjen,

    If possible, it would be very much appreciated!

    Eugene

  6. #26
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by sunil_g1 View Post
    Have copied the common.xsd to the webcontext root. But I still get the same error. Have also tried copying both the xsd's to the web context root & pointing the schema in spring servlet xml as follows:

    <property name="schema" value="schema.xsd"/>

    Here's my web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
    version="2.4">

    <display-name>MyCompany HR Holiday Service</display-name>

    <servlet>
    <servlet-name>spring-ws</servlet-name>
    <servlet-class>org.springframework.ws.transport.http.Messag eDispatcherServlet</servlet-class>
    </servlet>

    <servlet-mapping>
    <servlet-name>spring-ws</servlet-name>
    <url-pattern>/*</url-pattern>
    </servlet-mapping>

    </web-app>
    The problem is that every incoming request is now handled by the spring-ws servlet. Including requests for the common.xsd.

    So you need to change the servlet-mapping to something like:

    Code:
        <servlet-mapping>
            <servlet-name>spring-ws</servlet-name>
            <url-pattern>/services</url-pattern>
        </servlet-mapping>
    so that requests for normal files aren't handled by the servlet.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  7. #27
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Quote Originally Posted by Eugene Westerhof View Post
    Thanks Arjen,

    If possible, it would be very much appreciated!
    Please create a JIRA issue at http://opensource.atlassian.com/proj...ing/browse/SWS
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  8. #28
    Join Date
    Nov 2007
    Posts
    2

    Question about servlet-mapping

    Quote Originally Posted by Arjen Poutsma View Post
    The problem is that every incoming request is now handled by the spring-ws servlet. Including requests for the common.xsd.

    So you need to change the servlet-mapping to something like:

    Code:
        <servlet-mapping>
            <servlet-name>spring-ws</servlet-name>
            <url-pattern>/services</url-pattern>
        </servlet-mapping>
    so that requests for normal files aren't handled by the servlet.


    hi arjen

    i'm facing the same problem
    if i use the following:

    Code:
        <servlet-mapping>
            <servlet-name>spring-ws</servlet-name>
            <url-pattern>/xml/*</url-pattern>
        </servlet-mapping>
    i can reach my xsd's under the base url with a browser and the wsdl under the base url + /xml/

    example:
    http://localhost:8080/gtService/Localization.xsd
    http://localhost:8080/gtService/xml/MasterData.wsdl

    the problem is that the import statement in the generated wsdl points to the same directory - gives a 405 error.

    example:
    Code:
    <import namespace="http://mycompany.com/Localization" schemaLocation="Localization.xsd"/>
    should be:
    Code:
    <import namespace="http://mycompany.com/Localization" schemaLocation="../Localization.xsd"/>
    so i can't create a client using axis or anything else.
    any help would be great.

  9. #29
    Join Date
    Jul 2005
    Location
    Rotterdam, the Netherlands
    Posts
    1,562

    Default

    Well, you can se the schemaLocation property of the wsdl builder to something like "../localization.xsd", that should work.
    Arjen Poutsma

    Spring Web Services Dev Lead
    Please read the FAQ

  10. #30
    Join Date
    Nov 2007
    Posts
    2

    Default thanx

    that should do the trick

Posting Permissions

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