Loading ...
Sorry, an error occurred while loading the content.

Inlined Schemas in WSDLs Question

Expand Messages
  • jeehongmin2003
    Recently, I have been seeing multiple inlined schemas with the same namespace in our customers WSDLs. For example (ignoring namespaces):
    Message 1 of 6 , Sep 22, 2004
    • 0 Attachment
      Recently, I have been seeing multiple inlined schemas with the same
      namespace in our customers' WSDLs. For example (ignoring namespaces):

      <wsdl:definition>
      <wsdl:types>
      <xs:schema targetNamespace="a">
      types and elements
      </xs:schema>
      <xs:schema targetNamespace="a">
      different types and elements
      </xs:schema>
      <xs:schema targetNamespace="b">
      whatever
      </xs:schema>
      </wsdl:types>
      ...
      <wsdl:definition>

      My understanding is that each inlined schema should have a unique
      namespace. So what I've done is merge the two schemas with
      targetNamespace="a".

      Am I correct in concluding that the above WSDL is incorrect? If so,
      why are various WSDL generators allowing that?

      Thanks,

      Jeehong Min
    • boruvek
      Hi! In my opinion this kind of WSDL is perfectly legal. But it is uncommon and it is not good practice. Look into WSDL 1.1 specification and/or WS-I Basic
      Message 2 of 6 , Oct 11, 2004
      • 0 Attachment
        Hi!

        In my opinion this kind of WSDL is perfectly legal. But it is
        uncommon and it is not good practice.

        Look into WSDL 1.1 specification and/or WS-I Basic Profile 1.1. They
        do not prevent you from doing that.

        Merging of that two schemas could be solution. Problem arise when e.g
        one schema different elementFromDefault to the second one... But I
        hope this is only a theory ;)

        Milan Boruvka

        --- In soapbuilders@yahoogroups.com, "jeehongmin2003"
        <jeehongmin2003@y...> wrote:
        > Recently, I have been seeing multiple inlined schemas with the same
        > namespace in our customers' WSDLs. For example (ignoring
        namespaces):
        >
        > <wsdl:definition>
        > <wsdl:types>
        > <xs:schema targetNamespace="a">
        > types and elements
        > </xs:schema>
        > <xs:schema targetNamespace="a">
        > different types and elements
        > </xs:schema>
        > <xs:schema targetNamespace="b">
        > whatever
        > </xs:schema>
        > </wsdl:types>
        > ...
        > <wsdl:definition>
        >
        > My understanding is that each inlined schema should have a unique
        > namespace. So what I've done is merge the two schemas with
        > targetNamespace="a".
        >
        > Am I correct in concluding that the above WSDL is incorrect? If so,
        > why are various WSDL generators allowing that?
        >
        > Thanks,
        >
        > Jeehong Min
      • Pete Hendry
        This issue is being discussed on the WS-I list and has been raised on the WSDL 2.0 working group list. My take on it is that it is that the WSDL document may
        Message 3 of 6 , Oct 11, 2004
        • 0 Attachment
          This issue is being discussed on the WS-I list and has been raised on the WSDL 2.0 working group list.

          My take on it is that it is that the WSDL document may be valid (i.e. it will not produce a validation failure), but the behaviour of schema parsers may differ. The schema specification does not deal with this kind of situation because the specification is not written for embedded schemas within another type of document (such as wsdl). This is an embedding issue I believe.

          Consider a scenario where the schemas are not embedded. Imagine I have 2 files a1.xsd and a2.xsd in a directory on disk. If I want to load them I can ask a parser to load one and have that one contain an include to the other. If I tell a parser to load one (using schemaLocation) would I expect it to also load the other if the one it was told to load did not contain an include? No, I don't think so.

          Also, looking at the specification, a parser is free to locate a schema document in any way it chooses, with the schemaLocation being only a hint. When a parser is asked to load a schema with namespace="a" it can locate this schema on disk, by resolving the namespace as a URL, by reading it from the current WSDL file, from a cache, or any other way. Once it finds and loads the document it is done. Why would it then continue this search and try to find another document with this namespace that is not referenced from the first? It wouldn't.

          Merging the schemas is an option but it is fraught with danger. What happens if 2 components are identical (including their name)? Should this be an error or should the second be ignored because it is the same as the first? Attributes on the xsd:schema element are also a problem if they don't match.

          Finally, what possible reason is there for doing this? Why not just have one schema with all the components? Some people just seem to make life difficult for no good reason!

          We are not supporting this currently and I would not like to see it become commonplace.

          Can you tell us which vendor is producing such WSDL?

          Pete


          boruvek wrote:
          Hi!
          
          In my opinion this kind of WSDL is perfectly legal. But it is 
          uncommon and it is not good practice. 
          
          Look into WSDL 1.1 specification and/or WS-I Basic Profile 1.1. They 
          do not prevent you from doing that. 
          
          Merging of that two schemas could be solution. Problem arise when e.g 
          one schema different elementFromDefault to the second one... But I 
          hope this is only a theory ;)
          
          Milan Boruvka
          
          --- In soapbuilders@yahoogroups.com, "jeehongmin2003" 
          <jeehongmin2003@y...> wrote:
            
          Recently, I have been seeing multiple inlined schemas with the same
          namespace in our customers' WSDLs.  For example (ignoring 
              
          namespaces):
            
          <wsdl:definition>
          <wsdl:types>
          <xs:schema targetNamespace="a">
          types and elements
          </xs:schema>
          <xs:schema targetNamespace="a">
          different types and elements
          </xs:schema>
          <xs:schema targetNamespace="b">
          whatever
          </xs:schema>
          </wsdl:types>
          ...
          <wsdl:definition>
          
          My understanding is that each inlined schema should have a unique
          namespace.  So what I've done is merge the two schemas with
          targetNamespace="a".  
          
          Am I correct in concluding that the above WSDL is incorrect?  If so,
          why are various WSDL generators allowing that?
          
          Thanks,
          
          Jeehong Min
              
          
          
          
          
          ------------------------ Yahoo! Groups Sponsor --------------------~--> 
          $9.95 domain names from Yahoo!. Register anything.
          http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/W6uqlB/TM
          --------------------------------------------------------------------~-> 
          
          -----------------------------------------------------------------
          This group is a forum for builders of SOAP implementations to discuss implementation and interoperability issues.  Please stay on-topic. 
          Yahoo! Groups Links
          
          <*> To visit your group on the web, go to:
              http://groups.yahoo.com/group/soapbuilders/
          
          <*> To unsubscribe from this group, send an email to:
              soapbuilders-unsubscribe@yahoogroups.com
          
          <*> Your use of Yahoo! Groups is subject to:
              http://docs.yahoo.com/info/terms/
           
          
          
          
            
        • Milan Boruvka
          ... I must say I have seen only *one* such WSDL. And it was written manually , not generated... I hope there is not tool generator producing this kind of
          Message 4 of 6 , Oct 12, 2004
          • 0 Attachment
            --- In soapbuilders@yahoogroups.com, Pete Hendry <peter.hendry@c...>
            wrote:
            >

            I must say I have seen only *one* such WSDL. And it was
            written 'manually', not generated...

            I hope there is not tool generator producing this kind of WSDLs..

            Milan Boruvka
            milan.boruvka@...
          • noah_mendelsohn@us.ibm.com
            ... the specification is not written for embedded schemas within another type of document (such as wsdl). Actually, that s not true. The schema recommendation
            Message 5 of 6 , Oct 12, 2004
            • 0 Attachment
              Pete Hendry writes:

              >> The schema specification does not deal with this kind of situation because
              the specification is not written for embedded schemas within another type
              of document (such as wsdl).

              Actually, that's not true. The schema recommendation specifically says
              [1]:

              "Note: there will often be times when a schema document will be a complete
              XML 1.0 document whose document element is <schema>. There will be other
              occasions in which <schema> items will be contained in other documents,
              perhaps referenced using fragment and/or XPointer notation."

              Though it's not the most clearly written part of the schema
              recommendation, the fact is that processors are given great lattitude to
              find schema documents and other sources of schema declarations and
              definitions. This was done in part because we knew that systems like WSDL
              would arise with a need to carry <schema> elements and other forms of
              schema specifications in ways that we could not anticipate in detail.

              What is true is that the schema recommendation leaves it to the
              specification of languages like WSDL to set out exactly how schema
              documents or <schema> elements are to be brought together for a particular
              schema validation episode. I haven't ready WSDL 1.1 lately; WSDL 1.2
              seems to do a moderately careful job of setting out its rules, though I
              haven't rechecked the specific constructions proposed in this thread.

              In any case, XML schema allows lattitude exactly so that systems like WSDL
              will have the option to allow or disallow the constructions being debated
              here. Thank you.

              Noah

              [1] http://www.w3.org/TR/2004/PER-xmlschema-1-20040318/#schema-repr
              --------------------------------------
              Noah Mendelsohn
              IBM Corporation
              One Rogers Street
              Cambridge, MA 02142
              1-617-693-4036
              --------------------------------------
            • Jeehong Min
              I do not want to draw attention to the vendor, but I can say that it is a major Web App Server vendor whose server is generating such WSDLs. I have now seen 2
              Message 6 of 6 , Oct 18, 2004
              • 0 Attachment
                I do not want to draw attention to the vendor, but I
                can say that it is a major Web App Server vendor whose
                server is generating such WSDLs. I have now seen 2
                such WSDLs from our customers and expect to see even
                more.

                I have been monitoring the activity at WS-I and WSDL
                working group, but it does not appear that a final
                decision is imminent regarding this issue.

                - Jeehong Min

                --- Milan Boruvka <boruvka@...> wrote:

                >
                > --- In soapbuilders@yahoogroups.com, Pete Hendry
                > <peter.hendry@c...>
                > wrote:
                > >
                >
                > I must say I have seen only *one* such WSDL. And it
                > was
                > written 'manually', not generated...
                >
                > I hope there is not tool generator producing this
                > kind of WSDLs..
                >
                > Milan Boruvka
                > milan.boruvka@...
                >
                >
                >
                >




                __________________________________
                Do you Yahoo!?
                Yahoo! Mail Address AutoComplete - You start. We finish.
                http://promotions.yahoo.com/new_mail
              Your message has been successfully submitted and would be delivered to recipients shortly.