You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Lee Theobald <Le...@openobjects.com> on 2007/08/09 12:33:33 UTC

Accesiing A CXF Service From XFire 1.* Code

Hi all,

Does anyone know if there would be any problems accessing a service exposed
using CXF using XFire  1.* code?

I've created a service that has two methods:


log(String, Date, String, Int)
logMultiple(List)

LogEntry is a POJO I have created myself.  When I call the log method, all
is fine and it works as I expected.  But when I try the logMultiple method,
I hit some problems.  The code that is sending out the request sends out a
list of LogEntry classes but when it gets to my web service that list is
always empty?!?

Does anyone have any clue why this might be happening?  I'm still looking
into it now but I don't want to waste a whole day on this.

Here's the XFire 1.* code I'm using to send off my request to the service...


private ISearchLogger getService() throws MalformedURLException {
  synchronized (this) {
    if (service == null) {
      Service serviceModel = new ObjectServiceFactory()
          .create(ISearchLogger.class);
      service = (ISearchLogger) new XFireProxyFactory().create(serviceModel,
          this.loggingServiceUrl);
      Client client = ((XFireProxy) Proxy.getInvocationHandler(service))
          .getClient();
      client.setTimeout(loggingServiceTimeout);
    }
    return service;
  }
}

private void sendLogEntries2(int num) {
    List entries = new ArrayList();
    for (int i = 0; i < num; i++) {
      entries.add(getEntryFromQueue());
    }

    try {
      if (entries.size() > 0) {
        LOGGER.debug("Sending queued log entries...");
        getService().logMultipleEntries(entries);
      }
    } catch (MalformedURLException e) {
      LOGGER.error(e);
    }
  }

Thanks for any input,

Lee

-- 
View this message in context: http://www.nabble.com/Accesiing-A-CXF-Service-From-XFire-1.*-Code-tf4241862.html#a12070095
Sent from the cxf-user mailing list archive at Nabble.com.

RE: Accesiing A CXF Service From XFire 1.* Code

Posted by Velidanda Srinivas <sr...@singularity.co.uk>.
Is there a way to get service list using cxf APIs.

I mean once the dynamic client is created, from the client
can I get the list service methods available with the wsdl.

Please post sample code if available.

> -----Original Message-----
> From: Lee Theobald [mailto:Lee@openobjects.com]
> Sent: 20 August 2007 13:39
> To: cxf-user@incubator.apache.org
> Subject: Re: Accesiing A CXF Service From XFire 1.* Code
> 
> 
> 
> Hi Dan,
> 
> Sorry I took a long time to reply but using the 2.0.1 release fixed my
> problem.  So thanks a lot!
> 
> Lee,
> 
> 
> dkulp wrote:
> > 
> > Any chance you could test with the 2.0.1 release candidate 
> (being voted 
> > on now):
> > 
> http://people.apache.org/~dkulp/stage_cxf/2.0.1-incubator_take3/dist/
> > 
> -- 
> View this message in context: 
> http://www.nabble.com/Accesiing-A-CXF-Service-From-XFire-1.*-C
ode-tf4241862.html#a12231687
Sent from the cxf-user mailing list archive at Nabble.com.


________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.
________________________________________________________________________

________________________________________________________________________
This e-mail has been scanned for all viruses by MessageLabs.

To learn more about Singularity's business process management solutions and services please visit:
www.singularity.co.uk 
www.singularity.us.com
Singularity operates globally through its offices in New York, London, Singapore, Ireland and India. Singularity Limited is incorporated in the United Kingdom with Registration Number NI 31519 and its Registered Office at 100 Patrick Street, Derry, BT48 7EL, United Kingdom.

Re: Accesiing A CXF Service From XFire 1.* Code

Posted by Lee Theobald <Le...@openobjects.com>.
Hi Dan,

Sorry I took a long time to reply but using the 2.0.1 release fixed my
problem.  So thanks a lot!

Lee,


dkulp wrote:
> 
> Any chance you could test with the 2.0.1 release candidate (being voted 
> on now):
> http://people.apache.org/~dkulp/stage_cxf/2.0.1-incubator_take3/dist/
> 
-- 
View this message in context: http://www.nabble.com/Accesiing-A-CXF-Service-From-XFire-1.*-Code-tf4241862.html#a12231687
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Accesiing A CXF Service From XFire 1.* Code

Posted by Lee Theobald <Le...@openobjects.com>.

dkulp wrote:
> 
> Any chance you could test with the 2.0.1 release candidate (being voted 
> on now):
> http://people.apache.org/~dkulp/stage_cxf/2.0.1-incubator_take3/dist/
> 

Yes, I can do.  I'll give it a shot tomorrow and let you know how it goes.
-- 
View this message in context: http://www.nabble.com/Accesiing-A-CXF-Service-From-XFire-1.*-Code-tf4241862.html#a12074679
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Accesiing A CXF Service From XFire 1.* Code

Posted by Daniel Kulp <dk...@apache.org>.
Lee,

Any chance you could test with the 2.0.1 release candidate (being voted 
on now):
http://people.apache.org/~dkulp/stage_cxf/2.0.1-incubator_take3/dist/

There were a lot of "code first" use cases that were fixed in 2.0.1, 
especially around List/Array handling.

Dan



On Thursday 09 August 2007 06:33, Lee Theobald wrote:
> Hi all,
>
> Does anyone know if there would be any problems accessing a service
> exposed using CXF using XFire  1.* code?
>
> I've created a service that has two methods:
>
>
> log(String, Date, String, Int)
> logMultiple(List)
>
> LogEntry is a POJO I have created myself.  When I call the log method,
> all is fine and it works as I expected.  But when I try the
> logMultiple method, I hit some problems.  The code that is sending out
> the request sends out a list of LogEntry classes but when it gets to
> my web service that list is always empty?!?
>
> Does anyone have any clue why this might be happening?  I'm still
> looking into it now but I don't want to waste a whole day on this.
>
> Here's the XFire 1.* code I'm using to send off my request to the
> service...
>
>
> private ISearchLogger getService() throws MalformedURLException {
>   synchronized (this) {
>     if (service == null) {
>       Service serviceModel = new ObjectServiceFactory()
>           .create(ISearchLogger.class);
>       service = (ISearchLogger) new
> XFireProxyFactory().create(serviceModel, this.loggingServiceUrl);
>       Client client = ((XFireProxy)
> Proxy.getInvocationHandler(service)) .getClient();
>       client.setTimeout(loggingServiceTimeout);
>     }
>     return service;
>   }
> }
>
> private void sendLogEntries2(int num) {
>     List entries = new ArrayList();
>     for (int i = 0; i < num; i++) {
>       entries.add(getEntryFromQueue());
>     }
>
>     try {
>       if (entries.size() > 0) {
>         LOGGER.debug("Sending queued log entries...");
>         getService().logMultipleEntries(entries);
>       }
>     } catch (MalformedURLException e) {
>       LOGGER.error(e);
>     }
>   }
>
> Thanks for any input,
>
> Lee

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog