You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Jiang Ning <ni...@iona.com> on 2006/10/19 11:20:32 UTC

Re: svn commit: r465539 - in /incubator/cxf/trunk:

Hi Dan:
 
I tried to run the JMSClientServerTest in Systest with the RPCLitFault,
        try {
                    greeter.testRpcLitFault("BadRecordLitFault");
                    fail("Should have thrown BadRecoedLitFault");
                } catch (BadRecordLitFault ex) {
                    assertNotNull(ex.getFaultInfo());
                }
               
                try {
                    greeter.testRpcLitFault("NoSuchCodeLitFault");
                    fail("Should have thrown NoSuchCodeLitFault exception");
                } catch (NoSuchCodeLitFault nslf) {
                    assertNotNull(nslf.getFaultInfo());
                    assertNotNull(nslf.getFaultInfo().getCode());
                }

I got this error
org.apache.cxf.binding.soap.SoapFault: TestBadRecordLit
    at 
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70)
    at 
org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:36)
    at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133)
    at 
org.apache.cxf.interceptor.AbstractFaultChainIntiatorObserver.onMessage(AbstractFaultChainIntiatorObserver.java:64)
    at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:99)
    at 
org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:44)
    at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133)
    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:242)
    at 
org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.handleResponse(JMSConduit.java:384)
    at 
org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.doClose(JMSConduit.java:265)
    at 
org.apache.cxf.io.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:80)
    at org.apache.cxf.transport.jms.JMSConduit.close(JMSConduit.java:130)
    at 
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:59)
    at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133)
    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:140)
    at 
org.apache.cxf.jaxws.EndpointInvocationHandler.invokeSync(EndpointInvocationHandler.java:115)
    at 
org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:101)
    at $Proxy53.testRpcLitFault(Unknown Source)
    at 
org.apache.cxf.systest.jms.JMSClientServerTest.testBasicConnection(JMSClientServerTest.java:138)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at junit.framework.TestCase.runTest(TestCase.java:154)
    at junit.framework.TestCase.runBare(TestCase.java:127)
    at junit.framework.TestResult$1.protect(TestResult.java:106)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.framework.TestResult.run(TestResult.java:109)
    at junit.framework.TestCase.run(TestCase.java:118)
    at junit.framework.TestSuite.runTest(TestSuite.java:208)
    at junit.framework.TestSuite.run(TestSuite.java:203)
    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
    at junit.framework.TestResult.runProtected(TestResult.java:124)
    at junit.extensions.TestSetup.run(TestSetup.java:23)
   
Can you have a look at this.

Thanks,

Willem


>Modified: incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java
>URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?view=diff&rev=465539&r1=465538&r2=465539
>==============================================================================
>--- incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java (original)
>+++ incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java Thu Oct 19 02:03:15 2006
>@@ -31,18 +31,21 @@
> import junit.framework.Test;
> import junit.framework.TestSuite;
> 
>+//import org.apache.cxf.hello_world_jms.BadRecordLitFault;
> import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort;
> import org.apache.cxf.hello_world_jms.HelloWorldOneWayQueueService;
> import org.apache.cxf.hello_world_jms.HelloWorldPortType;
> import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
> import org.apache.cxf.hello_world_jms.HelloWorldPubSubService;
> import org.apache.cxf.hello_world_jms.HelloWorldService;
>+//import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
> import org.apache.cxf.systest.common.ClientServerSetupBase;
> import org.apache.cxf.systest.common.ClientServerTestBase;
> import org.apache.cxf.transport.jms.JMSConstants;
> import org.apache.cxf.transports.jms.context.JMSMessageHeadersType;
> import org.apache.cxf.transports.jms.context.JMSPropertyType;
> import org.apache.hello_world_doc_lit.Greeter;
>+import org.apache.hello_world_doc_lit.PingMeFault;
> import org.apache.hello_world_doc_lit.SOAPService2;
> 
> public class JMSClientServerTest extends ClientServerTestBase {
>@@ -94,12 +97,12 @@
>                 assertNotNull("no response received from service", reply);
>                 assertEquals(response2, reply);
>                 
>-                /*try {
>+                try {
>                     greeter.pingMe();
>                     fail("Should have thrown FaultException");
>                 } catch (PingMeFault ex) {
>                     assertNotNull(ex.getFaultInfo());
>-                }*/                
>+                }                
>               
>             }
>         } catch (UndeclaredThrowableException ex) {
>@@ -144,7 +147,7 @@
>                 } catch (NoSuchCodeLitFault nslf) {
>                     assertNotNull(nslf.getFaultInfo());
>                     assertNotNull(nslf.getFaultInfo().getCode());
>-                }*/ 
>+                } */
>             }
>         } catch (UndeclaredThrowableException ex) {
>             throw (Exception)ex.getCause();
>
>  
>

Re: svn commit: r465539 - in /incubator/cxf/trunk:

Posted by Jiang Ning <ni...@iona.com>.
Hi Dan,

Tom had looked into it and he will almost finish it. :)

If you just want to debug the client side unit test, you just need to 
run JMSClientServerTest in Junit.
It will start up the JMS Broker and JMS Server.

org.apache.cxf.systest.jms.Server.main just to run the JMS Server and it 
need JMS Broker lunch frist.

Willem.

Dan Diephouse wrote:

> Hi Jiang,
> I have no idea what thats not working, I'll have to look into it.
>
> How do I get the JMS server launched so I can debug individual client 
> unit tests? Running org.apache.cxf.systest.jms.Server.main() doesn't 
> seem to quite do the trick...
> Cheers,
> - Dan
>
> Jiang Ning wrote:
>
>> Hi Dan:
>>
>> I tried to run the JMSClientServerTest in Systest with the RPCLitFault,
>>        try {
>>                    greeter.testRpcLitFault("BadRecordLitFault");
>>                    fail("Should have thrown BadRecoedLitFault");
>>                } catch (BadRecordLitFault ex) {
>>                    assertNotNull(ex.getFaultInfo());
>>                }
>>                              try {
>>                    greeter.testRpcLitFault("NoSuchCodeLitFault");
>>                    fail("Should have thrown NoSuchCodeLitFault 
>> exception");
>>                } catch (NoSuchCodeLitFault nslf) {
>>                    assertNotNull(nslf.getFaultInfo());
>>                    assertNotNull(nslf.getFaultInfo().getCode());
>>                }
>>
>> I got this error
>> org.apache.cxf.binding.soap.SoapFault: TestBadRecordLit
>>    at 
>> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70) 
>>
>>    at 
>> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:36) 
>>
>>    at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>>
>>    at 
>> org.apache.cxf.interceptor.AbstractFaultChainIntiatorObserver.onMessage(AbstractFaultChainIntiatorObserver.java:64) 
>>
>>    at 
>> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:99) 
>>
>>    at 
>> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:44) 
>>
>>    at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>>
>>    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:242)
>>    at 
>> org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.handleResponse(JMSConduit.java:384) 
>>
>>    at 
>> org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.doClose(JMSConduit.java:265) 
>>
>>    at 
>> org.apache.cxf.io.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:80) 
>>
>>    at org.apache.cxf.transport.jms.JMSConduit.close(JMSConduit.java:130)
>>    at 
>> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:59) 
>>
>>    at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>>
>>    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:140)
>>    at 
>> org.apache.cxf.jaxws.EndpointInvocationHandler.invokeSync(EndpointInvocationHandler.java:115) 
>>
>>    at 
>> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:101) 
>>
>>    at $Proxy53.testRpcLitFault(Unknown Source)
>>    at 
>> org.apache.cxf.systest.jms.JMSClientServerTest.testBasicConnection(JMSClientServerTest.java:138) 
>>
>>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>    at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>    at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>    at java.lang.reflect.Method.invoke(Method.java:585)
>>    at junit.framework.TestCase.runTest(TestCase.java:154)
>>    at junit.framework.TestCase.runBare(TestCase.java:127)
>>    at junit.framework.TestResult$1.protect(TestResult.java:106)
>>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>>    at junit.framework.TestResult.run(TestResult.java:109)
>>    at junit.framework.TestCase.run(TestCase.java:118)
>>    at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>    at junit.framework.TestSuite.run(TestSuite.java:203)
>>    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>>    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>>    at junit.extensions.TestSetup.run(TestSetup.java:23)
>>   Can you have a look at this.
>>
>> Thanks,
>>
>> Willem
>>
>>
>>> Modified: 
>>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>>>
>>> URL: 
>>> http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?view=diff&rev=465539&r1=465538&r2=465539 
>>>
>>> ============================================================================== 
>>>
>>> --- 
>>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>>> (original)
>>> +++ 
>>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>>> Thu Oct 19 02:03:15 2006
>>> @@ -31,18 +31,21 @@
>>> import junit.framework.Test;
>>> import junit.framework.TestSuite;
>>>
>>> +//import org.apache.cxf.hello_world_jms.BadRecordLitFault;
>>> import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort;
>>> import org.apache.cxf.hello_world_jms.HelloWorldOneWayQueueService;
>>> import org.apache.cxf.hello_world_jms.HelloWorldPortType;
>>> import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
>>> import org.apache.cxf.hello_world_jms.HelloWorldPubSubService;
>>> import org.apache.cxf.hello_world_jms.HelloWorldService;
>>> +//import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
>>> import org.apache.cxf.systest.common.ClientServerSetupBase;
>>> import org.apache.cxf.systest.common.ClientServerTestBase;
>>> import org.apache.cxf.transport.jms.JMSConstants;
>>> import org.apache.cxf.transports.jms.context.JMSMessageHeadersType;
>>> import org.apache.cxf.transports.jms.context.JMSPropertyType;
>>> import org.apache.hello_world_doc_lit.Greeter;
>>> +import org.apache.hello_world_doc_lit.PingMeFault;
>>> import org.apache.hello_world_doc_lit.SOAPService2;
>>>
>>> public class JMSClientServerTest extends ClientServerTestBase {
>>> @@ -94,12 +97,12 @@
>>>                 assertNotNull("no response received from service", 
>>> reply);
>>>                 assertEquals(response2, reply);
>>>                 -                /*try {
>>> +                try {
>>>                     greeter.pingMe();
>>>                     fail("Should have thrown FaultException");
>>>                 } catch (PingMeFault ex) {
>>>                     assertNotNull(ex.getFaultInfo());
>>> -                }*/                +                
>>> }                                          }
>>>         } catch (UndeclaredThrowableException ex) {
>>> @@ -144,7 +147,7 @@
>>>                 } catch (NoSuchCodeLitFault nslf) {
>>>                     assertNotNull(nslf.getFaultInfo());
>>>                     assertNotNull(nslf.getFaultInfo().getCode());
>>> -                }*/ +                } */
>>>             }
>>>         } catch (UndeclaredThrowableException ex) {
>>>             throw (Exception)ex.getCause();
>>>
>>>  
>>>
>
>


-- 
Willem Jiang
Software Engineer

IONA Asia Pacific Software Development Center
2/F, Unit A, Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China (100094)

Tel: +86-10-82825151 - 523
Fax: +86-10-82825210
Email: ning.jiang@iona.com



Re: svn commit: r465539 - in /incubator/cxf/trunk:

Posted by Dan Diephouse <da...@envoisolutions.com>.
Hi Jiang,
I have no idea what thats not working, I'll have to look into it.

How do I get the JMS server launched so I can debug individual client 
unit tests? Running org.apache.cxf.systest.jms.Server.main() doesn't 
seem to quite do the trick...
Cheers,
- Dan

Jiang Ning wrote:
> Hi Dan:
>
> I tried to run the JMSClientServerTest in Systest with the RPCLitFault,
>        try {
>                    greeter.testRpcLitFault("BadRecordLitFault");
>                    fail("Should have thrown BadRecoedLitFault");
>                } catch (BadRecordLitFault ex) {
>                    assertNotNull(ex.getFaultInfo());
>                }
>                              try {
>                    greeter.testRpcLitFault("NoSuchCodeLitFault");
>                    fail("Should have thrown NoSuchCodeLitFault 
> exception");
>                } catch (NoSuchCodeLitFault nslf) {
>                    assertNotNull(nslf.getFaultInfo());
>                    assertNotNull(nslf.getFaultInfo().getCode());
>                }
>
> I got this error
> org.apache.cxf.binding.soap.SoapFault: TestBadRecordLit
>    at 
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:70) 
>
>    at 
> org.apache.cxf.binding.soap.interceptor.Soap11FaultInInterceptor.handleMessage(Soap11FaultInInterceptor.java:36) 
>
>    at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>
>    at 
> org.apache.cxf.interceptor.AbstractFaultChainIntiatorObserver.onMessage(AbstractFaultChainIntiatorObserver.java:64) 
>
>    at 
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:99) 
>
>    at 
> org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor.handleMessage(ReadHeadersInterceptor.java:44) 
>
>    at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>
>    at org.apache.cxf.endpoint.ClientImpl.onMessage(ClientImpl.java:242)
>    at 
> org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.handleResponse(JMSConduit.java:384) 
>
>    at 
> org.apache.cxf.transport.jms.JMSConduit$JMSOutputStream.doClose(JMSConduit.java:265) 
>
>    at 
> org.apache.cxf.io.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:80) 
>
>    at org.apache.cxf.transport.jms.JMSConduit.close(JMSConduit.java:130)
>    at 
> org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:59) 
>
>    at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:133) 
>
>    at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:140)
>    at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invokeSync(EndpointInvocationHandler.java:115) 
>
>    at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:101) 
>
>    at $Proxy53.testRpcLitFault(Unknown Source)
>    at 
> org.apache.cxf.systest.jms.JMSClientServerTest.testBasicConnection(JMSClientServerTest.java:138) 
>
>    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>    at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>    at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>    at java.lang.reflect.Method.invoke(Method.java:585)
>    at junit.framework.TestCase.runTest(TestCase.java:154)
>    at junit.framework.TestCase.runBare(TestCase.java:127)
>    at junit.framework.TestResult$1.protect(TestResult.java:106)
>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>    at junit.framework.TestResult.run(TestResult.java:109)
>    at junit.framework.TestCase.run(TestCase.java:118)
>    at junit.framework.TestSuite.runTest(TestSuite.java:208)
>    at junit.framework.TestSuite.run(TestSuite.java:203)
>    at junit.extensions.TestDecorator.basicRun(TestDecorator.java:22)
>    at junit.extensions.TestSetup$1.protect(TestSetup.java:19)
>    at junit.framework.TestResult.runProtected(TestResult.java:124)
>    at junit.extensions.TestSetup.run(TestSetup.java:23)
>   Can you have a look at this.
>
> Thanks,
>
> Willem
>
>
>> Modified: 
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>>
>> URL: 
>> http://svn.apache.org/viewvc/incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java?view=diff&rev=465539&r1=465538&r2=465539 
>>
>> ============================================================================== 
>>
>> --- 
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>> (original)
>> +++ 
>> incubator/cxf/trunk/systests/src/test/java/org/apache/cxf/systest/jms/JMSClientServerTest.java 
>> Thu Oct 19 02:03:15 2006
>> @@ -31,18 +31,21 @@
>> import junit.framework.Test;
>> import junit.framework.TestSuite;
>>
>> +//import org.apache.cxf.hello_world_jms.BadRecordLitFault;
>> import org.apache.cxf.hello_world_jms.HelloWorldOneWayPort;
>> import org.apache.cxf.hello_world_jms.HelloWorldOneWayQueueService;
>> import org.apache.cxf.hello_world_jms.HelloWorldPortType;
>> import org.apache.cxf.hello_world_jms.HelloWorldPubSubPort;
>> import org.apache.cxf.hello_world_jms.HelloWorldPubSubService;
>> import org.apache.cxf.hello_world_jms.HelloWorldService;
>> +//import org.apache.cxf.hello_world_jms.NoSuchCodeLitFault;
>> import org.apache.cxf.systest.common.ClientServerSetupBase;
>> import org.apache.cxf.systest.common.ClientServerTestBase;
>> import org.apache.cxf.transport.jms.JMSConstants;
>> import org.apache.cxf.transports.jms.context.JMSMessageHeadersType;
>> import org.apache.cxf.transports.jms.context.JMSPropertyType;
>> import org.apache.hello_world_doc_lit.Greeter;
>> +import org.apache.hello_world_doc_lit.PingMeFault;
>> import org.apache.hello_world_doc_lit.SOAPService2;
>>
>> public class JMSClientServerTest extends ClientServerTestBase {
>> @@ -94,12 +97,12 @@
>>                 assertNotNull("no response received from service", 
>> reply);
>>                 assertEquals(response2, reply);
>>                 -                /*try {
>> +                try {
>>                     greeter.pingMe();
>>                     fail("Should have thrown FaultException");
>>                 } catch (PingMeFault ex) {
>>                     assertNotNull(ex.getFaultInfo());
>> -                }*/                +                }                
>>                           }
>>         } catch (UndeclaredThrowableException ex) {
>> @@ -144,7 +147,7 @@
>>                 } catch (NoSuchCodeLitFault nslf) {
>>                     assertNotNull(nslf.getFaultInfo());
>>                     assertNotNull(nslf.getFaultInfo().getCode());
>> -                }*/ +                } */
>>             }
>>         } catch (UndeclaredThrowableException ex) {
>>             throw (Exception)ex.getCause();
>>
>>  
>>


-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com
http://netzooid.com/blog


Re: Enabling databinding schema validation configuration

Posted by Sergey Beryozkin <se...@iona.com>.
Hi

This may be a bit off topic/unrelated, but you're referring to an option which enables a schema validation, and I'd like to add one
comment/suggestion :

* it should be possible in CXF, when appropriate (when JAXB is used), given that JAXB supports an option where unrecognized elements 
are ignored, to
enable this JAXB option through the config, perhaps it should be a default setting.
This will be critical IMHO, this will enable an evolution of schemas which will enable backward compatibilty (new providers of
input/output data will be able to talk to old consumers with or without the validation being enabled)

Cheers, Sergey

Hi Andrea,

I write the following snippet to configure service and port to enable schema validation  :

<bean id="{http://apache.org/hello_world_soap_http}SOAPService" class="org.apache.cxf.service.ServiceImpl">
        <property name="enableSchemaValidationForAllPorts" value="true"/>
</bean>

<bean id="{http://apache.org/hello_world_soap_http}SOAPPort" class="org.apache.cxf.endpoint.EndpointImpl">
        <property name="enableSchemaValidation" value="true"/>
</bean>

Is it the correct way ?

I have not found the code  to configure each operation in runtime. Is there any approach to configure operation like calling
configObject() to configure service ?

Thanks

Jim















Re: Enabling databinding schema validation configuration

Posted by Andrea Smyth <an...@iona.com>.
Hi Jim,

Jim Ma wrote:

>Hi Andrea,
>
>I write the following snippet to configure service and port to enable schema validation  :
>
><bean id="{http://apache.org/hello_world_soap_http}SOAPService" class="org.apache.cxf.service.ServiceImpl">
>        <property name="enableSchemaValidationForAllPorts" value="true"/>
></bean>
>  
>
This won't work as ServiceImpl does not have a setter for 
enableSchemaValidationForAllPorts, and no corresponding constructor 
either. More importantly, ServiceImpl is not meant to be constructed by 
the container.

><bean id="{http://apache.org/hello_world_soap_http}SOAPPort" class="org.apache.cxf.endpoint.EndpointImpl">
>        <property name="enableSchemaValidation" value="true"/>
></bean>   
>  
>
Same as above, EndpointImpl does not have a property named 
"enableSchemaValidation", and EndpointImpl instances cannot be 
instantiated by the container.
EndpointImpl however does have a property named "validation" - see 
org.apache.cxf.jaxws.ConfiguredEndpointTest and associated cfg file 
configured-endpoints.xml in module cxf-rt-frontend-jaxws. You should 
make this bean either lazy-init or abstract (and you can drop the 
classname).

>Is it the correct way ?  
>
>I have not found the code  to configure each operation in runtime. Is there any approach to configure operation like calling configObject() to configure service ?
>  
>
You could (programatically) store the "enableValidation" property in the 
OperationInfo's map and write code that retrieves it from there and if 
necessary performs the validation - this is not in place AFAIK.

Andrea.

>Thanks
>
>Jim 
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>  
>


Enabling databinding schema validation configuration

Posted by Jim Ma <ji...@iona.com>.
Hi Andrea,

I write the following snippet to configure service and port to enable schema validation  :

<bean id="{http://apache.org/hello_world_soap_http}SOAPService" class="org.apache.cxf.service.ServiceImpl">
        <property name="enableSchemaValidationForAllPorts" value="true"/>
</bean>

<bean id="{http://apache.org/hello_world_soap_http}SOAPPort" class="org.apache.cxf.endpoint.EndpointImpl">
        <property name="enableSchemaValidation" value="true"/>
</bean>   

Is it the correct way ?  

I have not found the code  to configure each operation in runtime. Is there any approach to configure operation like calling configObject() to configure service ?

Thanks

Jim