You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by Adrian Dick <ad...@uk.ibm.com> on 2004/06/15 15:09:59 UTC

WSDL2Ws doesn't understand NMTOKEN - fixes attached




Hi,

I've found that the WSDL2Ws tool doesn't correctly understand the NMTOKEN
type within WSDL definitions.

This can be fixed by applying the following patch:
Within org.apache.axis.wsdl.wsdl2ws.CUtils
To the static block add
      qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
"NMTOKEN"), "xsd__string");
(See attached file: CUtils.cpp.patch)

Also, following on from this change enumerations for NMTOKENs aren't
correctly written to the generated stubs, causing compilation errors.  This
can be fixed by apply this patch:
Within
org.apache.axis.wsdl.wsdl2ws.cpp.literal.ParmHeaderFileWriter#writeSimpleTypeWithEnumerations

Modify
      if ("string".equals(baseType.getLocalPart())){
to become
      if ("string".equals(baseType.getLocalPart()) || "NMTOKEN"
.equals(baseType.getLocalPart())){
(See attached file: ParmHeaderFileWriter.cpp.patch)

I've just checked out the latest code from CVS, and found the following is
also required:
Within org.apache.axis.wsdl.wsdl2ws.info.TypeMap
To the static block add
      basicTypeQname2classmap.put(new
QName(WrapperConstants.SCHEMA_NAMESPACE, "NMTOKEN"),"xsd__string");
(See attached file: TypeMap.cpp.patch)

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)

RE: WSDL2Ws doesn't understand NMTOKEN - fixes attached

Posted by Susantha Kumara <su...@opensource.lk>.
Patch applied,

Thanks Adrian,

On Wed, 2004-06-16 at 14:40, Adrian Dick wrote:
> 
> 
> Hi,
> 
> I've made the modification in the manner you suggested.
> 
> Here are the diffs:
> (See attached file: AxisUserAPI.h.patch)(See attached file:
> CUtils.java.patch)(See attached file: ParmHeaderFileWriter.java.patch)(See
> attached file: TypeMap.java.patch)(See attached file: TypeMapping.h.patch)
> 
> Regards,
> Adrian
> _______________________________________
> Adrian Dick (adrian.dick@uk.ibm.com)
> 
> 
> 
>                                                                            
>              "Susantha Kumara"                                             
>              <susantha@opensou                                             
>              rce.lk>                                                    To 
>                                        "'Apache AXIS C Developers List'"   
>              15-06-04 15:49            <ax...@ws.apache.org>          
>                                                                         cc 
>                                                                            
>              Please respond to                                     Subject 
>               "Apache AXIS C           RE: WSDL2Ws doesn't understand      
>              Developers List"          NMTOKEN - fixes attached            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
>                                                                            
> 
> 
> 
> 
> Hi Adrian,
> 
> The proper way to do this is that we have to define types in
> AxisUserAPI.h.
> Ex:
>              typedef char* xsd__NMTOKEN
> 
> And then use it in the coding.
> 
> For example,
> 
> >       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> > "NMTOKEN"), "xsd__NMTOKEN");
> 
> And everywhere in the WSDL2Ws tool this xsd__NMTOKEN is treated in the
> same way as xsd__string. When you add this xsd__NMTOKEN to all the maps
> in CUtils.java I hope this is done.
> 
> Also there are a lot of other xsd types that maps to base xsd types like
> string, int , long etc. We have to do the same thing to support them
> too.
> 
> Thanks,
> 
> Susantha
> ---
> 
> > -----Original Message-----
> > From: Adrian Dick [mailto:adrian.dick@uk.ibm.com]
> > Sent: Tuesday, June 15, 2004 7:10 PM
> > To: axis-c-dev@ws.apache.org
> > Subject: WSDL2Ws doesn't understand NMTOKEN - fixes attached
> >
> >
> >
> >
> >
> > Hi,
> >
> > I've found that the WSDL2Ws tool doesn't correctly understand the
> NMTOKEN
> > type within WSDL definitions.
> >
> > This can be fixed by applying the following patch:
> > Within org.apache.axis.wsdl.wsdl2ws.CUtils
> > To the static block add
> >       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> > "NMTOKEN"), "xsd__string");
> > (See attached file: CUtils.cpp.patch)
> >
> > Also, following on from this change enumerations for NMTOKENs aren't
> > correctly written to the generated stubs, causing compilation errors.
> > This
> > can be fixed by apply this patch:
> > Within
> >
> org.apache.axis.wsdl.wsdl2ws.cpp.literal.ParmHeaderFileWriter#writeSimpl
> eT
> > ypeWithEnumerations
> >
> > Modify
> >       if ("string".equals(baseType.getLocalPart())){
> > to become
> >       if ("string".equals(baseType.getLocalPart()) || "NMTOKEN"
> > .equals(baseType.getLocalPart())){
> > (See attached file: ParmHeaderFileWriter.cpp.patch)
> >
> > I've just checked out the latest code from CVS, and found the
> following is
> > also required:
> > Within org.apache.axis.wsdl.wsdl2ws.info.TypeMap
> > To the static block add
> >       basicTypeQname2classmap.put(new
> > QName(WrapperConstants.SCHEMA_NAMESPACE, "NMTOKEN"),"xsd__string");
> > (See attached file: TypeMap.cpp.patch)
> >
> > Regards,
> > Adrian
> > _______________________________________
> > Adrian Dick (adrian.dick@uk.ibm.com)
> 


RE: WSDL2Ws doesn't understand NMTOKEN - fixes attached

Posted by Adrian Dick <ad...@uk.ibm.com>.



Hi,

I've made the modification in the manner you suggested.

Here are the diffs:
(See attached file: AxisUserAPI.h.patch)(See attached file:
CUtils.java.patch)(See attached file: ParmHeaderFileWriter.java.patch)(See
attached file: TypeMap.java.patch)(See attached file: TypeMapping.h.patch)

Regards,
Adrian
_______________________________________
Adrian Dick (adrian.dick@uk.ibm.com)



                                                                           
             "Susantha Kumara"                                             
             <susantha@opensou                                             
             rce.lk>                                                    To 
                                       "'Apache AXIS C Developers List'"   
             15-06-04 15:49            <ax...@ws.apache.org>          
                                                                        cc 
                                                                           
             Please respond to                                     Subject 
              "Apache AXIS C           RE: WSDL2Ws doesn't understand      
             Developers List"          NMTOKEN - fixes attached            
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




Hi Adrian,

The proper way to do this is that we have to define types in
AxisUserAPI.h.
Ex:
             typedef char* xsd__NMTOKEN

And then use it in the coding.

For example,

>       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> "NMTOKEN"), "xsd__NMTOKEN");

