You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Glen Mazza <gl...@gmail.com> on 2010/07/14 19:56:55 UTC

Metro vs. CXF difference in enumerating schemas within a WSDL

Team, I recently noticed a problem perhaps related to Tom's[1] regarding the
schemaLocation value in a JAXB binding file[2].  CXF enumerates schemas
using Schema Component Descriptors (SCD's) within a WSDL differently from
Metro, resulting in JAXB binding files being incompatible between the two:

mybindingfile.xjb:
   <!--CXF -->
   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
node="/xs:schema"> 
   <!--Metro -->
   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
node="/xs:schema">

Where 1,2,3 in both cases refers to the 1-based count of the xsd:schema
within the single wsdl:type.    The XJC compiler during the wsdl2java
generation process will reject the former for Metro and the latter for CXF.

I'd like this to be standardized so the binding files would be portable
between the two frameworks but I'm not sure which framework is correct. The
CXF method of incrementing the number next to the types seems inaccurate
because there can be only one wsdl:types.  On the other hand, Metro's usage
of the ? as a delimiter does not appear to be defined in the SCD candidate
recommendation (http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax).  

Granted, the CXF dev list might not be the most unbiased of forums, but any
idea which team is "wrong"?

Thanks,
Glen

[1]
http://cxf.547215.n5.nabble.com/Invalid-WSDL-with-a-Jax-ws-schemaLocation-XSD-specified-td1046395.html#a1046395
[2]
http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts#BindingFile
[3] http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax
-- 
View this message in context: http://cxf.547215.n5.nabble.com/Metro-vs-CXF-difference-in-enumerating-schemas-within-a-WSDL-tp1092957p1092957.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Glen Mazza <gl...@gmail.com>.
But are the JAXB binding files that are passed into a wsdl2java tool part of
the TCK?


jgenender wrote:
> 
> The one that doesn't pass the TCK? ;-)
> 
> Jeff
> 

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Metro-vs-CXF-difference-in-enumerating-schemas-within-a-WSDL-tp1092957p1092977.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Jeff Genender <jg...@apache.org>.
The one that doesn't pass the TCK? ;-)

Jeff



On Jul 14, 2010, at 11:56 AM, Glen Mazza wrote:

> 
> Team, I recently noticed a problem perhaps related to Tom's[1] regarding the
> schemaLocation value in a JAXB binding file[2].  CXF enumerates schemas
> using Schema Component Descriptors (SCD's) within a WSDL differently from
> Metro, resulting in JAXB binding files being incompatible between the two:
> 
> mybindingfile.xjb:
>   <!--CXF -->
>   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
> node="/xs:schema"> 
>   <!--Metro -->
>   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
> node="/xs:schema">
> 
> Where 1,2,3 in both cases refers to the 1-based count of the xsd:schema
> within the single wsdl:type.    The XJC compiler during the wsdl2java
> generation process will reject the former for Metro and the latter for CXF.
> 
> I'd like this to be standardized so the binding files would be portable
> between the two frameworks but I'm not sure which framework is correct. The
> CXF method of incrementing the number next to the types seems inaccurate
> because there can be only one wsdl:types.  On the other hand, Metro's usage
> of the ? as a delimiter does not appear to be defined in the SCD candidate
> recommendation (http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax).  
> 
> Granted, the CXF dev list might not be the most unbiased of forums, but any
> idea which team is "wrong"?
> 
> Thanks,
> Glen
> 
> [1]
> http://cxf.547215.n5.nabble.com/Invalid-WSDL-with-a-Jax-ws-schemaLocation-XSD-specified-td1046395.html#a1046395
> [2]
> http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts#BindingFile
> [3] http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax
> -- 
> View this message in context: http://cxf.547215.n5.nabble.com/Metro-vs-CXF-difference-in-enumerating-schemas-within-a-WSDL-tp1092957p1092957.html
> Sent from the cxf-dev mailing list archive at Nabble.com.


Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Daniel Kulp <dk...@apache.org>.

No, this is something controlled by the framework.   For us, its:

rt/core/src/main/java/org/apache/cxf/wsdl11/SchemaUtil.java

line 126.    When we feed the schemas into JAXB, we have to have unique 
SystemID's assigned to them so the schemaLocations can match up.   We chose 
one way, they apparently chose a different way.   :-(


Dan



On Wednesday 14 July 2010 9:18:55 pm Glen Mazza wrote:
> Umm, I think there's a solution here:
> 
> mybindingfile.xjb:
>    <!--CXF -->
>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
> node="/xs:schema">
>    <!--Metro -->
>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
> node="/xs:schema">
> 
> May I say that in all likelihood, the problem is that the XJC version used
> by CXF's codegen plugin and the XJC version used by Metro's Maven plugin is
> just different, and they interpret the schemaLocations in the JAXB binding
> file differently?  Stated another way, CXF has *nothing* to do with the
> parsing or syntax of the schemaLocation values in the JAXB binding file--it
> just feeds the file to XJC for the latter to either accept or complain
> based on the particular XJC version's syntax?
> 
> Glen

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog

Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Glen Mazza <gl...@gmail.com>.
Umm, I think there's a solution here:

mybindingfile.xjb:
   <!--CXF -->
   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
node="/xs:schema">
   <!--Metro -->
   <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
node="/xs:schema"> 

May I say that in all likelihood, the problem is that the XJC version used
by CXF's codegen plugin and the XJC version used by Metro's Maven plugin is
just different, and they interpret the schemaLocations in the JAXB binding
file differently?  Stated another way, CXF has *nothing* to do with the
parsing or syntax of the schemaLocation values in the JAXB binding file--it
just feeds the file to XJC for the latter to either accept or complain based
on the particular XJC version's syntax?  

Glen

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Metro-vs-CXF-difference-in-enumerating-schemas-within-a-WSDL-tp1092957p1139524.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Glen Mazza <gl...@gmail.com>.
Actually, am I making a mistake?  I thought those were SCD's but apparently
they're just simple XPath?  I can't tell the difference.

SCD's are just an extension[1][2] of the JAXB RI, *not* part of the JAXB
specification--where you're supposed to be using XPath instead.  However, if
you're using SCDs, you're supposed to use the "scd" attribute and not the
"schemaLocation" and "node" attributes.  So we would have a bug (using SCD's
when we're supposed to be using XPath) if we're using SCD's for the
schemaLocation value.

On the CXF side, it would appear good to limit schemaLocation/node to just
XPath (if the below are actually SCD's) and scd attribute if you're using
SCD's.  Ideally, at least one of (schemaLocation/node) and/or (scd) would
end up having the same values for the same item between Metro and CXF.

Mega-confused,
Glen

[1] https://jaxb.dev.java.net/guide/Using_SCD_for_customizations.html
[2]
https://jaxb.dev.java.net/nonav/2.2-ea/docs/vendorCustomizations.html#scd


Daniel  Kulp wrote:
> 
> 
>> Granted, the CXF dev list might not be the most unbiased of forums, but
>> any
>> idea which team is "wrong"?
> 
> Technically, neither.    Nothing in the jax-ws spec that dictates how this
> is 
> supposed to be handled.
> 
> Not sure what else to say.   :-(
> 
> 
> Maybe something more like:
> 
> <jaxb:bindings schemaLocation="ShoppingService.wsdl#types"
>    node="/xs:schema[0]">
> 
> :-(
> 
> Dan
> 
> 
> 
> On Wednesday 14 July 2010 1:56:55 pm Glen Mazza wrote:
>> Team, I recently noticed a problem perhaps related to Tom's[1] regarding
>> the schemaLocation value in a JAXB binding file[2].  CXF enumerates
>> schemas using Schema Component Descriptors (SCD's) within a WSDL
>> differently from Metro, resulting in JAXB binding files being
>> incompatible
>> between the two:
>> 
>> mybindingfile.xjb:
>>    <!--CXF -->
>>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
>> node="/xs:schema">
>>    <!--Metro -->
>>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
>> node="/xs:schema">
>> 
>> Where 1,2,3 in both cases refers to the 1-based count of the xsd:schema
>> within the single wsdl:type.    The XJC compiler during the wsdl2java
>> generation process will reject the former for Metro and the latter for
>> CXF.
>> 
>> I'd like this to be standardized so the binding files would be portable
>> between the two frameworks but I'm not sure which framework is correct.
>> The
>> CXF method of incrementing the number next to the types seems inaccurate
>> because there can be only one wsdl:types.  On the other hand, Metro's
>> usage
>> of the ? as a delimiter does not appear to be defined in the SCD
>> candidate
>> recommendation (http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax).
>> 
>> Granted, the CXF dev list might not be the most unbiased of forums, but
>> any
>> idea which team is "wrong"?
>> 
>> Thanks,
>> Glen
>> 
>> [1]
>> http://cxf.547215.n5.nabble.com/Invalid-WSDL-with-a-Jax-ws-schemaLocation-X
>> SD-specified-td1046395.html#a1046395 [2]
>> http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts#BindingFile
>> [3] http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax
> 
> -- 
> Daniel Kulp
> dkulp@apache.org
> http://dankulp.com/blog
> 
> 

-- 
View this message in context: http://cxf.547215.n5.nabble.com/Metro-vs-CXF-difference-in-enumerating-schemas-within-a-WSDL-tp1092957p1126549.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Re: Metro vs. CXF difference in enumerating schemas within a WSDL

Posted by Daniel Kulp <dk...@apache.org>.
> Granted, the CXF dev list might not be the most unbiased of forums, but any
> idea which team is "wrong"?

Technically, neither.    Nothing in the jax-ws spec that dictates how this is 
supposed to be handled.

Not sure what else to say.   :-(


Maybe something more like:

<jaxb:bindings schemaLocation="ShoppingService.wsdl#types"
   node="/xs:schema[0]">

:-(

Dan



On Wednesday 14 July 2010 1:56:55 pm Glen Mazza wrote:
> Team, I recently noticed a problem perhaps related to Tom's[1] regarding
> the schemaLocation value in a JAXB binding file[2].  CXF enumerates
> schemas using Schema Component Descriptors (SCD's) within a WSDL
> differently from Metro, resulting in JAXB binding files being incompatible
> between the two:
> 
> mybindingfile.xjb:
>    <!--CXF -->
>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types1"
> node="/xs:schema">
>    <!--Metro -->
>    <jaxb:bindings schemaLocation="ShoppingService.wsdl#types?schema1"
> node="/xs:schema">
> 
> Where 1,2,3 in both cases refers to the 1-based count of the xsd:schema
> within the single wsdl:type.    The XJC compiler during the wsdl2java
> generation process will reject the former for Metro and the latter for CXF.
> 
> I'd like this to be standardized so the binding files would be portable
> between the two frameworks but I'm not sure which framework is correct. The
> CXF method of incrementing the number next to the types seems inaccurate
> because there can be only one wsdl:types.  On the other hand, Metro's usage
> of the ? as a delimiter does not appear to be defined in the SCD candidate
> recommendation (http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax).
> 
> Granted, the CXF dev list might not be the most unbiased of forums, but any
> idea which team is "wrong"?
> 
> Thanks,
> Glen
> 
> [1]
> http://cxf.547215.n5.nabble.com/Invalid-WSDL-with-a-Jax-ws-schemaLocation-X
> SD-specified-td1046395.html#a1046395 [2]
> http://www.jroller.com/gmazza/entry/customizing_jaxb_artifacts#BindingFile
> [3] http://www.w3.org/TR/xmlschema-ref/#section-scd-syntax

-- 
Daniel Kulp
dkulp@apache.org
http://dankulp.com/blog