You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Arik Gorelik (JIRA)" <ji...@apache.org> on 2009/09/30 23:49:23 UTC

[jira] Created: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

Unable to disable schema validation in 2.2.4-SNAPSHOT
-----------------------------------------------------

                 Key: CXF-2455
                 URL: https://issues.apache.org/jira/browse/CXF-2455
             Project: CXF
          Issue Type: Bug
    Affects Versions: 2.2.4
            Reporter: Arik Gorelik
             Fix For: 2.2.4


Hello,

It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      

<jaxws:endpoint
            id="testService"
            implementor="testServiceImpl"
            wsdlLocation="wsdl/v29/testService.wsdl"
            address="/v29/testService">
            <jaxws:properties>
                <entry key="schema-validation-enabled" value="false" />
            </jaxws:properties>
            <jaxws:inInterceptors>
                <ref bean="testInterceptor" />
            </jaxws:inInterceptors>
    </jaxws:endpoint>

This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.

Best Regards,
Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

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

Arik Gorelik commented on CXF-2455:
-----------------------------------

Now I am thinking that it could be something inside the DocLiteralInInterceptor that causes my custom schema validation to fail. 

Basically prior to the DocLiteralInInterceptor interceptor, I inspect certain SOAP message elements and do message.setContent(Exception.class, Fault); in case I find a problem.  

In CXF 2.2.3, I used to be able to throw this fault from UNMARSHAL phase AFTER DocLiteralInInterceptor, but now, I cannot as I am getting a generic error for schema validation problems. 

> Unable to disable schema validation in 2.2.4-SNAPSHOT
> -----------------------------------------------------
>
>                 Key: CXF-2455
>                 URL: https://issues.apache.org/jira/browse/CXF-2455
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>            Reporter: Arik Gorelik
>             Fix For: 2.2.4
>
>
> Hello,
> It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      
> <jaxws:endpoint
>             id="testService"
>             implementor="testServiceImpl"
>             wsdlLocation="wsdl/v29/testService.wsdl"
>             address="/v29/testService">
>             <jaxws:properties>
>                 <entry key="schema-validation-enabled" value="false" />
>             </jaxws:properties>
>             <jaxws:inInterceptors>
>                 <ref bean="testInterceptor" />
>             </jaxws:inInterceptors>
>     </jaxws:endpoint>
> This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.
> Best Regards,
> Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

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

Arik Gorelik commented on CXF-2455:
-----------------------------------

Sorry for the spam, but more info on this...

I am trying to avoid having my message be processed by the DocLiteralInInterceptor so I wrote my custom intercetor to handle the Fault which I want to throw; however, my custom interceptor does not fire after URIMappingIntercetor and before DocLiteralInInterceptor after I add it to the chain. I've been debugging the code, but not sure why it does not fire.  

This is how I am adding it:

	public TestFaultThrowingInterceptor() {
		super(Phase.UNMARSHAL);
		addBefore(DocLiteralInInterceptor.class.getName());
	}

                     	public void handleMessage(SoapMessage message) throws Fault {
		// Obtain the fault from the previous phases 
		Fault fault = (Fault) message.getContent(Exception.class);
		if (fault != null) {
			throw fault;
		}
	}

<jaxws:endpoint 
            id="testService" 
            implementor="testServiceImpl" 
            wsdlLocation="wsdl/v29/testService.wsdl" 
            address="/v29/testService"> 
            <jaxws:properties> 
                <entry key="schema-validation-enabled" value="false" /> 
            </jaxws:properties> 
            <jaxws:inInterceptors> 
                <ref bean="testInterceptor" /> 
                <ref bean="testFaultThrowingInterceptor" /> 
            </jaxws:inInterceptors> 
    </jaxws:endpoint> 



> Unable to disable schema validation in 2.2.4-SNAPSHOT
> -----------------------------------------------------
>
>                 Key: CXF-2455
>                 URL: https://issues.apache.org/jira/browse/CXF-2455
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>            Reporter: Arik Gorelik
>             Fix For: 2.2.4
>
>
> Hello,
> It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      
> <jaxws:endpoint
>             id="testService"
>             implementor="testServiceImpl"
>             wsdlLocation="wsdl/v29/testService.wsdl"
>             address="/v29/testService">
>             <jaxws:properties>
>                 <entry key="schema-validation-enabled" value="false" />
>             </jaxws:properties>
>             <jaxws:inInterceptors>
>                 <ref bean="testInterceptor" />
>             </jaxws:inInterceptors>
>     </jaxws:endpoint>
> This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.
> Best Regards,
> Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

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

Arik Gorelik commented on CXF-2455:
-----------------------------------

Thank you very much. I got the latest snapshot and was able to turn off the
default jaxb validation event handler for now.

            // Fix in CXF 2.2.4 to disable jaxb default validation
            message.put("set-jaxb-validation-event-handler", false);
            message.put("jaxb-validation-event-handler", null);

