You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Valerio Schiavoni <va...@gmail.com> on 2008/04/11 10:01:04 UTC

Using cxf with external web-services

Hello everyone,
suppose I want to write a client application to use the  meteo webservice at
this address:

http://www.webservicex.net/globalweather.asmx?WSDL

What are the steps to do so using CXF ?
I've been using wsdl2java to geneate java classes and interfaces, but it's
not quite clear how to combine such classes with cxf. In particular, up to
now I've been using cxf to generate clients using the
ClientProxyFactoryBean...or the DynamicClientfactory to generate the client.

So, help is very appreciated.

Cheers,
Valerio

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni

Re: Using cxf with external web-services

Posted by tmi <mi...@web.de>.
Have you already had a look at
http://cwiki.apache.org/CXF20DOC/a-simple-jax-ws-service.html ?


-- 
View this message in context: http://www.nabble.com/Using-cxf-with-external-web-services-tp16627061p16627305.html
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Using cxf with external web-services

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

The jaxws-api jar is missing of the classpath somehow.   That class comes 
from that jar.

Dan


On Friday 11 April 2008, Tim Perrett wrote:
> This interested me, as Im trying to get to grips with CXF.
>
> I just tried to put together a basic client (and even tried the WSDL
> below) but im getting odd problems when trying to run it. Even in its
> most simple form (very similar to the hello world on the wiki -
> http://cwiki.apache.org/CXF20DOC/developing-a-consumer.html ) I get
> this error:
>
> timperrett$ java com.timperrett.soap.temperature.App
> Starting...
> Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/
> ws/Service
>          at java.lang.ClassLoader.defineClass1(Native Method)
>          at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
>          at
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124
>) at java.net.URLClassLoader.defineClass(URLClassLoader.java:260) at
> java.net.URLClassLoader.access$100(URLClassLoader.java:56) at
> java.net.URLClassLoader$1.run(URLClassLoader.java:195) at
> java.security.AccessController.doPrivileged(Native Method) at
> java.net.URLClassLoader.findClass(URLClassLoader.java:188) at
> java.lang.ClassLoader.loadClass(ClassLoader.java:316) at
> sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 280)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:
> 374)
>          at com.timperrett.soap.temperature.App.main(App.java:31)
>
> Line 31 in my (extremely basic) application reads:
>
> 31: GlobalWeather weather = new GlobalWeather();
>
> I have all the relevant imports etc but still no joy - any ideas?
>
> Cheers
>
> Tim
>
> On 11 Apr 2008, at 16:37, Daniel Kulp wrote:
> > For the most part, you can just do:
> >
> > wsdl2java http://www.webservicex.net/globalweather.asmx?WSDL
> >
> > Then in your code, just do:
> >
> > GlobalWeather weather = new GlobalWeather();
> > GlobalWeatherSoap port = weather.getGlobalWeatherSoap();
> > String result = port.getWeather(city, country);



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog

Re: Using cxf with external web-services

Posted by Valerio Schiavoni <va...@gmail.com>.
Hello Glen,

On Sat, Apr 12, 2008 at 4:50 AM, Glen Mazza <gl...@verizon.net> wrote:

> Perhaps my client example may help you:
> http://www.jroller.com/gmazza/date/20070929
>

this helps, explaining the process step-by-step gives an insight that I was
somehow missing.

-- 
http://www.linkedin.com/in/vschiavoni
http://jroller.com/vschiavoni

Re: Using cxf with external web-services

Posted by Willem Jiang <wi...@gmail.com>.
There are the outputs of the Spring's logger which uses the common log, 
if you have the log4j jar in your class path, common log will pick them 
up. You may turn off the log by putting the log4j logger.property file 
in your class path and set the Spring logging level to WARNING.

