On Tuesday 09 December 2008 5:12:46 am cxfuser17 wrote:
> Using the hello world app I created, I tried using the wsdlLocation in the
> JaxWsProxyFactoryBean bean of my spring context file and had an exception
> thrown (stack trace below).  It looks like the code is making an assumption
> that my I have named my service "HelloWorldService" in the wsdl.  I changed
> the service name in the wsdl to HelloWorldService, rather than Services,
> and it was able to properly instantiate the bean. 

Either that or configure in the serviceName and endpointName attributes into 
JaxWsProxyFactoryBean config in the spring config.   

> However now when it 
> attempts to invoke the WS I get a java.net.MalformedURLException: unknown
> protocol: jms  It is attempting to use an HTTP conduit rather than a JMS.
> I'm assuming this is because the WSDL only specifies a soap:address.  Is
> there a way to configure the bean to use JMS instead when configuring from
> a wsdl?

With the releases, I don't think so.  Willem fixed a bug last week where the 
transportId wasn't being passed in properly.    That's now fixed, but that 
doesn't help with 2.1.3.

Right now, you probably would need to use a modified wsdl that defines a jms 
thing instead of the soap:address.    From one of the examples:

    <wsdl:service name="JMSGreeterService">
           <wsdl:port binding="tns:JMSGreeterPortBinding" name="GreeterPort">
               <jms:address
                   destinationStyle="queue"
                   jndiConnectionFactoryName="ConnectionFactory"
                   
jndiDestinationName="dynamicQueues/test.cxf.jmstransport.queue">

                   <jms:JMSNamingProperty name="java.naming.factory.initial" 
value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
                   <jms:JMSNamingProperty name="java.naming.provider.url" 
value="tcp://localhost:61616"/>

              </jms:address>
           </wsdl:port>
    </wsdl:service>


Dan




>
> Thanks again for you help!
>
> -Chris
>
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> Could not find definition for service
> {http://mytest.org/hello_world}HelloWorldService.
>       at
> org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:114
>) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFro
>mWSDL(ReflectionServiceFactoryBean.java:312) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServi
>ceModel(ReflectionServiceFactoryBean.java:408) at
> org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(Reflecti
>onServiceFactoryBean.java:189) at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFac
>toryBean.java:164) at
> org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(Abs
>tractWSDLBasedEndpointFactory.java:100) at
> org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:52)
>       at
> org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBea
>n.java:102) at
> org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.jav
>a:115) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>       at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:3
>9) at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImp
>l.java:25) at java.lang.reflect.Method.invoke(Method.java:585)
>       at
> org.springframework.beans.factory.support.SimpleInstantiationStrategy.insta
>ntiate(SimpleInstantiationStrategy.java:118) at
> org.springframework.beans.factory.support.ConstructorResolver.instantiateUs
>ingFactoryMethod(ConstructorResolver.java:344) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:783)
> at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.createBeanInstance(AbstractAutowireCapableBeanFactory.java:710) at
> org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactor
>y.createBean(AbstractAutowireCapableBeanFactory.java:386) at
> org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(A
>bstractBeanFactory.java:249) at
> org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getS
>ingleton(DefaultSingletonBeanRegistry.java:155) at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>actBeanFactory.java:246) at
> org.springframework.beans.factory.support.AbstractBeanFactory.getBean(Abstr
>actBeanFactory.java:160) at
> org.springframework.beans.factory.support.DefaultListableBeanFactory.preIns
>tantiateSingletons(DefaultListableBeanFactory.java:291) at
> org.springframework.context.support.AbstractApplicationContext.refresh(Abst
>ractApplicationContext.java:352) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
>lassPathXmlApplicationContext.java:122) at
> org.springframework.context.support.ClassPathXmlApplicationContext.<init>(C
>lassPathXmlApplicationContext.java:66) at
> org.cxftest.jmsclient.App.main(App.java:30)
>
> dkulp wrote:
> > Thanks for the test case.   Big help.
> >
> > Basically, we're only binding the Async methods in when the client is
> > created
> > with a wsdl at runtime.   In your case, it's not using the wsdl.   If you
> > add
> > a wsdlLocation attribute to specify the location of the wsdl, it would
> > probably work.
> >
> > That said, it's definitely a bug and I have a fix that I'm going to test
> > overnight and hopefully commit in the morning.
> >
> > Dan
> >
> > On Monday 08 December 2008 6:41:44 pm cxfuser17 wrote:
> >> Thanks for the response Dan!
> >>
> >> I've tried the jaxws:client approach and had the same result.  I've
> >> attached a "hello world" example I threw together.
> >>
> >> If you look at the App.java, it starts an embedded broker, attempts to
> >> place a message on the queue with the Async method which immediately
> >> fails.
> >>  It then tries to use the synchronous 'blocking' approach which does
> >> work,
> >> although the client will time out as there is no 'server' to pick the
> >> message of the queue.
> >>
> >> You will have to generate the wsdl source from the wsdl with Maven.  Let
> >> me
> >> know what you think.
> >>
> >>
> >> http://www.nabble.com/file/p20906007/JmsAsyncTest.zip JmsAsyncTest.zip
> >
> > --
> > Daniel Kulp
> > [EMAIL PROTECTED]
> > http://dankulp.com/blog



-- 
Daniel Kulp
[EMAIL PROTECTED]
http://dankulp.com/blog

Reply via email to