Hi,

I've been developing a WebService and wanted to test it with 
ApplicationComposer.

First, it seems that only EJB (@Stateless) endpoints can be injected into my 
test instance through @WebServiceRef. Is it correct?

If I remove @Stateless from my service, then I get the following error:

WARNING - Interceptor for 
{http://my.company.com/}DocumentGenerationService#{http://my.company.com/}generateDocument
 has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Could not send Message.
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:48)
        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
        at org.apache.cxf.endpoint.ClientImpl.doInvoke(ClientImpl.java:570)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:479)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:382)
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:335)
        at org.apache.cxf.frontend.ClientProxy.invokeSync(ClientProxy.java:96)
        at 
org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:136)
        at com.sun.proxy.$Proxy76.generateDocument(Unknown Source)
        at com.company.my.WebServiceTest.simpleTest(WebServiceTest.java:74)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at 
org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
        at 
org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
        at 
org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
        at 
org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
        at 
org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
        at 
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:44)
        at 
org.apache.openejb.junit.DeployApplication$1.call(DeployApplication.java:40)
        at 
org.apache.openejb.testing.ApplicationComposers.evaluate(ApplicationComposers.java:794)
        at 
org.apache.openejb.junit.DeployApplication.evaluate(DeployApplication.java:40)
        at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
        at 
org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
        at 
org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        at 
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
        at 
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: java.net.MalformedURLException: Invalid address. Endpoint address 
cannot be null.
        at 
org.apache.cxf.transport.http.HTTPConduit.getURL(HTTPConduit.java:758)
        at 
org.apache.cxf.transport.http.HTTPConduit.getURL(HTTPConduit.java:742)
        at 
org.apache.cxf.transport.http.HTTPConduit.setupURL(HTTPConduit.java:686)
        at 
org.apache.cxf.transport.http.HTTPConduit.prepare(HTTPConduit.java:476)
        at 
org.apache.cxf.interceptor.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:46)
        ... 37 more

Second, I can't get MTOM working.

I've added @MTOM, 
@BindingType(javax.xml.ws.soap.SOAPBinding.SOAP11HTTP_MTOM_BINDING) on both my 
SEI and my service bean, I'm using a @XmlMimeType("application/octet-stream") 
DataHandler in my response type but no attachment is created. (When I log my 
responses at the server-level through a SOAPHandler that calls 
SOAPMessageContext.getMessage().writeTo(), I see no attachment.)

I saw in ticket OPENEJB-972 that MTOM support may not work for EJB endpoint, is 
that correct?

Thanks,

Xavier

                                          

Reply via email to