Willem
Tim Perrett wrote:
> Awesome Glen, just the ticket!
>
> Oddly, my tester now works, although I get info messages output in the 
> terminal, despite my global CXF logging level set to WARNING?
> Its not really a massive problem, but just a bit disconcerting having 
> all that red output in eclipse. The messages Im getting are detailed 
> below.
>
> Any help would be awesome :-)
>
> Cheers, Tim
>
>
>
> Apr 12, 2008 12:44:57 PM 
> org.springframework.context.support.AbstractApplicationContext 
> prepareRefresh
> INFO: Refreshing 
> org.apache.cxf.bus.spring.BusApplicationContext@a084f8: display name 
> [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]; startup date 
> [Sat Apr 12 12:44:57 BST 2008]; root of context hierarchy
> Apr 12, 2008 12:44:57 PM 
> org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
> INFO: No cxf.xml configuration file detected, relying on defaults.
> Apr 12, 2008 12:44:57 PM 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource 
> [META-INF/cxf/cxf.xml]
> Apr 12, 2008 12:44:57 PM 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource 
> [META-INF/cxf/cxf-extension-xml.xml]
> Apr 12, 2008 12:44:57 PM 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource 
> [META-INF/cxf/cxf-extension-http.xml]
> Apr 12, 2008 12:44:57 PM 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource 
> [META-INF/cxf/cxf-extension-soap.xml]
> Apr 12, 2008 12:44:57 PM 
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader 
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource 
> [META-INF/cxf/cxf-extension-jaxws.xml]
> Apr 12, 2008 12:44:57 PM 
> org.springframework.context.support.AbstractApplicationContext 
> obtainFreshBeanFactory
> INFO: Bean factory for application context 
> [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]: 
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1eef2c 
>
> Apr 12, 2008 12:44:58 PM 
> org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker 
> postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not 
> eligible for getting processed by all BeanPostProcessors (for example: 
> not eligible for auto-proxying)
> Apr 12, 2008 12:44:58 PM 
> org.springframework.context.support.AbstractApplicationContext$BeanPostProcessorChecker 
> postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is 
> not eligible for getting processed by all BeanPostProcessors (for 
> example: not eligible for auto-proxying)
> Apr 12, 2008 12:44:58 PM 
> org.springframework.beans.factory.support.DefaultListableBeanFactory 
> preInstantiateSingletons
> INFO: Pre-instantiating singletons in 
> org.springframework.beans.factory.support.DefaultListableBeanFactory@1eef2c: 
> defining beans 
> [cxf,org.apache.cxf.bus.spring.Jsr250BeanPostProcessor,org.apache.cxf.bus.spring.BusExtensionPostProcessor,org.apache.cxf.resource.ResourceManager,org.apache.cxf.configuration.Configurer,org.apache.cxf.binding.BindingFactoryManager,org.apache.cxf.transport.DestinationFactoryManager,org.apache.cxf.transport.ConduitInitiatorManager,org.apache.cxf.wsdl.WSDLManager,org.apache.cxf.phase.PhaseManager,org.apache.cxf.workqueue.WorkQueueManager,org.apache.cxf.buslifecycle.BusLifeCycleManager,org.apache.cxf.endpoint.ServerRegistry,org.apache.cxf.endpoint.ServerLifeCycleManager,org.apache.cxf.endpoint.ClientLifeCycleManager,org.apache.cxf.transports.http.QueryHandlerRegistry,org.apache.cxf.endpoint.EndpointResolverRegistry,org.apache.cxf.headers.HeaderManager,org.apache.cxf.catalog.OASISCatalogManager,org.apache.cxf.endpoint.ServiceContractResolverRegistry,org.apache.cxf.binding.xml.XMLBindingFactory,org.apache.cxf.transport.http.policy.HTTPClientAssertionBuilder,org.apache.cxf.transport.http.policy.HTTPServerAssertionBuilder,org.apache.cxf.transport.http.ClientOnlyHTTPTransportFactory,org.apache.cxf.binding.soap.SoapBindingFactory,org.apache.cxf.binding.soap.SoapTransportFactory,org.apache.cxf.binding.soap.customEditorConfigurer,org.apache.cxf.jaxws.context.WebServiceContextResourceResolver,org.apache.cxf.jaxws.context.WebServiceContextImpl]; 
> root of factory hierarchy
> Apr 12, 2008 12:44:58 PM 
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean 
> buildServiceFromWSDL
> INFO: Creating Service 
> {http://webservices.daelab.net/temperature}TemperatureConversions from 
> WSDL: 
> file:/Users/timperrett/Documents/workspace/MyWeatherDemo/src/main/wsdl/temperature.wsdl 
>
>
>
> On 12 Apr 2008, at 03:50, Glen Mazza wrote:
>> Perhaps my client example may help you:
>> http://www.jroller.com/gmazza/date/20070929
>>
>> Glen
>
>



Re: Using cxf with external web-services

Posted by Benson Margulies <bi...@gmail.com>.
Right. Spring calls commons-logging. Commons-logging will take log4j if
available, otherwise it will resort to j.u.l. CXF does not use
commons-logging, it just uses j.u.l unless you tell it otherwise.

You need to configure log4j, or tell commons-logging to use j.u.l, to get
control of those messages.


On Wed, Apr 16, 2008 at 6:37 PM, Glen Mazza <gl...@verizon.net> wrote:

> That issue came up recently on CXF-dev...I think the problem is that you
> are seeing *Spring framework* logging messages, not CXF's.  I believe
> you can configure your logging messages further, to filter Spring's as
> well, but have not researched this matter much.
>
> Glen
>
> Am Samstag, den 12.04.2008, 16:45 +0100 schrieb Tim Perrett:
> > Awesome Glen, just the ticket!
> >
> > Oddly, my tester now works, although I get info messages output in the
> > terminal, despite my global CXF logging level set to WARNING?
> > Its not really a massive problem, but just a bit disconcerting having
> > all that red output in eclipse. The messages Im getting are detailed
> > below.
> >
> > Any help would be awesome :-)
> >
> > Cheers, Tim
> >
> >
> >
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.context.support.AbstractApplicationContext
> > prepareRefresh
> > INFO: Refreshing
> > org.apache.cxf.bus.spring.BusApplicationContext@a084f8: display name
> > [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]; startup date
> > [Sat Apr 12 12:44:57 BST 2008]; root of context hierarchy
> > Apr 12, 2008 12:44:57 PM
> > org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
> > INFO: No cxf.xml configuration file detected, relying on defaults.
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> > loadBeanDefinitions
> > INFO: Loading XML bean definitions from class path resource [META-INF/
> > cxf/cxf.xml]
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> > loadBeanDefinitions
> > INFO: Loading XML bean definitions from class path resource [META-INF/
> > cxf/cxf-extension-xml.xml]
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> > loadBeanDefinitions
> > INFO: Loading XML bean definitions from class path resource [META-INF/
> > cxf/cxf-extension-http.xml]
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> > loadBeanDefinitions
> > INFO: Loading XML bean definitions from class path resource [META-INF/
> > cxf/cxf-extension-soap.xml]
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.beans.factory.xml.XmlBeanDefinitionReader
> > loadBeanDefinitions
> > INFO: Loading XML bean definitions from class path resource [META-INF/
> > cxf/cxf-extension-jaxws.xml]
> > Apr 12, 2008 12:44:57 PM
> > org.springframework.context.support.AbstractApplicationContext
> > obtainFreshBeanFactory
> > INFO: Bean factory for application context
> > [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]:
> > org
> > .springframework.beans.factory.support.DefaultListableBeanFactory@1eef2c
> > Apr 12, 2008 12:44:58 PM
> > org.springframework.context.support.AbstractApplicationContext
> > $BeanPostProcessorChecker postProcessAfterInitialization
> > INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not
> > eligible for getting processed by all BeanPostProcessors (for example:
> > not eligible for auto-proxying)
> > Apr 12, 2008 12:44:58 PM
> > org.springframework.context.support.AbstractApplicationContext
> > $BeanPostProcessorChecker postProcessAfterInitialization
> > INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is
> > not eligible for getting processed by all BeanPostProcessors (for
> > example: not eligible for auto-proxying)
> > Apr 12, 2008 12:44:58 PM
> > org.springframework.beans.factory.support.DefaultListableBeanFactory
> > preInstantiateSingletons
> > INFO: Pre-instantiating singletons in
> > org
> > .springframework
> > .beans.factory.support.DefaultListableBeanFactory@1eef2c: defining
> > beans
> > [cxf
> > ,org
> > .apache
> > .cxf
> > .bus
> > .spring
> > .Jsr250BeanPostProcessor
> > ,org
> > .apache
> > .cxf
> > .bus
> > .spring
> > .BusExtensionPostProcessor
> > ,org
> > .apache
> > .cxf
> > .resource
> > .ResourceManager
> > ,org
> > .apache
> > .cxf
> > .configuration
> > .Configurer
> > ,org
> > .apache
> > .cxf
> > .binding
> > .BindingFactoryManager
> > ,org
> > .apache
> > .cxf
> > .transport
> > .DestinationFactoryManager
> > ,org
> > .apache
> > .cxf
> > .transport
> > .ConduitInitiatorManager
> > ,org
> > .apache
> > .cxf
> > .wsdl
> > .WSDLManager
> > ,org
> > .apache
> > .cxf
> > .phase
> > .PhaseManager
> > ,org
> > .apache
> > .cxf
> > .workqueue
> > .WorkQueueManager
> > ,org
> > .apache
> > .cxf
> > .buslifecycle
> > .BusLifeCycleManager
> > ,org
> > .apache
> > .cxf
> > .endpoint
> > .ServerRegistry
> > ,org
> > .apache
> > .cxf
> > .endpoint
> > .ServerLifeCycleManager
> > ,org
> > .apache
> > .cxf
> > .endpoint
> > .ClientLifeCycleManager
> > ,org
> > .apache
> > .cxf
> > .transports
> > .http
> > .QueryHandlerRegistry
> > ,org
> > .apache
> > .cxf
> > .endpoint
> > .EndpointResolverRegistry
> > ,org
> > .apache
> > .cxf
> > .headers
> > .HeaderManager
> > ,org
> > .apache
> > .cxf
> > .catalog
> > .OASISCatalogManager
> > ,org
> > .apache
> > .cxf
> > .endpoint
> > .ServiceContractResolverRegistry
> > ,org
> > .apache
> > .cxf
> > .binding
> > .xml
> > .XMLBindingFactory
> > ,org
> > .apache
> > .cxf
> > .transport
> > .http
> > .policy
> > .HTTPClientAssertionBuilder
> > ,org
> > .apache
> > .cxf
> > .transport
> > .http
> > .policy
> > .HTTPServerAssertionBuilder
> > ,org
> > .apache
> > .cxf
> > .transport
> > .http
> > .ClientOnlyHTTPTransportFactory
> > ,org
> > .apache
> > .cxf
> > .binding
> > .soap
> > .SoapBindingFactory
> > ,org
> > .apache
> > .cxf
> > .binding
> > .soap
> > .SoapTransportFactory
> > ,org
> > .apache
> > .cxf
> > .binding
> > .soap
> > .customEditorConfigurer
> > ,org
> > .apache
> > .cxf
> > .jaxws
> > .context
> > .WebServiceContextResourceResolver
> > ,org.apache.cxf.jaxws.context.WebServiceContextImpl]; root of factory
> > hierarchy
> > Apr 12, 2008 12:44:58 PM
> > org.apache.cxf.service.factory.ReflectionServiceFactoryBean
> > buildServiceFromWSDL
> > INFO: Creating Service {http://webservices.daelab.net/
> > temperature}TemperatureConversions from WSDL: file:/Users/timperrett/
> > Documents/workspace/MyWeatherDemo/src/main/wsdl/temperature.wsdl
> >
> >
> > On 12 Apr 2008, at 03:50, Glen Mazza wrote:
> > > Perhaps my client example may help you:
> > > http://www.jroller.com/gmazza/date/20070929
> > >
> > > Glen
> >
>
>