And everywhere in the WSDL2Ws tool this xsd__NMTOKEN is treated in the
same way as xsd__string. When you add this xsd__NMTOKEN to all the maps
in CUtils.java I hope this is done.

Also there are a lot of other xsd types that maps to base xsd types like
string, int , long etc. We have to do the same thing to support them
too.

Thanks,

Susantha
---

> -----Original Message-----
> From: Adrian Dick [mailto:adrian.dick@uk.ibm.com]
> Sent: Tuesday, June 15, 2004 7:10 PM
> To: axis-c-dev@ws.apache.org
> Subject: WSDL2Ws doesn't understand NMTOKEN - fixes attached
>
>
>
>
>
> Hi,
>
> I've found that the WSDL2Ws tool doesn't correctly understand the
NMTOKEN
> type within WSDL definitions.
>
> This can be fixed by applying the following patch:
> Within org.apache.axis.wsdl.wsdl2ws.CUtils
> To the static block add
>       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> "NMTOKEN"), "xsd__string");
> (See attached file: CUtils.cpp.patch)
>
> Also, following on from this change enumerations for NMTOKENs aren't
> correctly written to the generated stubs, causing compilation errors.
> This
> can be fixed by apply this patch:
> Within
>
org.apache.axis.wsdl.wsdl2ws.cpp.literal.ParmHeaderFileWriter#writeSimpl
eT
> ypeWithEnumerations
>
> Modify
>       if ("string".equals(baseType.getLocalPart())){
> to become
>       if ("string".equals(baseType.getLocalPart()) || "NMTOKEN"
> .equals(baseType.getLocalPart())){
> (See attached file: ParmHeaderFileWriter.cpp.patch)
>
> I've just checked out the latest code from CVS, and found the
following is
> also required:
> Within org.apache.axis.wsdl.wsdl2ws.info.TypeMap
> To the static block add
>       basicTypeQname2classmap.put(new
> QName(WrapperConstants.SCHEMA_NAMESPACE, "NMTOKEN"),"xsd__string");
> (See attached file: TypeMap.cpp.patch)
>
> Regards,
> Adrian
> _______________________________________
> Adrian Dick (adrian.dick@uk.ibm.com)


RE: WSDL2Ws doesn't understand NMTOKEN - fixes attached

Posted by Susantha Kumara <su...@opensource.lk>.
Hi Adrian,

The proper way to do this is that we have to define types in
AxisUserAPI.h.
Ex:
	typedef char* xsd__NMTOKEN

And then use it in the coding.

For example,

>       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> "NMTOKEN"), "xsd__NMTOKEN");

