Announcement Announcement Module
Collapse
No announcement yet.
Handling multiple xsd's in wsdl Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • #16
    Thats right Ray.

    Comment


    • #17
      I'd double check the URL you're putting in SoapUI.

      Comment


      • #18
        What happens if you attempt to get common.xsd via the browser (same url, just replace the wsdl filename with common.xsd)? SOAP UI will try and retrieve that as well.

        Comment


        • #19
          You might need to change your servlet mapping, so that the common XSD URL is not handled by the servlet, but the common.xsd is returned. Common.xsd is in the web-app root, isn't it?

          Comment


          • #20
            followIncludeImport

            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?

            Thanks
            Eugene

            Comment


            • #21
              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

              Comment


              • #22
                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.

                Comment


                • #23
                  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.

                  Comment


                  • #24
                    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

                    Comment


                    • #25
                      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

                      Comment


                      • #26
                        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.

                        Comment


                        • #27
                          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

                          Comment


                          • #28
                            about servlet-mapping

                            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.

                            Comment


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

                              Comment


                              • #30
                                thanx

                                that should do the trick

                                Comment

                                Working...
                                X