wood burning stoves 2.0*
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Question about the document style message part example in Ivan's study guide Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Question about the document style message part example in Ivan Watch "Question about the document style message part example in Ivan New topic
Author

Question about the document style message part example in Ivan's study guide

Umesh Balasubramaniam
Greenhorn

Joined: May 30, 2010
Posts: 3
This study guide has been very helpful. I am reading the May 22, 2010 version of the guide and I have a question about the example on page 71.



In the above case the xsd:import statement is importing to the same namespace as the xsd:schema targetnamespace. Is this valid? I was reading on page 69 below the following example:




Note that the <schema> element containing the XML schema <import> element does not specify a
targetNamespace. This because an <import> element cannot import another XML schema into a
schema with the same namespace. Also note that the <import> element is qualified by the XML
schema namespace prefix!


Thanks in advance.
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I'll take a look at this tomorrow and get back to you. I suspect that you may have found a mistake of mine, which I am very grateful for!
Best wishes!
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
I cannot, at the moment, find the motivation to why having written what you quoted from page 69.
The best I have been able to find, so far, is a quote from the WS-I Basic Profile:

R2105 All xsd:schema elements contained in a wsdl:types element of a DESCRIPTION MUST have a targetNamespace attribute with a valid and non-null value, UNLESS the xsd:schema element has xsd:import and/or xsd:annotation as its only child element(s).

This does of course not say why the targetNamespace attribute should not be included on the <xsd:import> element.
I will continue my research.
Best wishes!
Umesh Balasubramaniam
Greenhorn

Joined: May 30, 2010
Posts: 3
Take a look at http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/structures.html#element-import. They do mention this in the "Schema Representation Constraint: Import Constraints and Semantics" section:

If the namespace [attribute] is present, then its ·actual value· must not match the ·actual value· of the enclosing <schema>'s targetNamespace [attribute]


Based purely on the schema specification you don't really need the nested xsd:schema because there is no conflict with the targetNamespace attribute in the parent schema tag:


But on page 71, either you need to remove the targetNamespace from the schema tag or the targetNamespace has to be different from the import namespace:
Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi again!
Yes, I am beginning to suspect that I wrote the example on page 71 without thinking about what I, at that time, just had written on page 69.
It does not make much sense to have a targetNamespace on the <xsd:schema> element in the <wsdl:types> element, if the only child element is a <xsd:import> element.
Thus, my conclusion is that there is an error on page 71. I will correct this in the next version of my study notes.
Thanks a lot for pointing this error out to me and for your patience awaiting my reply in this matter.
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Question about the document style message part example in Ivan's study guide