[ 
https://issues.apache.org/jira/browse/CXF-3278?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14545538#comment-14545538
 ] 

Ruben Lara edited comment on CXF-3278 at 5/15/15 2:09 PM:
----------------------------------------------------------

Hi Daniel,

I'm facing the same problem. What do you mean with "you would need to turn on 
the schema validation"? I already set the validation on

{code:title=CarServiceEndpointImpl.java|borderStyle=solid}
@SchemaValidation(type = SchemaValidationType.IN)
public class CarServiceEndpointImpl implements Car {
...
}
{code}
I'm working with spring boot and configuring cxf with java config. Everything 
but the enum validation is working perfectly.

{code:title=CarCxfConfiguration.java|borderStyle=solid}
    @Bean
    public Endpoint carWebService(final Bus cxfBus, final LoggingInInterceptor 
inInterceptor, final LoggingOutInterceptor outInterceptor,
            final BasicAuthAuthorizationInterceptor authInInterceptor) {
        final Endpoint endpoint = new EndpointImpl(cxfBus, 
carServiceEnpointImpl());
        ((EndpointImpl) endpoint).setAddress(carServiceName);
        
        ((EndpointImpl) endpoint).getInInterceptors().add(authInInterceptor);
        ((EndpointImpl) endpoint).getInInterceptors().add(inInterceptor);
        ((EndpointImpl) endpoint).getOutInterceptors().add(outInterceptor);

        ((EndpointImpl) endpoint).publish();
        return endpoint;
    }

    @Bean
    public Costs carServiceEnpointImpl() {
        return new CarServiceEnpointImpl();
    }
{code}
Or is there another setting I'm missing in my project?


was (Author: lararu):
Hi Daniel,

I'm facing the same problem. What do you mean with "you would need to turn on 
the schema validation"? I already set the validation on

@SchemaValidation(type = SchemaValidationType.IN)
public class CarServiceEndpointImpl implements Car {
...
}
I'm working with spring boot and configuring cxf with java config. Everything 
but the enum validation is working perfectly.

    @Bean
    public Endpoint carWebService(final Bus cxfBus, final LoggingInInterceptor 
inInterceptor, final LoggingOutInterceptor outInterceptor,
            final BasicAuthAuthorizationInterceptor authInInterceptor) {
        final Endpoint endpoint = new EndpointImpl(cxfBus, 
carServiceEnpointImpl());
        ((EndpointImpl) endpoint).setAddress(carServiceName);
        
        ((EndpointImpl) endpoint).getInInterceptors().add(authInInterceptor);
        ((EndpointImpl) endpoint).getInInterceptors().add(inInterceptor);
        ((EndpointImpl) endpoint).getOutInterceptors().add(outInterceptor);

        ((EndpointImpl) endpoint).publish();
        return endpoint;
    }

    @Bean
    public Costs carServiceEnpointImpl() {
        return new CarServiceEnpointImpl();
    }

Or is there another setting I'm missing in my project?

> Invalid Enum passed in WebMethod results to a null object
> ---------------------------------------------------------
>
>                 Key: CXF-3278
>                 URL: https://issues.apache.org/jira/browse/CXF-3278
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.3.2
>            Reporter: Ioannis Mavroukakis
>             Fix For: Invalid
>
>
> Given the following method
> {code}
>  @WebMethod
>     public BaseResponse removeDepositLimits(
>             @WebParam( name = SERVICE_AUTH ) @XmlElement( required = true ) 
> final Authorisation auth ,
>             @WebParam( name = TOKEN ) @XmlElement( required = true ) final 
> String token ,
>             @WebParam( name = "timeFrame" ) @XmlElement( required = true ) 
> final DepositLimit.TimeFrame timeFrame )
> {code}
> when timeFrame is a value that's not in the TimeFrame enum, timeFrame is set 
> to null, this should return an error to the invoker instead.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to