You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Dennis Sosnoski <dm...@sosnoski.com> on 2006/03/27 04:59:01 UTC

[Axis2] Schema with no targetNamespace rejected

The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was to 
add a check that the schema definition within a WSDL defines a 
targetNamespace. What is the justification for this? AFAIK it's 
perfectly valid to have a nonamespace schema in a WSDL, even though it's 
recommended that you use namespaces. If XMLBeans requires a 
targetNamespace (what appears to be the original justification given in 
the problem report), then the XMLBeans code generation extension should 
perform this check and throw an error.

Can someone supply a justification of this decision?

  - Dennis

-- 
Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-03-28 at 21:05 -0500, Anne Thomas Manes wrote:
> I recently responded to a question from someone using the OTA schema
> which does not declare a targetNamespace (bad form on their part, but
> such is the case).

Do you recall how they refer to those things from WSDL? (Ref would be
great; esp. so that then I can order a Predator to take out the guy who
wrote that crappy WSDL.)

Sanjiva.



Re: [Axis2] Schema with no targetNamespace rejected

Posted by Anne Thomas Manes <at...@gmail.com>.
I recently responded to a question from someone using the OTA schema which
does not declare a targetNamespace (bad form on their part, but such is the
case).

Anne

On 3/28/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
> Sanjiva Weerawarana wrote:
>
> >On Tue, 2006-03-28 at 19:33 +1200, Dennis Sosnoski wrote:
> >
> >
> >>>+1, which leads me to a quick comment.  Currently, the error reporting
> >>>in Axis2 is... less than adequate, to say the least.  We're building a
> >>>toolkit/engine which is supposed to make it easy for developers to
> >>>expose and consume arbitrary Web Services in a variety of ways.  And
> >>>because there are so many moving parts and extensions, it is EXTRA
> >>>important for us to provide detailed and useful information when
> >>>things go wrong.  We can discuss this more on another thread, but I
> >>>think this needs some serious attention if we want good uptake.
> >>>
> >>>
> >>Are you willing to go along on this, Sanjiva? If so, I'll change the
> >>code to print a warning message to the console when a schema with no
> >>targetNamespace is used.
> >>
> >>
> >
> >It doesn't work for direct reference from WSDL even for WSDL 1.1
> >original: part/@type and part/@element both require QNames. The only use
> >is for a schema defining one of those to refer to stuff in a schema with
> >no namespace.
> >
> >
> Does WSDL 1.1 define QNames somewhere to require prefixes? This
> certainly isn't standard usage of the schema QName type. Schema
> considers QNames with no prefix to be using the default namespace for
> the context.
>
> >Do you know of *any* usecases of this? Can you point me to the WSDL? I'd
> >like to understand it a bit before saying just print a warning.
> >
> >
> I did a quick search earlier in this thread to see if I could find any
> discussion of the topic for .NET or other frameworks, but didn't find
> anything. But I don't see any justification for considering it an error,
> either.
>
>   - Dennis
>

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Anne Thomas Manes <at...@gmail.com>.
Here's the email thread:
http://marc.theaimsgroup.com/?l=axis-user&m=114348410608730&w=2

And here's the standard OTA schema which has no targetNamespace:
http://www.opentravel.org/2005B/OTA_SimpleTypes.xsd

(You'd think a standards group would have the sense to define a namespace!)

Anne

On 3/29/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
> Sanjiva Weerawarana wrote:
>
> >On Wed, 2006-03-29 at 09:01 +1200, Dennis Sosnoski wrote:
> >
> >
> >
> >>Does WSDL 1.1 define QNames somewhere to require prefixes? This
> >>certainly isn't standard usage of the schema QName type. Schema
> >>considers QNames with no prefix to be using the default namespace for
> >>the context.
> >>
> >>
> >
> >No, WSDL doesn't define that IIRC. However, when it uses the default
> >namespace then its still a qualified name. So if the schema is
> >targetnamespace-less then it still can't be referred to.
> >
> >Am I missing something?
> >
> >
> As long as there's no default namespace declared in the WSDL unqualified
> values are in the nonamespace namespace, the same as schema definitions
> with no targetNamespace. So references from the WSDL into the schema
> definitions are not a problem.
>
>   - Dennis
>

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Sanjiva Weerawarana wrote:

>On Wed, 2006-03-29 at 09:01 +1200, Dennis Sosnoski wrote:
>
>  
>
>>Does WSDL 1.1 define QNames somewhere to require prefixes? This 
>>certainly isn't standard usage of the schema QName type. Schema 
>>considers QNames with no prefix to be using the default namespace for 
>>the context.
>>    
>>
>
>No, WSDL doesn't define that IIRC. However, when it uses the default
>namespace then its still a qualified name. So if the schema is
>targetnamespace-less then it still can't be referred to. 
>
>Am I missing something?
>  
>
As long as there's no default namespace declared in the WSDL unqualified 
values are in the nonamespace namespace, the same as schema definitions 
with no targetNamespace. So references from the WSDL into the schema 
definitions are not a problem.

  - Dennis

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Wed, 2006-03-29 at 09:01 +1200, Dennis Sosnoski wrote:

> Does WSDL 1.1 define QNames somewhere to require prefixes? This 
> certainly isn't standard usage of the schema QName type. Schema 
> considers QNames with no prefix to be using the default namespace for 
> the context.

No, WSDL doesn't define that IIRC. However, when it uses the default
namespace then its still a qualified name. So if the schema is
targetnamespace-less then it still can't be referred to. 

Am I missing something?

> I did a quick search earlier in this thread to see if I could find any 
> discussion of the topic for .NET or other frameworks, but didn't find 
> anything. But I don't see any justification for considering it an error, 
> either.

So neither of the cases have irrefutable proof it seems :-).

Sanjiva.


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Sanjiva Weerawarana wrote:

>On Tue, 2006-03-28 at 19:33 +1200, Dennis Sosnoski wrote:
>  
>
>>>+1, which leads me to a quick comment.  Currently, the error reporting 
>>>in Axis2 is... less than adequate, to say the least.  We're building a 
>>>toolkit/engine which is supposed to make it easy for developers to 
>>>expose and consume arbitrary Web Services in a variety of ways.  And 
>>>because there are so many moving parts and extensions, it is EXTRA 
>>>important for us to provide detailed and useful information when 
>>>things go wrong.  We can discuss this more on another thread, but I 
>>>think this needs some serious attention if we want good uptake.
>>>      
>>>
>>Are you willing to go along on this, Sanjiva? If so, I'll change the 
>>code to print a warning message to the console when a schema with no 
>>targetNamespace is used.
>>    
>>
>
>It doesn't work for direct reference from WSDL even for WSDL 1.1
>original: part/@type and part/@element both require QNames. The only use
>is for a schema defining one of those to refer to stuff in a schema with
>no namespace. 
>  
>
Does WSDL 1.1 define QNames somewhere to require prefixes? This 
certainly isn't standard usage of the schema QName type. Schema 
considers QNames with no prefix to be using the default namespace for 
the context.

>Do you know of *any* usecases of this? Can you point me to the WSDL? I'd
>like to understand it a bit before saying just print a warning. 
>  
>
I did a quick search earlier in this thread to see if I could find any 
discussion of the topic for .NET or other frameworks, but didn't find 
anything. But I don't see any justification for considering it an error, 
either.

  - Dennis

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Tue, 2006-03-28 at 19:33 +1200, Dennis Sosnoski wrote:
> > +1, which leads me to a quick comment.  Currently, the error reporting 
> > in Axis2 is... less than adequate, to say the least.  We're building a 
> > toolkit/engine which is supposed to make it easy for developers to 
> > expose and consume arbitrary Web Services in a variety of ways.  And 
> > because there are so many moving parts and extensions, it is EXTRA 
> > important for us to provide detailed and useful information when 
> > things go wrong.  We can discuss this more on another thread, but I 
> > think this needs some serious attention if we want good uptake.
> 
> Are you willing to go along on this, Sanjiva? If so, I'll change the 
> code to print a warning message to the console when a schema with no 
> targetNamespace is used.

It doesn't work for direct reference from WSDL even for WSDL 1.1
original: part/@type and part/@element both require QNames. The only use
is for a schema defining one of those to refer to stuff in a schema with
no namespace. 

Do you know of *any* usecases of this? Can you point me to the WSDL? I'd
like to understand it a bit before saying just print a warning. 

> > -1
> >
> > It's great if there's an option to switch BP-compliance-checking on. 
> > It's not great if there's no way to turn it off.  There are plenty of 
> > people out there who want to be able to use their RPC/encoded 
> > services, please don't force them to choose another toolkit.

Fine Glen .. but someone has to write RPC/Enc support. I have no
interest in it (esp. in its full glory; as we've discussed previously
the 80% case overlaps with RPC/lit) but if you want to write it that's
fine.

> I like the BP-compliance-checking switch idea. This would be a lot of 
> work to implement properly (basically requiring that code be added to 
> check each recommendation), but would be a major help to users 
> struggling with interoperability. But it'd be most useful for checking 
> that the actual runtime service is BP-compliant; checking a WSDL they've 
> gotten from some other source is probably something that's best done by 
> a separate tool

+1; the runtime should not be doing compliance .. if that's really
desired then one can drop a Synapse mediator that does verification.

Sanjiva.


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Glen Daniels wrote:

>>>
>>>
>>> The better solution is to throw a warning if the targetNamespace isn't
>>> there --let XMLBeans throw the error.
>>
>
> +1, which leads me to a quick comment.  Currently, the error reporting 
> in Axis2 is... less than adequate, to say the least.  We're building a 
> toolkit/engine which is supposed to make it easy for developers to 
> expose and consume arbitrary Web Services in a variety of ways.  And 
> because there are so many moving parts and extensions, it is EXTRA 
> important for us to provide detailed and useful information when 
> things go wrong.  We can discuss this more on another thread, but I 
> think this needs some serious attention if we want good uptake.

Are you willing to go along on this, Sanjiva? If so, I'll change the 
code to print a warning message to the console when a schema with no 
targetNamespace is used.

>
>> I'd like to move Axis2 to being a system that assumes/requires BP.
>> That's partly the rationale for not supporting SOAP Encoding etc.. 
>
>
> -1
>
> It's great if there's an option to switch BP-compliance-checking on. 
> It's not great if there's no way to turn it off.  There are plenty of 
> people out there who want to be able to use their RPC/encoded 
> services, please don't force them to choose another toolkit.

I like the BP-compliance-checking switch idea. This would be a lot of 
work to implement properly (basically requiring that code be added to 
check each recommendation), but would be a major help to users 
struggling with interoperability. But it'd be most useful for checking 
that the actual runtime service is BP-compliant; checking a WSDL they've 
gotten from some other source is probably something that's best done by 
a separate tool

  - Dennis

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Glen Daniels <gl...@thoughtcraft.com>.
Hey folks:

Sanjiva Weerawarana wrote:
> On Mon, 2006-03-27 at 09:19 -0500, Anne Thomas Manes wrote:
> 
>>I agree with Dennis on this. 

And I agree with Anne agreeing with Dennis. :)

>>WSDL 1.1 doesn't *require* that a schema have a targetNamespace. The
>>BP does, but that's a best practice, not a spec requirement. WSDL 2.0
>>requires that schemas have a targetNamespace, but that doesn't change
>>WSDL 1.1.
>>
>>The better solution is to throw a warning if the targetNamespace isn't
>>there --let XMLBeans throw the error.

+1, which leads me to a quick comment.  Currently, the error reporting 
in Axis2 is... less than adequate, to say the least.  We're building a 
toolkit/engine which is supposed to make it easy for developers to 
expose and consume arbitrary Web Services in a variety of ways.  And 
because there are so many moving parts and extensions, it is EXTRA 
important for us to provide detailed and useful information when things 
go wrong.  We can discuss this more on another thread, but I think this 
needs some serious attention if we want good uptake.

> I'd like to move Axis2 to being a system that assumes/requires BP.
> That's partly the rationale for not supporting SOAP Encoding etc.. 

-1

It's great if there's an option to switch BP-compliance-checking on. 
It's not great if there's no way to turn it off.  There are plenty of 
people out there who want to be able to use their RPC/encoded services, 
please don't force them to choose another toolkit.

> I know we don't yet enforce all of BP but IMO we should, over time.

See above.

