This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Web Services Certification (SCDJWS/OCEJWSD) and the fly likes Multiple questions on WSDL elements as per the specifications. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Web Services Certification (SCDJWS/OCEJWSD)
Bookmark "Multiple questions on WSDL elements as per the specifications." Watch "Multiple questions on WSDL elements as per the specifications." New topic
Author

Multiple questions on WSDL elements as per the specifications.

Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Hello All,

I just started preparing for SCDJWS and while going through WSDL 1.1 specifications, I found some examples using unqualified elements like "definitions" etc. But in the wsdl11.xsd, it is mentioned elementFormDefault="qualified". If the element form is qualified, should we not always use a QName format of element i.e (prefix:element). Is it acceptible to use unqualified elements.

Also, I have several other questions which I have listed below.

1) Under wsdl:import, Should the location attribute always results into the actual location of WSDL. i.e clicking the URL should always lead us to actual WSDL.
but in specs

4.2.4 WSDL Import location Attribute Semantics
WSDL 1.1 is unclear about whether WSDL processors must actually retrieve and process the WSDL document from the URI specified in the location attribute on the wsdl:import statements it encounters.
R2008 A CONSUMER MAY, but need not, retrieve a WSDL description from the URI specified in the location attribute on a wsdl:import element. C
The value of the location attribute of a wsdl:import element is a hint. A WSDL processor may have other ways of locating a WSDL description for a given namespace


the above statement do not mandates this it seems.

2) Also, can some body explain me, with an example if possible.

4.2.12 WSDL Extensions
Requiring support for WSDL extensions that are not explicitly specified by this or another WS-I Profile can lead to interoperability problems with development tools that have not been instrumented to understand those extensions.

R2025 A DESCRIPTION containing WSDL extensions MUST NOT use them to contradict other requirements of the Profile.

R2026 A DESCRIPTION SHOULD NOT include extension elements with a wsdl:required attribute value of "true" on any WSDL construct (wsdl:binding, wsdl:portType, wsdl:message, wsdl:types or wsdl:import) that claims conformance to the Profile.

R2027 If during the processing of a description, a consumer encounters a WSDL extension element that has a wsdl:required attribute with a boolean value of "true" that the consumer does not understand or cannot process, the CONSUMER MUST fail processing.


what are these WSDL extensions.

3) As per the specs again,

R2022 When they appear in a DESCRIPTION, wsdl:import elements MUST precede all other elements from the WSDL namespace except wsdl:documentation.


From this my understanding is, <wsdl:import> should be the immediate child if present except wsdl:documentation. So the sequence should be definition -> documentation ->import.

But in the example given wsdl , it is mentioned as



Why is import coming before documentation.

4) In Ivan A Krizsan notes and also in specifications, it is mentioned "A WSDL description must not use qualified name references to WSDL components in
namespaces that haven't been imported nor defined in the WSDL document referring to the component.". Can some one elaborate this, posibly with an example ?

Please advise.


Regards
KumarRaja

Ivan Krizsan
Ranch Hand

Joined: Oct 04, 2006
Posts: 2198
    
    1
Hi!
Kumar Raja wrote:If the element form is qualified, should we not always use a QName format of element i.e (prefix:element). Is it acceptible to use unqualified elements.

I think that if the namespace has no prefix, then there is no need to use a prefix (actually, it is not possible, since there is no prefix).


1) Under wsdl:import, Should the location attribute always results into the actual location of WSDL. i.e clicking the URL should always lead us to actual WSDL.

No, as far as I understand this need not be the case. For instance, if you are using the OASIS XML Catalog feature, then there will be a re-mapping of the URL to another one.


4.2.4 WSDL Import location Attribute Semantics
WSDL 1.1 is unclear about whether WSDL processors must actually retrieve and process the WSDL document from the URI specified in the location attribute on the wsdl:import statements it encounters.
R2008 A CONSUMER MAY, but need not, retrieve a WSDL description from the URI specified in the location attribute on a wsdl:import element. C
The value of the location attribute of a wsdl:import element is a hint. A WSDL processor may have other ways of locating a WSDL description for a given namespace

Personally, I'd say that the above is a special case. However, it gives you a hint of what the problem is in the case of, for instance, a WSDL processor caching XML schemas.


what are these WSDL extensions.

Additional information inserted into a WSDL. An example is WS-Policy information. See my study notes for an example of a WSDL with WS-Policy information inserted into it.

Why is import coming before documentation.

Don't count on the examples in the specification documents being correct. This is one of the reasons why we have the WS-I BasicProfile.
Also, the import in your example is not the <wsdl:import>, instead I suspect it is the XML schema <import> - check the namespaces in the example!


4) In Ivan A Krizsan notes and also in specifications, it is mentioned "A WSDL description must not use qualified name references to WSDL components in
namespaces that haven't been imported nor defined in the WSDL document referring to the component.".

If I in my WSDL refer to the element <test:myElement> without having specified which namespace the "test" prefix stands for, then there will be an error.
I must first import or define the element and then associate the prefix with a namespace before being able to use the element.
Hope things are more clear!


My free books and tutorials: http://www.slideshare.net/krizsan
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Thank you Ivan for your clarification.

Ivan Krizsan wrote:
Kumar Raja wrote:If the element form is qualified, should we not always use a QName format of element i.e (prefix:element). Is it acceptible to use unqualified elements.

I think that if the namespace has no prefix, then there is no need to use a prefix (actually, it is not possible, since there is no prefix).


For the above statement, please clarify if elementForm is declared as "qualified" in the schema, then my assumption is that elements should always be qualified and for that a prefix becomes a mandatory. I remember reading some where, if the elements are not qualified for elementForm="qualified", then the xml instance is not a valid one. Is this a true statement? Just because the elementForm needs to be qualified, is that a mandatory to have prefix used.

Thanks
Kumar
Christian Nicoll
Ranch Hand

Joined: Mar 09, 2008
Posts: 106
Hi!

as Ivan wrote, you don't have to use for each element an prefix. What makes an xml element namespace-qualified? You need a namespace and the local element name. To use a namespace you can use an prefix or you define a default-namespace (xmlns).

I think it will be helpfully if you check http://www.w3schools.com/schema/schema_schema.asp

Best regards,
Christian


SCJP 5, SCJD 5, SCWCD 5, SCBCD 5, SCJDWS 5
My SCBCD-Notes - My Hello World Webservice
Kumar Raja
Ranch Hand

Joined: Mar 18, 2010
Posts: 518
    
    2

Thanks Christian.
 
wood burning stoves
 
subject: Multiple questions on WSDL elements as per the specifications.