Re: Using cxf with external web-services

Posted by Tim Perrett <he...@timperrett.com>.
Hey Glen,

Thanks for your reply - William already replied with details on how to  
do that:

"There are the outputs of the Spring's logger which uses the common  
log, if you have the log4j jar in your class path, common log will  
pick them up. You may turn off the log by putting the log4j  
logger.property file in your class path and set the Spring logging  
level to WARNING."

Cheers, Tim

On 16 Apr 2008, at 23:37, Glen Mazza wrote:
> That issue came up recently on CXF-dev...I think the problem is that  
> you
> are seeing *Spring framework* logging messages, not CXF's.  I believe
> you can configure your logging messages further, to filter Spring's as
> well, but have not researched this matter much.


Re: Using cxf with external web-services

Posted by Glen Mazza <gl...@verizon.net>.
That issue came up recently on CXF-dev...I think the problem is that you
are seeing *Spring framework* logging messages, not CXF's.  I believe
you can configure your logging messages further, to filter Spring's as
well, but have not researched this matter much.

Glen

Am Samstag, den 12.04.2008, 16:45 +0100 schrieb Tim Perrett:
> Awesome Glen, just the ticket!
> 
> Oddly, my tester now works, although I get info messages output in the  
> terminal, despite my global CXF logging level set to WARNING?
> Its not really a massive problem, but just a bit disconcerting having  
> all that red output in eclipse. The messages Im getting are detailed  
> below.
> 
> Any help would be awesome :-)
> 
> Cheers, Tim
> 
> 
> 
> Apr 12, 2008 12:44:57 PM  
> org.springframework.context.support.AbstractApplicationContext  
> prepareRefresh
> INFO: Refreshing  
> org.apache.cxf.bus.spring.BusApplicationContext@a084f8: display name  
> [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]; startup date  
> [Sat Apr 12 12:44:57 BST 2008]; root of context hierarchy
> Apr 12, 2008 12:44:57 PM  
> org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
> INFO: No cxf.xml configuration file detected, relying on defaults.
> Apr 12, 2008 12:44:57 PM  
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource [META-INF/ 
> cxf/cxf.xml]
> Apr 12, 2008 12:44:57 PM  
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource [META-INF/ 
> cxf/cxf-extension-xml.xml]
> Apr 12, 2008 12:44:57 PM  
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource [META-INF/ 
> cxf/cxf-extension-http.xml]
> Apr 12, 2008 12:44:57 PM  
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource [META-INF/ 
> cxf/cxf-extension-soap.xml]
> Apr 12, 2008 12:44:57 PM  
> org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
> loadBeanDefinitions
> INFO: Loading XML bean definitions from class path resource [META-INF/ 
> cxf/cxf-extension-jaxws.xml]
> Apr 12, 2008 12:44:57 PM  
> org.springframework.context.support.AbstractApplicationContext  
> obtainFreshBeanFactory
> INFO: Bean factory for application context  
> [org.apache.cxf.bus.spring.BusApplicationContext@a084f8]:  
> org 
> .springframework.beans.factory.support.DefaultListableBeanFactory@1eef2c
> Apr 12, 2008 12:44:58 PM  
> org.springframework.context.support.AbstractApplicationContext 
> $BeanPostProcessorChecker postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not  
> eligible for getting processed by all BeanPostProcessors (for example:  
> not eligible for auto-proxying)
> Apr 12, 2008 12:44:58 PM  
> org.springframework.context.support.AbstractApplicationContext 
> $BeanPostProcessorChecker postProcessAfterInitialization
> INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is  
> not eligible for getting processed by all BeanPostProcessors (for  
> example: not eligible for auto-proxying)
> Apr 12, 2008 12:44:58 PM  
> org.springframework.beans.factory.support.DefaultListableBeanFactory  
> preInstantiateSingletons
> INFO: Pre-instantiating singletons in  
> org 
> .springframework 
> .beans.factory.support.DefaultListableBeanFactory@1eef2c: defining  
> beans  
> [cxf 
> ,org 
> .apache 
> .cxf 
> .bus 
> .spring 
> .Jsr250BeanPostProcessor 
> ,org 
> .apache 
> .cxf 
> .bus 
> .spring 
> .BusExtensionPostProcessor 
> ,org 
> .apache 
> .cxf 
> .resource 
> .ResourceManager 
> ,org 
> .apache 
> .cxf 
> .configuration 
> .Configurer 
> ,org 
> .apache 
> .cxf 
> .binding 
> .BindingFactoryManager 
> ,org 
> .apache 
> .cxf 
> .transport 
> .DestinationFactoryManager 
> ,org 
> .apache 
> .cxf 
> .transport 
> .ConduitInitiatorManager 
> ,org 
> .apache 
> .cxf 
> .wsdl 
> .WSDLManager 
> ,org 
> .apache 
> .cxf 
> .phase 
> .PhaseManager 
> ,org 
> .apache 
> .cxf 
> .workqueue 
> .WorkQueueManager 
> ,org 
> .apache 
> .cxf 
> .buslifecycle 
> .BusLifeCycleManager 
> ,org 
> .apache 
> .cxf 
> .endpoint 
> .ServerRegistry 
> ,org 
> .apache 
> .cxf 
> .endpoint 
> .ServerLifeCycleManager 
> ,org 
> .apache 
> .cxf 
> .endpoint 
> .ClientLifeCycleManager 
> ,org 
> .apache 
> .cxf 
> .transports 
> .http 
> .QueryHandlerRegistry 
> ,org 
> .apache 
> .cxf 
> .endpoint 
> .EndpointResolverRegistry 
> ,org 
> .apache 
> .cxf 
> .headers 
> .HeaderManager 
> ,org 
> .apache 
> .cxf 
> .catalog 
> .OASISCatalogManager 
> ,org 
> .apache 
> .cxf 
> .endpoint 
> .ServiceContractResolverRegistry 
> ,org 
> .apache 
> .cxf 
> .binding 
> .xml 
> .XMLBindingFactory 
> ,org 
> .apache 
> .cxf 
> .transport 
> .http 
> .policy 
> .HTTPClientAssertionBuilder 
> ,org 
> .apache 
> .cxf 
> .transport 
> .http 
> .policy 
> .HTTPServerAssertionBuilder 
> ,org 
> .apache 
> .cxf 
> .transport 
> .http 
> .ClientOnlyHTTPTransportFactory 
> ,org 
> .apache 
> .cxf 
> .binding 
> .soap 
> .SoapBindingFactory 
> ,org 
> .apache 
> .cxf 
> .binding 
> .soap 
> .SoapTransportFactory 
> ,org 
> .apache 
> .cxf 
> .binding 
> .soap 
> .customEditorConfigurer 
> ,org 
> .apache 
> .cxf 
> .jaxws 
> .context 
> .WebServiceContextResourceResolver 
> ,org.apache.cxf.jaxws.context.WebServiceContextImpl]; root of factory  
> hierarchy
> Apr 12, 2008 12:44:58 PM  
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean  
> buildServiceFromWSDL
> INFO: Creating Service {http://webservices.daelab.net/ 
> temperature}TemperatureConversions from WSDL: file:/Users/timperrett/ 
> Documents/workspace/MyWeatherDemo/src/main/wsdl/temperature.wsdl
> 
> 
> On 12 Apr 2008, at 03:50, Glen Mazza wrote:
> > Perhaps my client example may help you:
> > http://www.jroller.com/gmazza/date/20070929
> >
> > Glen
> 