I'll see if I can find a way to use the default validation and also use my
validation together. Ideally, that would be great for me, but that's a
challenge as the default jaxb validation does not allow me to get past
DocLiteralInInterceptor and only past that interceptor I can return custom
exception types (from the schema) which are filled in with the
bindings/values that I want.

Best Regards,
Arik.




> Unable to disable schema validation in 2.2.4-SNAPSHOT
> -----------------------------------------------------
>
>                 Key: CXF-2455
>                 URL: https://issues.apache.org/jira/browse/CXF-2455
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>            Reporter: Arik Gorelik
>            Assignee: Daniel Kulp
>             Fix For: 2.2.4
>
>
> Hello,
> It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      
> <jaxws:endpoint
>             id="testService"
>             implementor="testServiceImpl"
>             wsdlLocation="wsdl/v29/testService.wsdl"
>             address="/v29/testService">
>             <jaxws:properties>
>                 <entry key="schema-validation-enabled" value="false" />
>             </jaxws:properties>
>             <jaxws:inInterceptors>
>                 <ref bean="testInterceptor" />
>             </jaxws:inInterceptors>
>     </jaxws:endpoint>
> This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.
> Best Regards,
> Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

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

Arik Gorelik commented on CXF-2455:
-----------------------------------

Looks like after experimenting more with this, in 2.2.4-SNAPSHOT, the schema validation setting is ignored?

I just sending a simple integer type in an <id> element like this:

<id>12345a</id>

but getting a validation error which I would like to turn off and able to do so in 2.2.3. Moreover, in 2.2.3 in the UNMARSHAL phase, the value is being set to "null" in case of invalid values for the elements based on the schema types.

Here is the stack trace:

DefaultValidationEventHandler: [ERROR]: For input string: "12345a" 
     Location: line 11
Sep 30, 2009 8:47:21 PM org.apache.cxf.phase.PhaseInterceptorChain doIntercept
WARNING: Interceptor has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Unmarshalling Error: For input string: "12345a" 
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:661)
	at org.apache.cxf.jaxb.JAXBEncoderDecoder.unmarshall(JAXBEncoderDecoder.java:533)
	at org.apache.cxf.jaxb.io.DataReaderImpl.read(DataReaderImpl.java:119)
	at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:99)
	at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:236)
	at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:104)

> Unable to disable schema validation in 2.2.4-SNAPSHOT
> -----------------------------------------------------
>
>                 Key: CXF-2455
>                 URL: https://issues.apache.org/jira/browse/CXF-2455
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>            Reporter: Arik Gorelik
>             Fix For: 2.2.4
>
>
> Hello,
> It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      
> <jaxws:endpoint
>             id="testService"
>             implementor="testServiceImpl"
>             wsdlLocation="wsdl/v29/testService.wsdl"
>             address="/v29/testService">
>             <jaxws:properties>
>                 <entry key="schema-validation-enabled" value="false" />
>             </jaxws:properties>
>             <jaxws:inInterceptors>
>                 <ref bean="testInterceptor" />
>             </jaxws:inInterceptors>
>     </jaxws:endpoint>
> This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.
> Best Regards,
> Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (CXF-2455) Unable to disable schema validation in 2.2.4-SNAPSHOT

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

Daniel Kulp resolved CXF-2455.
------------------------------

    Resolution: Fixed
      Assignee: Daniel Kulp


Added two properties:

"set-jaxb-validation-event-handler" -> Boolean
which can be set to false to completely NOT set any sort of event handler.  

"jaxb-validation-event-handler" -> ValidationEventHandler object
if you want to set your own custom handler.

Note:  both properties are contextual off the message.  Thus, an interceptor prior to the DocLitIn... could set the properties.  It doesn't need to be a configuration thing or similar.

> Unable to disable schema validation in 2.2.4-SNAPSHOT
> -----------------------------------------------------
>
>                 Key: CXF-2455
>                 URL: https://issues.apache.org/jira/browse/CXF-2455
>             Project: CXF
>          Issue Type: Bug
>    Affects Versions: 2.2.4
>            Reporter: Arik Gorelik
>            Assignee: Daniel Kulp
>             Fix For: 2.2.4
>
>
> Hello,
> It seems I am unable to disable schema validation CXF 2.2.4-SNAPSHOT as it is enabled by default?      
> <jaxws:endpoint
>             id="testService"
>             implementor="testServiceImpl"
>             wsdlLocation="wsdl/v29/testService.wsdl"
>             address="/v29/testService">
>             <jaxws:properties>
>                 <entry key="schema-validation-enabled" value="false" />
>             </jaxws:properties>
>             <jaxws:inInterceptors>
>                 <ref bean="testInterceptor" />
>             </jaxws:inInterceptors>
>     </jaxws:endpoint>
> This works in 2.2.3 as I am able to disable schema validation to perform custom checks myself. However, in the latest 2.2.4-SNAPSHOT, I am not longer able to disable the schema validation. Is there another way to do this without touching the Endpoint Service Interface/Class? I am using a WSDL first approach to develop my services.
> Best Regards,
> Arik.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.