RE: REST XPath

2007-06-20 Thread Shaw, Richard A
My service is as follows -


@WebService
public interface ChannelStoreRestService
{
 @Get
 @HttpResource(location = /rest/{xPathQuery})
 GetData getData(@WebParam(name = GetDataQuery) GetDataQuery query) throws 
GetDataFault;
}

My bean is -

@XmlRootElement(name = GetDataQuery) 
public class GetDataQuery
{
 private String xPathQuery;
 public String getXPathQuery()
 {
  return xPathQuery;
 }
 public void setXPathQuery(String _xPathQuery)
 {
  xPathQuery = _xPathQuery;
 }
}

My implementation looks like -

@WebService(endpointInterface = 
com.atkinsglobal.inform.channelstore.ChannelStoreRestService)
public class ChannelStoreRestImpl implements ChannelStoreRestService
{
 public GetData getData(GetDataQuery query) throws GetDataFault

And I create the service as follows -

// Publish the rest interface
ChannelStoreRestImpl restImpl = new ChannelStoreRestImpl(this);
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceClass(ChannelStoreRestService.class);
sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
sf.setAddress(channelStoreEndpointUrl + /xml/);
sf.getServiceFactory().setInvoker(new BeanInvoker(restImpl));
sf.getServiceFactory().setWrapped(false);
sf.create();


What isn't clear is which names need to match e.g. does the {} bit of 
/rest/{xPathQuery}) need to match xPathQuery in the bean ? 

 

BTW - I also get another error is I set my location to /{xPathQuery} - it 
says unexpected '/' at index 0.

Richard



From: Dan Diephouse [mailto:[EMAIL PROTECTED]
Sent: Tue 19/06/2007 19:05
To: cxf-user@incubator.apache.org
Subject: Re: REST  XPath



Can you paste what your annotated method and configuration code look like?
Its a bit hard to figure it out just based on the annotation. Thanks,
- Dan

On 6/19/07, Shaw, Richard A [EMAIL PROTECTED] wrote:

 I can't get this to work. I get the error below.

 I looked at the code and it seems to be something to do with XML schema.


 INFO: Interceptor has thrown exception, unwinding now
 java.lang.NullPointerException
 at org.apache.cxf.binding.http.IriDecoderHelper.buildDocument(
 IriDecoderHelper.java:213)
 at
 org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergeParams
 (URIParameterInInterceptor.java:129)
 at
 org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMessage
 (URIParameterInInterceptor.java:105)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
 PhaseInterceptorChain.java:147)
 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
 ChainInitiationObserver.java:63)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
 JettyHTTPDestination.java:253)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
 JettyHTTPDestination.java:213)
 at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
 JettyHTTPHandler.java:54)
 at org.mortbay.jetty.handler.ContextHandler.handle(
 ContextHandler.java:712)
 at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
 ContextHandlerCollection.java:211)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(
 HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:285)
 at org.mortbay.jetty.HttpConnection.handleRequest(
 HttpConnection.java:502)
 at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
 HttpConnection.java:821)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java
 :208)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java
 :378)
 at org.mortbay.io.nio.SelectChannelEndPoint.run(
 SelectChannelEndPoint.java:368)
 at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
 BoundedThreadPool.java:442)
 19-Jun-2007 14:37:17 sun.reflect.NativeMethodAccessorImpl invoke0
 SEVERE: EXCEPTION
 java.util.ConcurrentModificationException
 at java.util.AbstractList$Itr.checkForComodification(
 AbstractList.java:449)
 at java.util.AbstractList$ListItr.previous(AbstractList.java:463)
 at
 org.apache.cxf.phase.PhaseInterceptorChain$PhaseInterceptorIterator.previous
 (PhaseInterceptorChain.java:438)
 at org.apache.cxf.phase.PhaseInterceptorChain.unwind(
 PhaseInterceptorChain.java:231)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
 PhaseInterceptorChain.java:161)
 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
 ChainInitiationObserver.java:63)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(
 JettyHTTPDestination.java:253)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
 JettyHTTPDestination.java:213)
 at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
 JettyHTTPHandler.java:54)
 at org.mortbay.jetty.handler.ContextHandler.handle(
 

Re: cannot implement service using ProviderDataSource

2007-06-20 Thread Sergey Beryozkin

Hi

I remember adding a system test as part of the patch where a provider is parameterized with DataSource, I'm wondering is it still 
there ?


Cheers, Sergey
- Original Message - 
From: Conrad O'Dea [EMAIL PROTECTED]

To: cxf-user@incubator.apache.org
Sent: Wednesday, June 20, 2007 11:23 AM
Subject: cannot implement service using ProviderDataSource



Howdy,

I'm trying to create a service with ProviderDataSource which is
published using XML/HTTP.  I can publish the endpoint without problem
but invoking on the service does not work.

My Provider is declared as follows:

@WebServiceProvider(serviceName = FooProvider)
@ServiceMode(value = Service.Mode.MESSAGE)
@BindingType(value = http://cxf.apache.org/bindings/xformat;)
public class FooProvider implements ProviderDataSource {
 ...
 public DataSource invoke(DataSource msg) {
   ...
 }
}
When my client invokes on this endpoint (as simple GET will do), I get
the NPE below.  I've debugged through this and when CXF is building
the InterfaceInfo bean for the service, it is not recognizing the
invoke method of the Provider implementation.  This is because
JaxWsServiceFactoryBean.isValid calls
WebServiceProviderConfiguration.isOperation which (amongst other
things) checks:

  (Source.class.isAssignableFrom(method.getParameterTypes()[0])
  || SOAPMessage.class.isAssignableFrom(method.getParameterTypes()[0])

so it looks like DataSource is not supported.  This is something that
worked previously. Is there anything else I need to do to re-enable
DataSource?

thanks
Conrad


INFO: Interceptor has thrown exception, unwinding now

java.lang.NullPointerException

at 
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:92)

at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:51)

at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)