Re: Using cxf with external web-services

Posted by Tim Perrett <he...@timperrett.com>.
Awesome Glen, just the ticket!

Oddly, my tester now works, although I get info messages output in the  
terminal, despite my global CXF logging level set to WARNING?
Its not really a massive problem, but just a bit disconcerting having  
all that red output in eclipse. The messages Im getting are detailed  
below.

Any help would be awesome :-)

Cheers, Tim



Apr 12, 2008 12:44:57 PM  
org.springframework.context.support.AbstractApplicationContext  
prepareRefresh
INFO: Refreshing  
org.apache.cxf.bus.spring.BusApplicationContext@a084f8: display name  
[org.apache.cxf.bus.spring.BusApplicationContext@a084f8]; startup date  
[Sat Apr 12 12:44:57 BST 2008]; root of context hierarchy
Apr 12, 2008 12:44:57 PM  
org.apache.cxf.bus.spring.BusApplicationContext getConfigResources
INFO: No cxf.xml configuration file detected, relying on defaults.
Apr 12, 2008 12:44:57 PM  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/ 
cxf/cxf.xml]
Apr 12, 2008 12:44:57 PM  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/ 
cxf/cxf-extension-xml.xml]
Apr 12, 2008 12:44:57 PM  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/ 
cxf/cxf-extension-http.xml]
Apr 12, 2008 12:44:57 PM  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/ 
cxf/cxf-extension-soap.xml]
Apr 12, 2008 12:44:57 PM  
org.springframework.beans.factory.xml.XmlBeanDefinitionReader  
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource [META-INF/ 
cxf/cxf-extension-jaxws.xml]
Apr 12, 2008 12:44:57 PM  
org.springframework.context.support.AbstractApplicationContext  
obtainFreshBeanFactory
INFO: Bean factory for application context  
[org.apache.cxf.bus.spring.BusApplicationContext@a084f8]:  
org 
.springframework.beans.factory.support.DefaultListableBeanFactory@1eef2c
Apr 12, 2008 12:44:58 PM  
org.springframework.context.support.AbstractApplicationContext 
$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.Jsr250BeanPostProcessor' is not  
eligible for getting processed by all BeanPostProcessors (for example:  
not eligible for auto-proxying)
Apr 12, 2008 12:44:58 PM  
org.springframework.context.support.AbstractApplicationContext 
$BeanPostProcessorChecker postProcessAfterInitialization
INFO: Bean 'org.apache.cxf.bus.spring.BusExtensionPostProcessor' is  
not eligible for getting processed by all BeanPostProcessors (for  
example: not eligible for auto-proxying)
Apr 12, 2008 12:44:58 PM  
org.springframework.beans.factory.support.DefaultListableBeanFactory  
preInstantiateSingletons
INFO: Pre-instantiating singletons in  
org 
.springframework 
.beans.factory.support.DefaultListableBeanFactory@1eef2c: defining  
beans  
[cxf 
,org 
.apache 
.cxf 
.bus 
.spring 
.Jsr250BeanPostProcessor 
,org 
.apache 
.cxf 
.bus 
.spring 
.BusExtensionPostProcessor 
,org 
.apache 
.cxf 
.resource 
.ResourceManager 
,org 
.apache 
.cxf 
.configuration 
.Configurer 
,org 
.apache 
.cxf 
.binding 
.BindingFactoryManager 
,org 
.apache 
.cxf 
.transport 
.DestinationFactoryManager 
,org 
.apache 
.cxf 
.transport 
.ConduitInitiatorManager 
,org 
.apache 
.cxf 
.wsdl 
.WSDLManager 
,org 
.apache 
.cxf 
.phase 
.PhaseManager 
,org 
.apache 
.cxf 
.workqueue 
.WorkQueueManager 
,org 
.apache 
.cxf 
.buslifecycle 
.BusLifeCycleManager 
,org 
.apache 
.cxf 
.endpoint 
.ServerRegistry 
,org 
.apache 
.cxf 
.endpoint 
.ServerLifeCycleManager 
,org 
.apache 
.cxf 
.endpoint 
.ClientLifeCycleManager 
,org 
.apache 
.cxf 
.transports 
.http 
.QueryHandlerRegistry 
,org 
.apache 
.cxf 
.endpoint 
.EndpointResolverRegistry 
,org 
.apache 
.cxf 
.headers 
.HeaderManager 
,org 
.apache 
.cxf 
.catalog 
.OASISCatalogManager 
,org 
.apache 
.cxf 
.endpoint 
.ServiceContractResolverRegistry 
,org 
.apache 
.cxf 
.binding 
.xml 
.XMLBindingFactory 
,org 
.apache 
.cxf 
.transport 
.http 
.policy 
.HTTPClientAssertionBuilder 
,org 
.apache 
.cxf 
.transport 
.http 
.policy 
.HTTPServerAssertionBuilder 
,org 
.apache 
.cxf 
.transport 
.http 
.ClientOnlyHTTPTransportFactory 
,org 
.apache 
.cxf 
.binding 
.soap 
.SoapBindingFactory 
,org 
.apache 
.cxf 
.binding 
.soap 
.SoapTransportFactory 
,org 
.apache 
.cxf 
.binding 
.soap 
.customEditorConfigurer 
,org 
.apache 
.cxf 
.jaxws 
.context 
.WebServiceContextResourceResolver 
,org.apache.cxf.jaxws.context.WebServiceContextImpl]; root of factory  
hierarchy
Apr 12, 2008 12:44:58 PM  
org.apache.cxf.service.factory.ReflectionServiceFactoryBean  
buildServiceFromWSDL
INFO: Creating Service {http://webservices.daelab.net/ 
temperature}TemperatureConversions from WSDL: file:/Users/timperrett/ 
Documents/workspace/MyWeatherDemo/src/main/wsdl/temperature.wsdl


