CXF 2.2.12:如何在客户端关闭模式验证

问题描述:

我想关闭JAXB绑定消息的模式验证。我正在处理客户端CXF代码(WSDL第一代)。我尝试过使用

I would like to turn off schema validation for JAXB-bound messages. I am dealing with the client-side CXF code (WSDL first generation). I have tried using

<jaxws:client name="{http://apache.org/hello_world_soap_http}SoapPort"
    createdFromAPI="true">
    <jaxws:properties>
        <entry key="schema-validation-enabled" value="true" />
    </jaxws:properties>
</jaxws:client>

没有成功(参见参考文献 CXF常见问题)。我很难找到一种设置此属性的编程方式。我还探讨了短路CXF并访问解析器,unmarshaller等。

Without success (see reference CXF FAQ ). I've had difficulty finding a programmatic way of settings this property. I've also explored short-circuiting CXF and accessing the parser, unmarshaller, etc.

感谢您的帮助。

要关闭架构验证,您应该设置架构验证启用属性 false

To turn off the schema validation you should set the schema-validation-enabled property to false.

根据你提到的文件( CXF常见问题解答)。

According to documentation referred by you (CXF FAQ).

启用架构验证(所有请求和响应都将根据模式进行验证)设置

To enable schema validation (all requests and responses will be validated against schema) set

<entry key="schema-validation-enabled" value="true" />

要禁用模式验证(请求和响应都不会针对模式进行验证)不执行任何操作是默认行为或集合

To disable schema validation (none of the requests nor responses will be validated against schema) do nothing cause it is the default behavior or set

<entry key="schema-validation-enabled" value="false" />