at 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:87)

at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206)

at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:67)

at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:253)

at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:213)

at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:54)

at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)

at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)

at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

at org.mortbay.jetty.Server.handle(Server.java:285)

at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)

at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)

at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)

at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)

at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442) 



IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland


Re: cannot implement service using ProviderDataSource

2007-06-20 Thread Conrad O'Dea

Hi Sergey,

On 6/20/07, Sergey Beryozkin [EMAIL PROTECTED] wrote:

Hi

I remember adding a system test as part of the patch where a provider is 
parameterized with DataSource, I'm wondering is it still
there ?


The only references to DataSource appear to be in relation to SwA
support and a ContextPropertiesMappingTest which does not look like
it's a system test. Do you remember where it lived?
BTW, I've created CXF-741 for this.



Cheers, Sergey
- Original Message -
From: Conrad O'Dea [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Wednesday, June 20, 2007 11:23 AM
Subject: cannot implement service using ProviderDataSource


 Howdy,

 I'm trying to create a service with ProviderDataSource which is
 published using XML/HTTP.  I can publish the endpoint without problem
 but invoking on the service does not work.

 My Provider is declared as follows:

 @WebServiceProvider(serviceName = FooProvider)
 @ServiceMode(value = Service.Mode.MESSAGE)
 @BindingType(value = http://cxf.apache.org/bindings/xformat;)
 public class FooProvider implements ProviderDataSource {
  ...
  public DataSource invoke(DataSource msg) {
...
  }
 }
 When my client invokes on this endpoint (as simple GET will do), I get
 the NPE below.  I've debugged through this and when CXF is building
 the InterfaceInfo bean for the service, it is not recognizing the
 invoke method of the Provider implementation.  This is because
 JaxWsServiceFactoryBean.isValid calls
 WebServiceProviderConfiguration.isOperation which (amongst other
 things) checks:

   (Source.class.isAssignableFrom(method.getParameterTypes()[0])
   || SOAPMessage.class.isAssignableFrom(method.getParameterTypes()[0])

 so it looks like DataSource is not supported.  This is something that
 worked previously. Is there anything else I need to do to re-enable
 DataSource?

 thanks
 Conrad


 INFO: Interceptor has thrown exception, unwinding now

 java.lang.NullPointerException

 at 
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:92)

 at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:51)

 at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)

 at 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

 at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:87)

 at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206)

 at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:67)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:253)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:213)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:54)

 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)

 at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)

 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

 at org.mortbay.jetty.Server.handle(Server.java:285)

 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)

 at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)

 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)

 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)

 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)

 at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)

 at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)


IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland



Re: cannot implement service using ProviderDataSource

2007-06-20 Thread Sergey Beryozkin

Hi

It's in

trunk/systests/src/test/java/org/apache/cxf/systest/provider/

AttachmentProviderXMLClientServerTest.java
AttachmentStreamSourceXMLProvider.java

Unfortunately this test does'not use DataSource as I thought

Cheers, Sergey

- Original Message - 
From: Conrad O'Dea [EMAIL PROTECTED]

To: cxf-user@incubator.apache.org
Sent: Wednesday, June 20, 2007 11:53 AM
Subject: Re: cannot implement service using ProviderDataSource



Hi Sergey,

On 6/20/07, Sergey Beryozkin [EMAIL PROTECTED] wrote:

Hi

I remember adding a system test as part of the patch where a provider is 
parameterized with DataSource, I'm wondering is it still
there ?


The only references to DataSource appear to be in relation to SwA
support and a ContextPropertiesMappingTest which does not look like
it's a system test. Do you remember where it lived?
BTW, I've created CXF-741 for this.



Cheers, Sergey
- Original Message -
From: Conrad O'Dea [EMAIL PROTECTED]
To: cxf-user@incubator.apache.org
Sent: Wednesday, June 20, 2007 11:23 AM
Subject: cannot implement service using ProviderDataSource


 Howdy,

 I'm trying to create a service with ProviderDataSource which is
 published using XML/HTTP.  I can publish the endpoint without problem
 but invoking on the service does not work.

 My Provider is declared as follows:

 @WebServiceProvider(serviceName = FooProvider)
 @ServiceMode(value = Service.Mode.MESSAGE)
 @BindingType(value = http://cxf.apache.org/bindings/xformat;)
 public class FooProvider implements ProviderDataSource {
  ...
  public DataSource invoke(DataSource msg) {
...
  }
 }
 When my client invokes on this endpoint (as simple GET will do), I get
 the NPE below.  I've debugged through this and when CXF is building
 the InterfaceInfo bean for the service, it is not recognizing the
 invoke method of the Provider implementation.  This is because
 JaxWsServiceFactoryBean.isValid calls
 WebServiceProviderConfiguration.isOperation which (amongst other
 things) checks:

   (Source.class.isAssignableFrom(method.getParameterTypes()[0])
   || SOAPMessage.class.isAssignableFrom(method.getParameterTypes()[0])

 so it looks like DataSource is not supported.  This is something that
 worked previously. Is there anything else I need to do to re-enable
 DataSource?

 thanks
 Conrad


 INFO: Interceptor has thrown exception, unwinding now

 java.lang.NullPointerException

 at 
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:92)

 at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:51)

 at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56)

 at 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37)

 at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:87)

 at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206)

 at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:67)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:253)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:213)

 at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:54)

 at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)

 at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211)

 at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)

 at org.mortbay.jetty.Server.handle(Server.java:285)

 at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)

 at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821)

 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)

 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)

 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)

 at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368)

 at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)


IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland




IONA Technologies PLC (registered in Ireland)
Registered Number: 171387
Registered Address: The IONA Building, Shelbourne Road, Dublin 4, Ireland


Re: REST XPath

2007-06-20 Thread Dan Diephouse

Willem: the test case that you raised fails for me. It really stems from a
problem with expectations about how wrapped mode should work. You're
operating in unwrapped mode. Which means that the expression in the brackets
{} is mapped to the field on the first parameter. That is, instead of this:

@HttpResource(location = /topics/{id})
public String getTopics(@WebParam(name = id) long id)

You actually want to do this:

@HttpResource(location = /topics/{id})
public String getTopics(GetTopics getTopics)

The first one will work in wrapped mode. The second one will work in
unwrapped mode.

Less than ideal, I know. I'll commit a fix shortly which gives a much better
error message. I'd like to give the HTTP Binding some big improvements for
2.1, but thats a post for another day.

Thanks,
- Dan

On 6/19/07, Willem Jiang [EMAIL PROTECTED] wrote:


Hi Dan

I also found a same NPE which just used the simple type as the method
parameter.

@Get
@HttpResource(location = /topics/{id})

public String getTopics(@WebParam(name = id) long id);

I had filled a JIRA [1] for  it.  If  you have  a time could have a look
at it.

[1]https://issues.apache.org/jira/browse/CXF-739


Willem.

Dan Diephouse wrote:
 Can you paste what your annotated method and configuration code look
 like?
 Its a bit hard to figure it out just based on the annotation. Thanks,
 - Dan

 On 6/19/07, Shaw, Richard A [EMAIL PROTECTED] wrote:

 I can't get this to work. I get the error below.

 I looked at the code and it seems to be something to do with XML
schema.


 INFO: Interceptor has thrown exception, unwinding now
 java.lang.NullPointerException
 at org.apache.cxf.binding.http.IriDecoderHelper.buildDocument(
 IriDecoderHelper.java:213)
 at

org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.mergeParams

 (URIParameterInInterceptor.java:129)
 at

org.apache.cxf.binding.http.interceptor.URIParameterInInterceptor.handleMessage

 (URIParameterInInterceptor.java:105)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
 PhaseInterceptorChain.java:147)
 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
 ChainInitiationObserver.java:63)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest
(
 JettyHTTPDestination.java:253)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
 JettyHTTPDestination.java:213)
 at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
 JettyHTTPHandler.java:54)
 at org.mortbay.jetty.handler.ContextHandler.handle(
 ContextHandler.java:712)
 at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
 ContextHandlerCollection.java:211)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(
 HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:285)
 at org.mortbay.jetty.HttpConnection.handleRequest(
 HttpConnection.java:502)
 at
 org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(
 HttpConnection.java:821)
 at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)
 at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java
 :208)
 at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java
 :378)
 at org.mortbay.io.nio.SelectChannelEndPoint.run(
 SelectChannelEndPoint.java:368)
 at org.mortbay.thread.BoundedThreadPool$PoolThread.run(
 BoundedThreadPool.java:442)
 19-Jun-2007 14:37:17 sun.reflect.NativeMethodAccessorImpl invoke0
 SEVERE: EXCEPTION
 java.util.ConcurrentModificationException
 at java.util.AbstractList$Itr.checkForComodification(
 AbstractList.java:449)
 at
 java.util.AbstractList$ListItr.previous(AbstractList.java:463)
 at

org.apache.cxf.phase.PhaseInterceptorChain$PhaseInterceptorIterator.previous

 (PhaseInterceptorChain.java:438)
 at org.apache.cxf.phase.PhaseInterceptorChain.unwind(
 PhaseInterceptorChain.java:231)
 at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(
 PhaseInterceptorChain.java:161)
 at org.apache.cxf.transport.ChainInitiationObserver.onMessage(
 ChainInitiationObserver.java:63)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest
(
 JettyHTTPDestination.java:253)
 at
 org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(
 JettyHTTPDestination.java:213)
 at org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(
 JettyHTTPHandler.java:54)
 at org.mortbay.jetty.handler.ContextHandler.handle(
 ContextHandler.java:712)
 at org.mortbay.jetty.handler.ContextHandlerCollection.handle(
 ContextHandlerCollection.java:211)
 at org.mortbay.jetty.handler.HandlerWrapper.handle(
 HandlerWrapper.java:139)
 at org.mortbay.jetty.Server.handle(Server.java:285)
 at org.mortbay.jetty.HttpConnection.handleRequest(
 HttpConnection.java:502)
 at
 

Re: Maven Java2WSDL Plugin

2007-06-20 Thread James Mao
One thing that i would like to mention, is that why the java2wsdl 
looking for the jaxws frontend,
It's that the MyService is annotated with the jaxws annotation, so the 
tool detected it should use the jaxws frontend to generate the wsdl.


If you feed a plain java class without any annotations, then the tool 
will automatically detect it's a simple frontend,
in that case, the jaxws dependency is not required, you can change it to 
the rt-simple frontend.


We should add an option to mandate which frontend to use(overwrite the 
default behavior), it will be the next release.


James


Thanks James. Adding that dependency to the plugin configuration did the
trick i.e.

build
   plugins 
 plugin

 groupIdorg.apache.cxf/groupId
 artifactIdcxf-codegen-plugin/artifactId
 version${cxfVersion}/version
 dependencies
dependency
   groupIdorg.apache.cxf/groupId
   artifactIdcxf-rt-frontend-jaxws/artifactId
   version${cxfVersion}/version
/dependency
 /dependencies
 executions
execution
   idgenerate-wsdl/id
   phaseprocess-classes/phase
   configuration
  className
 com.endeca.service.MyService
  /className
   /configuration
   goals
  goaljava2wsdl/goal
   /goals