And everywhere in the WSDL2Ws tool this xsd__NMTOKEN is treated in the
same way as xsd__string. When you add this xsd__NMTOKEN to all the maps
in CUtils.java I hope this is done.

Also there are a lot of other xsd types that maps to base xsd types like
string, int , long etc. We have to do the same thing to support them
too.
 
Thanks,

Susantha
---

> -----Original Message-----
> From: Adrian Dick [mailto:adrian.dick@uk.ibm.com]
> Sent: Tuesday, June 15, 2004 7:10 PM
> To: axis-c-dev@ws.apache.org
> Subject: WSDL2Ws doesn't understand NMTOKEN - fixes attached
> 
> 
> 
> 
> 
> Hi,
> 
> I've found that the WSDL2Ws tool doesn't correctly understand the
NMTOKEN
> type within WSDL definitions.
> 
> This can be fixed by applying the following patch:
> Within org.apache.axis.wsdl.wsdl2ws.CUtils
> To the static block add
>       qname2classmap.put(new QName(WrapperConstants.SCHEMA_NAMESPACE,
> "NMTOKEN"), "xsd__string");
> (See attached file: CUtils.cpp.patch)
> 
> Also, following on from this change enumerations for NMTOKENs aren't
> correctly written to the generated stubs, causing compilation errors.
> This
> can be fixed by apply this patch:
> Within
>
org.apache.axis.wsdl.wsdl2ws.cpp.literal.ParmHeaderFileWriter#writeSimpl
eT
> ypeWithEnumerations
> 
> Modify
>       if ("string".equals(baseType.getLocalPart())){
> to become
>       if ("string".equals(baseType.getLocalPart()) || "NMTOKEN"
> .equals(baseType.getLocalPart())){
> (See attached file: ParmHeaderFileWriter.cpp.patch)
> 
> I've just checked out the latest code from CVS, and found the
following is
> also required:
> Within org.apache.axis.wsdl.wsdl2ws.info.TypeMap
> To the static block add
>       basicTypeQname2classmap.put(new
> QName(WrapperConstants.SCHEMA_NAMESPACE, "NMTOKEN"),"xsd__string");
> (See attached file: TypeMap.cpp.patch)
> 
> Regards,
> Adrian
> _______________________________________
> Adrian Dick (adrian.dick@uk.ibm.com)