Thanks,
--Glen

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Mon, 2006-03-27 at 09:19 -0500, Anne Thomas Manes wrote:
> I agree with Dennis on this. 
> 
> WSDL 1.1 doesn't *require* that a schema have a targetNamespace. The
> BP does, but that's a best practice, not a spec requirement. WSDL 2.0
> requires that schemas have a targetNamespace, but that doesn't change
> WSDL 1.1.
> 
> The better solution is to throw a warning if the targetNamespace isn't
> there --let XMLBeans throw the error.

I'd like to move Axis2 to being a system that assumes/requires BP.
That's partly the rationale for not supporting SOAP Encoding etc.. 

I know we don't yet enforce all of BP but IMO we should, over time.

Sanjiva.


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Anne Thomas Manes <at...@gmail.com>.
I agree with Dennis on this.

WSDL 1.1 doesn't *require* that a schema have a targetNamespace. The BP
does, but that's a best practice, not a spec requirement. WSDL 2.0 requires
that schemas have a targetNamespace, but that doesn't change WSDL 1.1.

The better solution is to throw a warning if the targetNamespace isn't there
--let XMLBeans throw the error.

Anne

On 3/27/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>
> That just BP - which everybody likes, but AFAIK Axis2 is not enforcing.
>
>   - Dennis
>
> Davanum Srinivas wrote:
>
> >Sanjiva,
> >
> >Is it this one?
> >
> >
> http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16552904
> >
> >-- dims
> >
> >On 3/26/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> >
> >
> >>Sanjiva Weerawarana wrote:
> >>
> >>
> >>
> >>>On Mon, 2006-03-27 at 14:59 +1200, Dennis Sosnoski wrote:
> >>>
> >>>
> >>>
> >>>
> >>>>The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was
> >>>>to
> >>>>add a check that the schema definition within a WSDL defines a
> >>>>targetNamespace. What is the justification for this? AFAIK it's
> >>>>
> >>>>
> >>>>
> >>>>
> >>>The justification is that its required by WSDL. WSDL 1.1 wasn't clear
> >>>but it has since been clarified.
> >>>
> >>>
> >>>
> >>>
> >>So the requirement was added after WSDL 1.1 - is it spelled out
> >>somewhere, or just an informal interpretation? I'm happy enough to
> >>accept it either way, as long as other frameworks such as .NET require
> >>schema namespaces, but it'd be nice to have something to point to by way
> >>of justification.
> >>
> >>The current code throws an NPE if a schema doesn't have a
> >>targetNamespace rather than reporting anything useful - that's what led
> >>me into this. I'll fix that.
> >>
> >>  - Dennis
> >>
> >>
> >>
> >>
> >
> >
> >--
> >Davanum Srinivas : http://wso2.com/blogs/
> >
> >
> >
>

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
That just BP - which everybody likes, but AFAIK Axis2 is not enforcing.

  - Dennis

Davanum Srinivas wrote:

>Sanjiva,
>
>Is it this one?
>
>http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16552904
>
>-- dims
>
>On 3/26/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
>  
>
>>Sanjiva Weerawarana wrote:
>>
>>    
>>
>>>On Mon, 2006-03-27 at 14:59 +1200, Dennis Sosnoski wrote:
>>>
>>>
>>>      
>>>
>>>>The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was
>>>>to
>>>>add a check that the schema definition within a WSDL defines a
>>>>targetNamespace. What is the justification for this? AFAIK it's
>>>>
>>>>
>>>>        
>>>>
>>>The justification is that its required by WSDL. WSDL 1.1 wasn't clear
>>>but it has since been clarified.
>>>
>>>
>>>      
>>>
>>So the requirement was added after WSDL 1.1 - is it spelled out
>>somewhere, or just an informal interpretation? I'm happy enough to
>>accept it either way, as long as other frameworks such as .NET require
>>schema namespaces, but it'd be nice to have something to point to by way
>>of justification.
>>
>>The current code throws an NPE if a schema doesn't have a
>>targetNamespace rather than reporting anything useful - that's what led
>>me into this. I'll fix that.
>>
>>  - Dennis
>>
>>
>>    
>>
>
>
>--
>Davanum Srinivas : http://wso2.com/blogs/
>
>  
>

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Davanum Srinivas <da...@gmail.com>.
Sanjiva,

Is it this one?

http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16552904

-- dims

On 3/26/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> Sanjiva Weerawarana wrote:
>
> >On Mon, 2006-03-27 at 14:59 +1200, Dennis Sosnoski wrote:
> >
> >
> >>The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was
> >>to
> >>add a check that the schema definition within a WSDL defines a
> >>targetNamespace. What is the justification for this? AFAIK it's
> >>
> >>
> >
> >The justification is that its required by WSDL. WSDL 1.1 wasn't clear
> >but it has since been clarified.
> >
> >
> So the requirement was added after WSDL 1.1 - is it spelled out
> somewhere, or just an informal interpretation? I'm happy enough to
> accept it either way, as long as other frameworks such as .NET require
> schema namespaces, but it'd be nice to have something to point to by way
> of justification.
>
> The current code throws an NPE if a schema doesn't have a
> targetNamespace rather than reporting anything useful - that's what led
> me into this. I'll fix that.
>
>   - Dennis
>
>


--
Davanum Srinivas : http://wso2.com/blogs/

Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Mon, 2006-03-27 at 16:54 +1200, Dennis Sosnoski wrote:
> >The justification is that its required by WSDL. WSDL 1.1 wasn't clear
> >but it has since been clarified.
> >  
> >
> So the requirement was added after WSDL 1.1 - is it spelled out 
> somewhere, or just an informal interpretation? I'm happy enough to 
> accept it either way, as long as other frameworks such as .NET require 
> schema namespaces, but it'd be nice to have something to point to by way 
> of justification.

WS-I Basic Profile:
http://www.ws-i.org/Profiles/BasicProfile-1.0-2004-04-16.html#refinement16552904

Also in WSDL 2.0. (Can find the ref if u want.)

> The current code throws an NPE if a schema doesn't have a 
> targetNamespace rather than reporting anything useful - that's what led 
> me into this. I'll fix that.

+1.

Sanjiva.


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Dennis Sosnoski <dm...@sosnoski.com>.
Sanjiva Weerawarana wrote:

>On Mon, 2006-03-27 at 14:59 +1200, Dennis Sosnoski wrote:
>  
>
>>The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was
>>to 
>>add a check that the schema definition within a WSDL defines a 
>>targetNamespace. What is the justification for this? AFAIK it's 
>>    
>>
>
>The justification is that its required by WSDL. WSDL 1.1 wasn't clear
>but it has since been clarified.
>  
>
So the requirement was added after WSDL 1.1 - is it spelled out 
somewhere, or just an informal interpretation? I'm happy enough to 
accept it either way, as long as other frameworks such as .NET require 
schema namespaces, but it'd be nice to have something to point to by way 
of justification.

The current code throws an NPE if a schema doesn't have a 
targetNamespace rather than reporting anything useful - that's what led 
me into this. I'll fix that.

  - Dennis


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Sanjiva Weerawarana <sa...@opensource.lk>.
On Mon, 2006-03-27 at 14:59 +1200, Dennis Sosnoski wrote:
> 
> The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was
> to 
> add a check that the schema definition within a WSDL defines a 
> targetNamespace. What is the justification for this? AFAIK it's 

The justification is that its required by WSDL. WSDL 1.1 wasn't clear
but it has since been clarified.

Sanjiva.


Re: [Axis2] Schema with no targetNamespace rejected

Posted by Davanum Srinivas <da...@gmail.com>.
Anne's email:
http://marc.theaimsgroup.com/?l=axis-dev&m=112065868107209&w=2

The whole discussion:
http://marc.theaimsgroup.com/?t=112059418300004&r=1&w=2

thanks,
dims

On 3/26/06, Dennis Sosnoski <dm...@sosnoski.com> wrote:
> The resolution of http://issues.apache.org/jira/browse/AXIS2-67 was to
> add a check that the schema definition within a WSDL defines a
> targetNamespace. What is the justification for this? AFAIK it's
> perfectly valid to have a nonamespace schema in a WSDL, even though it's
> recommended that you use namespaces. If XMLBeans requires a
> targetNamespace (what appears to be the original justification given in
> the problem report), then the XMLBeans code generation extension should
> perform this check and throw an error.
>
> Can someone supply a justification of this decision?
>
>   - Dennis
>
> --
> Dennis M. Sosnoski
> SOA, Web Services, and XML
> Training and Consulting
> http://www.sosnoski.com - http://www.sosnoski.co.nz
> Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117
>
>


--
Davanum Srinivas : http://wso2.com/blogs/