On 12 Apr 2008, at 03:50, Glen Mazza wrote:
> Perhaps my client example may help you:
> http://www.jroller.com/gmazza/date/20070929
>
> Glen


Re: Using cxf with external web-services

Posted by Glen Mazza <gl...@verizon.net>.
Perhaps my client example may help you:
http://www.jroller.com/gmazza/date/20070929

Glen

Am Freitag, den 11.04.2008, 18:21 +0100 schrieb Tim Perrett:
> This interested me, as Im trying to get to grips with CXF.
> 
> I just tried to put together a basic client (and even tried the WSDL  
> below) but im getting odd problems when trying to run it. Even in its  
> most simple form (very similar to the hello world on the wiki - http://cwiki.apache.org/CXF20DOC/developing-a-consumer.html 
>   ) I get this error:
> 
> timperrett$ java com.timperrett.soap.temperature.App
> Starting...
> Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ 
> ws/Service
>          at java.lang.ClassLoader.defineClass1(Native Method)
>          at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
>          at  
> java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
>          at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
>          at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
>          at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
>          at java.security.AccessController.doPrivileged(Native Method)
>          at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
>          at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 
> 280)
>          at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
>          at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 
> 374)
>          at com.timperrett.soap.temperature.App.main(App.java:31)
> 
> Line 31 in my (extremely basic) application reads:
> 
> 31: GlobalWeather weather = new GlobalWeather();
> 
> I have all the relevant imports etc but still no joy - any ideas?
> 
> Cheers
> 
> Tim
> 
> 
> 
> 
> On 11 Apr 2008, at 16:37, Daniel Kulp wrote:
> >
> > For the most part, you can just do:
> >
> > wsdl2java http://www.webservicex.net/globalweather.asmx?WSDL
> >
> > Then in your code, just do:
> >
> > GlobalWeather weather = new GlobalWeather();
> > GlobalWeatherSoap port = weather.getGlobalWeatherSoap();
> > String result = port.getWeather(city, country);
> 