/execution
 /executions
  /plugin
   /plugins
/build

-Joel

-Original Message-
From: James Mao [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, June 20, 2007 2:18 AM

To: cxf-user@incubator.apache.org
Subject: Re: Maven Java2WSDL Plugin

Forgot to tell you the reason,

We treat the frontend as a plugin in java2wsdl codegen-plugin now, so 
you have to put those dependencies in your pom.


The benefit of this mechanism is that java2wsdl is like a framework,
later if someone implement the jax-rpc , or some other front-ends, just 
put the artifact in your class-path, we don't need to change the tool 
itself.


James

  

It require the rt-jaxws frontend, and also need the rt-simple


frontend.
  

James


Joel Turkel wrote:


Hi,

 


I'm trying to use the latest snapshot of the Maven codegen plugin to
generate WSDL from a JAX-WS annotated class and I'm getting the
following error: Can not find the ServiceBulider for style: Jaxws.
Here's the plugin configuration from my pom.xml:

 


plugin

groupIdorg.apache.cxf/groupId

artifactIdcxf-codegen-plugin/artifactId

version2.0-incubator-SNAPSHOT/version

executions

execution

idgenerate-wsdl/id

phaseprocess-classes/phase

configuration

className

 
com.endeca.service.MyService


/className


/configuration

goals


  

goaljava2wsdl/goal
  

/goals

/execution

/executions

/plugin 
 


Perhaps the codegen plugin is missing the dependency to
cxf-rt-frontend-jaxws ?

 


Thanks,

Joel

 


Principal Software Engineer

Endeca Technologies


  
  


  


Re: cannot implement service using ProviderDataSource

2007-06-20 Thread Freeman Fang

Hi Conrad,

I will take care of this issue.
Cheers

Freeman

Conrad O'Dea wrote:

Howdy,

I'm trying to create a service with ProviderDataSource which is
published using XML/HTTP.  I can publish the endpoint without problem
but invoking on the service does not work.

My Provider is declared as follows:

@WebServiceProvider(serviceName = FooProvider)
@ServiceMode(value = Service.Mode.MESSAGE)
@BindingType(value = http://cxf.apache.org/bindings/xformat;)
public class FooProvider implements ProviderDataSource {
 ...
 public DataSource invoke(DataSource msg) {
   ...
 }
}
When my client invokes on this endpoint (as simple GET will do), I get
the NPE below.  I've debugged through this and when CXF is building
the InterfaceInfo bean for the service, it is not recognizing the
invoke method of the Provider implementation.  This is because
JaxWsServiceFactoryBean.isValid calls
WebServiceProviderConfiguration.isOperation which (amongst other
things) checks:

  (Source.class.isAssignableFrom(method.getParameterTypes()[0])
  || 
SOAPMessage.class.isAssignableFrom(method.getParameterTypes()[0])


so it looks like DataSource is not supported.  This is something that
worked previously. Is there anything else I need to do to re-enable
DataSource?

thanks
Conrad


INFO: Interceptor has thrown exception, unwinding now

java.lang.NullPointerException

at 
org.apache.cxf.frontend.SimpleMethodDispatcher.getMethod(SimpleMethodDispatcher.java:92) 



at 
org.apache.cxf.service.invoker.AbstractInvoker.invoke(AbstractInvoker.java:51) 



at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor$1.run(ServiceInvokerInterceptor.java:56) 



at 
org.apache.cxf.workqueue.SynchronousExecutor.execute(SynchronousExecutor.java:37) 



at 
org.apache.cxf.interceptor.ServiceInvokerInterceptor.handleMessage(ServiceInvokerInterceptor.java:87) 



at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:206) 



at 
org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:67) 



at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.serviceRequest(JettyHTTPDestination.java:253) 



at 
org.apache.cxf.transport.http_jetty.JettyHTTPDestination.doService(JettyHTTPDestination.java:213) 



at 
org.apache.cxf.transport.http_jetty.JettyHTTPHandler.handle(JettyHTTPHandler.java:54) 



at 
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)


at 
org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:211) 



at 
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)


at org.mortbay.jetty.Server.handle(Server.java:285)

at 
org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:502)


at 
org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:821) 



at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:513)

at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:208)

at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:378)

at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:368) 



at 
org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:442)