You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by arun_rocky <ar...@cognizant.com> on 2009/02/13 14:05:25 UTC
XML Validation Nt working in CXF
hi,
i have created an sample webservice and my interface is
@webservice(name="sample")
public interface Sample{
public String validateMethod(SampleJavaBean s);
}
i have implemented the interface
public class SampleClass implements Sample{
public String validateMethod(SampleJavaBean s){
return s.getFirstName();
}
}
now i am adding validations annotations to my bean :
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "SampleJavaBean", propOrder = {
"firstName"
})
@XmlRootElement(name="SampleJavaBean")
class SampleJavaBean {
@XmlElememt(required = true, nillable =false)
private String firstName();
}
now the problem is , even if i give null values and if i send the request
without the required field, the service is wrking fine, y the validation is
not happening? :confused:
can any one solve this problem.. thanks in advance mates
--
View this message in context: http://www.nabble.com/XML-Validation-Nt-working-in-CXF-tp21995950p21995950.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: XML Validation Nt working in CXF
Posted by arun_rocky <ar...@cognizant.com>.
Andrew, thank u so much for ur help.. thanks mate
Andrew Clegg-2 wrote:
>
> Have you switched on schema validation as specified in the FAQ?
>
> http://cxf.apache.org/faq.html
>
> It's off by default for performance reasons.
>
> Andrew.
>
> 2009/2/13 arun_rocky <ar...@cognizant.com>:
>>
>> hi,
>>
>> i have created an sample webservice and my interface is
>>
>> @webservice(name="sample")
>> public interface Sample{
>> public String validateMethod(SampleJavaBean s);
>> }
>>
>> i have implemented the interface
>>
>> public class SampleClass implements Sample{
>> public String validateMethod(SampleJavaBean s){
>> return s.getFirstName();
>> }
>> }
>>
>> now i am adding validations annotations to my bean :
>>
>>
>> @XmlAccessorType(XmlAccessType.FIELD)
>> @XmlType(name = "SampleJavaBean", propOrder = {
>> "firstName"
>> })
>> @XmlRootElement(name="SampleJavaBean")
>> class SampleJavaBean {
>> @XmlElememt(required = true, nillable =false)
>> private String firstName();
>> }
>>
>> now the problem is , even if i give null values and if i send the request
>> without the required field, the service is wrking fine, y the validation
>> is
>> not happening? :confused:
>>
>> can any one solve this problem.. thanks in advance mates
>> --
>> View this message in context:
>> http://www.nabble.com/XML-Validation-Nt-working-in-CXF-tp21995950p21995950.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> :: http://biotext.org.uk/ ::
>
>
--
View this message in context: http://www.nabble.com/XML-Validation-Nt-working-in-CXF-tp21995950p21996298.html
Sent from the cxf-user mailing list archive at Nabble.com.
Re: XML Validation Nt working in CXF
Posted by Andrew Clegg <an...@nervechannel.com>.
Have you switched on schema validation as specified in the FAQ?
http://cxf.apache.org/faq.html
It's off by default for performance reasons.
Andrew.
2009/2/13 arun_rocky <ar...@cognizant.com>:
>
> hi,
>
> i have created an sample webservice and my interface is
>
> @webservice(name="sample")
> public interface Sample{
> public String validateMethod(SampleJavaBean s);
> }
>
> i have implemented the interface
>
> public class SampleClass implements Sample{
> public String validateMethod(SampleJavaBean s){
> return s.getFirstName();
> }
> }
>
> now i am adding validations annotations to my bean :
>
>
> @XmlAccessorType(XmlAccessType.FIELD)
> @XmlType(name = "SampleJavaBean", propOrder = {
> "firstName"
> })
> @XmlRootElement(name="SampleJavaBean")
> class SampleJavaBean {
> @XmlElememt(required = true, nillable =false)
> private String firstName();
> }
>
> now the problem is , even if i give null values and if i send the request
> without the required field, the service is wrking fine, y the validation is
> not happening? :confused:
>
> can any one solve this problem.. thanks in advance mates
> --
> View this message in context: http://www.nabble.com/XML-Validation-Nt-working-in-CXF-tp21995950p21995950.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
--
:: http://biotext.org.uk/ ::