Re: Using cxf with external web-services

Posted by Tim Perrett <he...@timperrett.com>.
This interested me, as Im trying to get to grips with CXF.

I just tried to put together a basic client (and even tried the WSDL  
below) but im getting odd problems when trying to run it. Even in its  
most simple form (very similar to the hello world on the wiki - http://cwiki.apache.org/CXF20DOC/developing-a-consumer.html 
  ) I get this error:

timperrett$ java com.timperrett.soap.temperature.App
Starting...
Exception in thread "main" java.lang.NoClassDefFoundError: javax/xml/ 
ws/Service
         at java.lang.ClassLoader.defineClass1(Native Method)
         at java.lang.ClassLoader.defineClass(ClassLoader.java:675)
         at  
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
         at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
         at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
         at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:316)
         at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java: 
280)
         at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
         at java.lang.ClassLoader.loadClassInternal(ClassLoader.java: 
374)
         at com.timperrett.soap.temperature.App.main(App.java:31)

Line 31 in my (extremely basic) application reads:

31: GlobalWeather weather = new GlobalWeather();

I have all the relevant imports etc but still no joy - any ideas?

Cheers

Tim




On 11 Apr 2008, at 16:37, Daniel Kulp wrote:
>
> For the most part, you can just do:
>
> wsdl2java http://www.webservicex.net/globalweather.asmx?WSDL
>
> Then in your code, just do:
>
> GlobalWeather weather = new GlobalWeather();
> GlobalWeatherSoap port = weather.getGlobalWeatherSoap();
> String result = port.getWeather(city, country);


Re: Using cxf with external web-services

Posted by Daniel Kulp <dk...@apache.org>.
For the most part, you can just do:

wsdl2java http://www.webservicex.net/globalweather.asmx?WSDL

Then in your code, just do:

GlobalWeather weather = new GlobalWeather();
GlobalWeatherSoap port = weather.getGlobalWeatherSoap();
String result = port.getWeather(city, country);


Dan



On Friday 11 April 2008, Valerio Schiavoni wrote:
> Hello everyone,
> suppose I want to write a client application to use the  meteo
> webservice at this address:
>
> http://www.webservicex.net/globalweather.asmx?WSDL
>
> What are the steps to do so using CXF ?
> I've been using wsdl2java to geneate java classes and interfaces, but
> it's not quite clear how to combine such classes with cxf. In
> particular, up to now I've been using cxf to generate clients using
> the
> ClientProxyFactoryBean...or the DynamicClientfactory to generate the
> client.
>
> So, help is very appreciated.
>
> Cheers,
> Valerio



-- 
J. Daniel Kulp
Principal Engineer, IONA
dkulp@apache.org
http://www.dankulp.com/blog