Fried,

I did find the docs in spring-remote that talked about
XFireClientFactoryBean, and it certainly sounds interesting, but this
is a production application and I'm not free to consider beta or
release candidates.  But as soon as 1.1 is officially released, I'll
be quick to download it.

One area of frustration though was that I couldn't find any useful
documentation or examples of using spring-remote, either for 1.0 or
1.1.  The website reiterates what you just said ("set up a client
real easily in a Spring application context"), but no examples of
detailed information about how to actually do it... What properties
do I set in order to configure the bean?  It states I have to set a
service class, a service url, username and password, but what are the
property names? or are they constructor args? Are there any other
configuration options I need to know about?  Hopefully this will
change when 1.1 is actually released.

As for the ?wsdl, it is actually part of my service URL (realizing
that this is probably wrong, IT DOES WORK).  I can certainly try to
remove it, though as a dynamic client, I don't have the the schema,
and am not interested in building the proxy classes from it if I
did.  I'm like a spoiled, little brat.. :-)

As a followup of my own, I found some examples for using the Client
class directly, that are truer to the dynamic client notes:

                xFire = XFireFactory.newInstance().getXFire();
                xFireFactory = new XFireProxyFactory(xFire);

                Client client = new Client(new URL(accountServiceUrl),
AccountManager.class);
                accountManagerProxy = (AccountManager) 
xFireFactory.create(client);

                Account ac = accountManagerProxy.getAccountByUsername(user);
                        
                if (exist && pass.equals(ac.getPassword()))
                        return true;

This seems a little cleaner, allows me to configure the username/
password properties, and uses the "Dynamic Client" approach, but in
fact this actually doesn't run at all.  On invoking the
getAccountByUsername() method, I get the following exception:

org.codehaus.xfire.fault.XFireFault: Could not find appropriate
operation!
        at org.codehaus.xfire.service.binding.RPCBinding.readMessage
(RPCBinding.java:42)
        at org.codehaus.xfire.soap.handler.SoapBodyHandler.invoke
(SoapBodyHandler.java:42)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke
(HandlerPipeline.java:98)
        at org.codehaus.xfire.client.Client.onReceive(Client.java:352)
        at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient
(HttpChannel.java:179)
        at org.codehaus.xfire.transport.http.HttpChannel.send
(HttpChannel.java:82)
        at org.codehaus.xfire.handler.OutMessageSender.invoke
(OutMessageSender.java:26)
        at org.codehaus.xfire.handler.HandlerPipeline.invoke
(HandlerPipeline.java:98)
        at org.codehaus.xfire.client.Client.invoke(Client.java:263)
        at org.codehaus.xfire.client.XFireProxy.handleRequest
(XFireProxy.java:77)
        at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
        . . . .

Any ideas here?  It seems again, like the WSDL isn't being read
property, since it can't find the operation defined.  Yet the
previous code does fine it...

Last question (forgive me, this is probably a dumb one...), how do I
enable debug logging for XFire (I guess its probably in the
log.properties file)?


Thanks,

Kyle



On May 11, 2006, at 12:38 PM, Fried Hoeben wrote:

Kyle,

This won't solve your problem, but just an advice if you are using
Spring: try using the new XFireClientFactoryBean. This should allow you
to set up a client real easily in a Spring application context.
It also allows very easy setup of username and password for the client.
Unfortunately it is not yet available in 1.0...

Fried

P.S. I would expect the accountServiceURL in your code does not actually contain the "?wsdl" part, since that is the wsdlURL not the URL for the
service.

Reply via email to