You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "David J. M. Karlsen (JIRA)" <ji...@apache.org> on 2011/09/20 20:21:09 UTC

[jira] [Created] (CXF-3813) Possibiblity to only validate requests and/or responses

Possibiblity to only validate requests and/or responses
-------------------------------------------------------

                 Key: CXF-3813
                 URL: https://issues.apache.org/jira/browse/CXF-3813
             Project: CXF
          Issue Type: Improvement
          Components: JAX-WS Runtime
    Affects Versions: 2.4.2
         Environment: N/A
            Reporter: David J. M. Karlsen


Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "David J. M. Karlsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119525#comment-13119525 ] 

David J. M. Karlsen commented on CXF-3813:
------------------------------------------

It would also be nice if one could tell if one wanted soap headers to be validated or not.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "David J. M. Karlsen (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119868#comment-13119868 ] 

David J. M. Karlsen commented on CXF-3813:
------------------------------------------

Adding reference to mailinglist where there are references back to the mustUnderstand in the spec:
http://cxf.547215.n5.nabble.com/mustUnderstand-for-custom-soap-headers-td4865240.html
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Attachment:     (was: patch.txt)
    
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Attachment: patch.txt

Initial patch - I will commit this myself, just putting it here for reference until i get a chance to do a full build to ensure no checkstyle, other breaks.

This patch is only fully supported in JAX-WS.  Its activated via the DocLiteralInInterceptor and AbstractDataOutInterceptor.

Because it should work for all data bindings out going I need to look at how I might either disable for other data bindings or add the necessary changes to the other bindings as well.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Daniel Kulp
>              Labels: cxf, schema, validation, xsd
>             Fix For: 2.6.3, 2.7.0
>
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466605#comment-13466605 ] 

Jason Pell commented on CXF-3813:
---------------------------------

I am going to start looking at this and submit a patch and test cases hopefully sometime this week.  It's certainly something I can use in my own product development so worth the effort.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Assigned] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp reassigned CXF-3813:
--------------------------------

    Assignee: Daniel Kulp
    
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Daniel Kulp
>              Labels: cxf, schema, validation, xsd
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13459322#comment-13459322 ] 

Jason Pell commented on CXF-3813:
---------------------------------

Daniel - you mentioned in mailing list to use an interceptor to turn off validation.  I notice this was also mentioned in the irc log.  However what would be your preferred approach to implementing this functionality?  I was thinking that the @SchemaValidation annotation would be extended with type=Request|Response|Both or similiar.  But then how to get that into the area where the schema validation is turned on. 
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466667#comment-13466667 ] 

Jason Pell edited comment on CXF-3813 at 10/1/12 6:16 PM:
----------------------------------------------------------

I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

Oops - my bad you can't have a null default value for a field in an annotation. 

So I will have to think of another way to support both.  

I think this will do the trick:

private void addSchemaValidationSupport(Endpoint endpoint, SchemaValidation annotation) {
        if (annotation != null) {
            // if someone has gone to the effort of specifying enabled=false, then we need to
            // handle that, otherwise we use the new SchemaValidationType type only
            if (!annotation.enabled()) {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, SchemaValidationType.NONE.name());
            } else {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.type().name());
            }
        }
    }
                
      was (Author: pellcorp):
    I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

Oops - my bad you can't have a null default value for a field in an annotation. 

So I will have to think of another way to support both.  
                  
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Resolved] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel Kulp resolved CXF-3813.
------------------------------

       Resolution: Fixed
    Fix Version/s: 2.7.0
                   2.6.3


Patch applied with just a small modification to the method in ServiceUtils.java to avoid a obj -> string -> obj bounce.

Major thanks!
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Daniel Kulp
>              Labels: cxf, schema, validation, xsd
>             Fix For: 2.6.3, 2.7.0
>
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466667#comment-13466667 ] 

Jason Pell commented on CXF-3813:
---------------------------------

I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

private void addSchemaValidationSupport(Endpoint endpoint, SchemaValidation annotation) {
        if (annotation != null) {
            if (annotation.type() != null) {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.type().name());
            } else {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.enabled());
            }
        }
    }

                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Attachment: patch.txt

Patch with some checkstyle fixes.  This patch is considered my final version until it is reviewed by the developers and any requested changes are undertaken.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Glen Mazza (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119541#comment-13119541 ] 

Glen Mazza commented on CXF-3813:
---------------------------------

Validating headers might be unusual because I'm not sure there's a problem with SOAP clients adding additional headers for whatever intermediate nodes/tasks during routing it has, headers that the endpoint might not care about.  Further, unlike the SOAP body, headers are frequently defined implicitly (i.e., within the wsdl:binding and not the wsdl:porttype sections) because they can differ based on the transport used, so validating them could prove trickier.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Daniel Kulp (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13463124#comment-13463124 ] 

Daniel Kulp commented on CXF-3813:
----------------------------------

Jason,

Most likely, in AnnotationsFactoryBeanListener.addSchemaValidationSupport, just do:
{code}
    if (annotation.enabled()) {
        endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.type());
    } else {
        endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, "none");
    }
{code}

which would record the property as the String.  (or use an Enum for type and do type().toString()) 

Then in AbstractInDatabindingInterceptor and the Out version, update the setSchemaInMessage method to get the contextual property as an Object and if it's a Boolean (backwords compat), do current, else if String, check for the Request/Response/Both/True/None/False values and act appropriately.   That should keep it completely compatible with existing configs, but also allow using "schema-validation-enabled", "Request" as the properties in the configs to just get that behavior.

Also, not sure if it should be "Request"/"Response" or "In"/"Out".   Might be easier and make more sense for In/Out cause a global "In" on the Bus would validate all incoming messages (could be the Request for services, but the response for clients).





                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466724#comment-13466724 ] 

Jason Pell commented on CXF-3813:
---------------------------------

The patch is against trunk as 2.7 is soon to be released.  It can probably be easily back ported to 2.6 as well.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Comment Edited] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13466667#comment-13466667 ] 

Jason Pell edited comment on CXF-3813 at 10/1/12 6:14 PM:
----------------------------------------------------------

I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

Oops - my bad you can't have a null default value for a field in an annotation. 

So I will have to think of another way to support both.  
                
      was (Author: pellcorp):
    I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

private void addSchemaValidationSupport(Endpoint endpoint, SchemaValidation annotation) {
        if (annotation != null) {
            if (annotation.type() != null) {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.type().name());
            } else {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.enabled());
            }
        }
    }

                  
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Commented] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Daniel Kulp (Commented) (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13119547#comment-13119547 ] 

Daniel Kulp commented on CXF-3813:
----------------------------------


Glen, 

Just chatted with David on IRC.   See:

http://irclogs.dankulp.com/logs/irclogger_log/cxf?date=2011-10-03,Mon&sel=132#l128

One issue right now is that if validation is turned on, it's on for everything we marshal and unmarshal.   That includes the header objects that map to a @WebParam(header=true) parameter.   However, that header MAY include a soap:mustUnderstand="1" attribute on it that would trigger an unmarshal  failure.   I do have a fix for that *specific* issue (need to remove the soap specific attributes before unmarshalling) I'm about to commit and have him test, but this issue is valid. 






                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Attachment:     (was: patch.txt)
    
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Daniel Kulp
>              Labels: cxf, schema, validation, xsd
>             Fix For: 2.6.3, 2.7.0
>
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Comment: was deleted

(was: Initial patch - I will commit this myself, just putting it here for reference until i get a chance to do a full build to ensure no checkstyle, other breaks.

This patch is only fully supported in JAX-WS.  Its activated via the DocLiteralInInterceptor and AbstractDataOutInterceptor.

Because it should work for all data bindings out going I need to look at how I might either disable for other data bindings or add the necessary changes to the other bindings as well.)
    
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>            Assignee: Daniel Kulp
>              Labels: cxf, schema, validation, xsd
>             Fix For: 2.6.3, 2.7.0
>
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Comment: was deleted

(was: I am assuming I need to maintain backwards compatibility with the enabled field from SchemaValidation annotation interface as well?  If thats the case then I have the following code in AnnotationsFactoryBeanListener

Oops - my bad you can't have a null default value for a field in an annotation. 

So I will have to think of another way to support both.  

I think this will do the trick:

private void addSchemaValidationSupport(Endpoint endpoint, SchemaValidation annotation) {
        if (annotation != null) {
            // if someone has gone to the effort of specifying enabled=false, then we need to
            // handle that, otherwise we use the new SchemaValidationType type only
            if (!annotation.enabled()) {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, SchemaValidationType.NONE.name());
            } else {
                endpoint.put(Message.SCHEMA_VALIDATION_ENABLED, annotation.type().name());
            }
        }
    })
    
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

[jira] [Updated] (CXF-3813) Possibiblity to only validate requests and/or responses

Posted by "Jason Pell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/CXF-3813?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jason Pell updated CXF-3813:
----------------------------

    Attachment: patch.txt

Initial patch for this functionality including unit tests and updated system tests.
                
> Possibiblity to only validate requests and/or responses
> -------------------------------------------------------
>
>                 Key: CXF-3813
>                 URL: https://issues.apache.org/jira/browse/CXF-3813
>             Project: CXF
>          Issue Type: Improvement
>          Components: JAX-WS Runtime
>    Affects Versions: 2.4.2
>         Environment: N/A
>            Reporter: David J. M. Karlsen
>              Labels: cxf, schema, validation, xsd
>         Attachments: patch.txt
>
>
> Today it is possible to specify to validate or not, it would be even better if one could specify to only validate requests, only responses, or both as today.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira