You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jacob Marcus <ja...@gmail.com> on 2007/07/17 15:59:16 UTC

How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Hi all,

I am an xfire user who is used to the xfire services.xml. I am now porting
the services.xml to cxf.xml and have it working for a simple 'Hello World'
case.

I have a requirement to refer to beans defined else where in the cxf.xml.
XFire used to let me do this using the # convention.

Example : <serviceBean>#ihelloService</serviceBean>.

I tried a similar approach with cxf.  However, it cannot find the bean. Has
anybody tried this? Is this approach supported in cxf?

Thanks,
Jacob

Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by Jacob Marcus <ja...@gmail.com>.
Hi Willem/Dan,

Is this last change around the serviceBean? Because, I had tried it earlier
and it was not working.

There is one more issue in using the cxf.xml in this fashion. If I do not
refer to a bean using the # and instead give the class directly, it still
does not work.

For example, the following still does not work. The exception says "Could
not find destination factory for transport
http://schemas.xmlsoap.org/soap/http". This error happens only if you do not
have the dependency cxf-rt-transports-http-jetty. The behavior is different
if you have this dependency.

The only way I have been able to get the service fully functional without
cxf-rt-transports-http-jetty  is by embedding cxf in my spring config after
importing the necessary configs. Hope the information helps.

I would love to see the cxf.xml approach supported. The services.xml in
XFire was a convenient way of keeping the stuff away from my other spring
configs.

Thanks,
Jacob


<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:simple="http://cxf.apache.org/simple"
    xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://cxf.apache.org/simple
http://cxf.apache.org/schemas/simple.xsd">

    <simple:server id="Test" address="/hello"
        serviceClass="com.ironmountain.digital.erm.irmrap.cl.soap.util.Hello
">
        <simple:serviceBean>
            <bean
                class="
com.ironmountain.digital.erm.irmrap.cl.soap.util.HelloImpl" />
        </simple:serviceBean>

    </simple:server>
</beans>



On 7/18/07, Willem Jiang <ni...@iona.com> wrote:
>
> Hi Dan,
>
> I did some clean up of the simple front-end spring parser,
> Can you review my last commit (svn commit: r557161)?
>
> Thanks,
> Willem.
>
> Dan Diephouse wrote:
> > With the simple frontend its called a serviceBean:
> >
> > <simple:server id="Test" address="/hello"
> >     serviceBean="#helloService" serviceClass="com.test.Hello">
> > </simple:server>
> >
> > Cheers,
> >
> > - Dan
> >
> > On 7/17/07, Jacob Marcus <ja...@gmail.com> wrote:
> >>
> >> Hi Willem,
> >>
> >> I believe I am using version CXF incubator 2.0. The simple.xsd does not
> >> support implementor as an attribute. It does support implementor as an
> >> element. But it needs child elements.
> >>
> >> Should I be using a different version (snapshot) of  CXF?
> >>
> >> Thanks,
> >> Jacob
> >>
> >> On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
> >> >
> >> >
> >> > I think the spring syntext should be
> >> >   <simple:server id="Test" address="/hello"
> >> >     implementor="#helloService" serviceClass="com.test.Hello">
> >> >   </simple:server>
> >> >
> >> > Because I checked the trunk code, it only deals with the attribute
> >> > implementor now.
> >> >
> >> > Willem.
> >> >
> >> > -----Original Message-----
> >> > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> >> > Sent: Tue 7/17/2007 22:55
> >> > To: cxf-user@incubator.apache.org
> >> > Subject: Re: How can cxf.xml refer to beans defined in the
> application
> >> > context? (Xfire to CXF migration)
> >> >
> >> > I am using the Simple front end approach without annotations.
> >> >
> >> > <simple:server id="Test" address="/hello"
> >> >     serviceBean="#helloService" serviceClass="com.test.Hello">
> >> >   </simple:server>
> >> >
> >> > I think the problem is in the SpringBus. The CXFServlet does not
> >> seem to
> >> > have access to the ApplicationContext I have loaded using the
> >> > ContextLoaderLister in the web.xml
> >> >
> >> > Is there some additional configuration required?
> >> >
> >> > Thanks,
> >> > Jacob
> >> >
> >> > On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
> >> > >
> >> > > I think you could try to use the endpoint's attribute implementor.
> >> > > It should be workable with the # convention.
> >> > > Here is an example for it
> >> > > <jaxws:endpoint id="endpoint1"
> >> > >               implementor="#HelloService"
> >> > >               address="/services/Greeter1"/>
> >> > >
> >> > > Willem
> >> > >
> >> > >
> >> > > -----Original Message-----
> >> > > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> >> > > Sent: Tue 7/17/2007 21:59
> >> > > To: cxf-user@incubator.apache.org
> >> > > Subject: How can cxf.xml refer to beans defined in the application
> >> > > context? (Xfire to CXF migration)
> >> > >
> >> > > Hi all,
> >> > >
> >> > > I am an xfire user who is used to the xfire services.xml. I am now
> >> > porting
> >> > > the services.xml to cxf.xml and have it working for a simple 'Hello
> >> > World'
> >> > > case.
> >> > >
> >> > > I have a requirement to refer to beans defined else where in the
> >> cxf.xml
> >> > .
> >> > > XFire used to let me do this using the # convention.
> >> > >
> >> > > Example : <serviceBean>#ihelloService</serviceBean>.
> >> > >
> >> > > I tried a similar approach with cxf.  However, it cannot find the
> >> bean.
> >> > > Has
> >> > > anybody tried this? Is this approach supported in cxf?
> >> > >
> >> > > Thanks,
> >> > > Jacob
> >> > >
> >> > >
> >> > >
> >> >
> >> >
> >>
> >
> >
> >
>

Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by Willem Jiang <ni...@iona.com>.
Hi Dan,

I did some clean up of the simple front-end spring parser,
Can you review my last commit (svn commit: r557161)?

Thanks,
Willem.

Dan Diephouse wrote:
> With the simple frontend its called a serviceBean:
>
> <simple:server id="Test" address="/hello"
>     serviceBean="#helloService" serviceClass="com.test.Hello">
> </simple:server>
>
> Cheers,
>
> - Dan
>
> On 7/17/07, Jacob Marcus <ja...@gmail.com> wrote:
>>
>> Hi Willem,
>>
>> I believe I am using version CXF incubator 2.0. The simple.xsd does not
>> support implementor as an attribute. It does support implementor as an
>> element. But it needs child elements.
>>
>> Should I be using a different version (snapshot) of  CXF?
>>
>> Thanks,
>> Jacob
>>
>> On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
>> >
>> >
>> > I think the spring syntext should be
>> >   <simple:server id="Test" address="/hello"
>> >     implementor="#helloService" serviceClass="com.test.Hello">
>> >   </simple:server>
>> >
>> > Because I checked the trunk code, it only deals with the attribute
>> > implementor now.
>> >
>> > Willem.
>> >
>> > -----Original Message-----
>> > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
>> > Sent: Tue 7/17/2007 22:55
>> > To: cxf-user@incubator.apache.org
>> > Subject: Re: How can cxf.xml refer to beans defined in the application
>> > context? (Xfire to CXF migration)
>> >
>> > I am using the Simple front end approach without annotations.
>> >
>> > <simple:server id="Test" address="/hello"
>> >     serviceBean="#helloService" serviceClass="com.test.Hello">
>> >   </simple:server>
>> >
>> > I think the problem is in the SpringBus. The CXFServlet does not 
>> seem to
>> > have access to the ApplicationContext I have loaded using the
>> > ContextLoaderLister in the web.xml
>> >
>> > Is there some additional configuration required?
>> >
>> > Thanks,
>> > Jacob
>> >
>> > On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
>> > >
>> > > I think you could try to use the endpoint's attribute implementor.
>> > > It should be workable with the # convention.
>> > > Here is an example for it
>> > > <jaxws:endpoint id="endpoint1"
>> > >               implementor="#HelloService"
>> > >               address="/services/Greeter1"/>
>> > >
>> > > Willem
>> > >
>> > >
>> > > -----Original Message-----
>> > > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
>> > > Sent: Tue 7/17/2007 21:59
>> > > To: cxf-user@incubator.apache.org
>> > > Subject: How can cxf.xml refer to beans defined in the application
>> > > context? (Xfire to CXF migration)
>> > >
>> > > Hi all,
>> > >
>> > > I am an xfire user who is used to the xfire services.xml. I am now
>> > porting
>> > > the services.xml to cxf.xml and have it working for a simple 'Hello
>> > World'
>> > > case.
>> > >
>> > > I have a requirement to refer to beans defined else where in the
>> cxf.xml
>> > .
>> > > XFire used to let me do this using the # convention.
>> > >
>> > > Example : <serviceBean>#ihelloService</serviceBean>.
>> > >
>> > > I tried a similar approach with cxf.  However, it cannot find the
>> bean.
>> > > Has
>> > > anybody tried this? Is this approach supported in cxf?
>> > >
>> > > Thanks,
>> > > Jacob
>> > >
>> > >
>> > >
>> >
>> >
>>
>
>
>

Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by Dan Diephouse <da...@envoisolutions.com>.
With the simple frontend its called a serviceBean:

<simple:server id="Test" address="/hello"
     serviceBean="#helloService" serviceClass="com.test.Hello">
</simple:server>

Cheers,

- Dan

On 7/17/07, Jacob Marcus <ja...@gmail.com> wrote:
>
> Hi Willem,
>
> I believe I am using version CXF incubator 2.0. The simple.xsd does not
> support implementor as an attribute. It does support implementor as an
> element. But it needs child elements.
>
> Should I be using a different version (snapshot) of  CXF?
>
> Thanks,
> Jacob
>
> On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
> >
> >
> > I think the spring syntext should be
> >   <simple:server id="Test" address="/hello"
> >     implementor="#helloService" serviceClass="com.test.Hello">
> >   </simple:server>
> >
> > Because I checked the trunk code, it only deals with the attribute
> > implementor now.
> >
> > Willem.
> >
> > -----Original Message-----
> > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> > Sent: Tue 7/17/2007 22:55
> > To: cxf-user@incubator.apache.org
> > Subject: Re: How can cxf.xml refer to beans defined in the application
> > context? (Xfire to CXF migration)
> >
> > I am using the Simple front end approach without annotations.
> >
> > <simple:server id="Test" address="/hello"
> >     serviceBean="#helloService" serviceClass="com.test.Hello">
> >   </simple:server>
> >
> > I think the problem is in the SpringBus. The CXFServlet does not seem to
> > have access to the ApplicationContext I have loaded using the
> > ContextLoaderLister in the web.xml
> >
> > Is there some additional configuration required?
> >
> > Thanks,
> > Jacob
> >
> > On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
> > >
> > > I think you could try to use the endpoint's attribute implementor.
> > > It should be workable with the # convention.
> > > Here is an example for it
> > > <jaxws:endpoint id="endpoint1"
> > >               implementor="#HelloService"
> > >               address="/services/Greeter1"/>
> > >
> > > Willem
> > >
> > >
> > > -----Original Message-----
> > > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> > > Sent: Tue 7/17/2007 21:59
> > > To: cxf-user@incubator.apache.org
> > > Subject: How can cxf.xml refer to beans defined in the application
> > > context? (Xfire to CXF migration)
> > >
> > > Hi all,
> > >
> > > I am an xfire user who is used to the xfire services.xml. I am now
> > porting
> > > the services.xml to cxf.xml and have it working for a simple 'Hello
> > World'
> > > case.
> > >
> > > I have a requirement to refer to beans defined else where in the
> cxf.xml
> > .
> > > XFire used to let me do this using the # convention.
> > >
> > > Example : <serviceBean>#ihelloService</serviceBean>.
> > >
> > > I tried a similar approach with cxf.  However, it cannot find the
> bean.
> > > Has
> > > anybody tried this? Is this approach supported in cxf?
> > >
> > > Thanks,
> > > Jacob
> > >
> > >
> > >
> >
> >
>



-- 
Dan Diephouse
Envoi Solutions
http://envoisolutions.com | http://netzooid.com/blog

Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by Jacob Marcus <ja...@gmail.com>.
Hi Willem,

I believe I am using version CXF incubator 2.0. The simple.xsd does not
support implementor as an attribute. It does support implementor as an
element. But it needs child elements.

Should I be using a different version (snapshot) of  CXF?

Thanks,
Jacob

On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
>
>
> I think the spring syntext should be
>   <simple:server id="Test" address="/hello"
>     implementor="#helloService" serviceClass="com.test.Hello">
>   </simple:server>
>
> Because I checked the trunk code, it only deals with the attribute
> implementor now.
>
> Willem.
>
> -----Original Message-----
> From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> Sent: Tue 7/17/2007 22:55
> To: cxf-user@incubator.apache.org
> Subject: Re: How can cxf.xml refer to beans defined in the application
> context? (Xfire to CXF migration)
>
> I am using the Simple front end approach without annotations.
>
> <simple:server id="Test" address="/hello"
>     serviceBean="#helloService" serviceClass="com.test.Hello">
>   </simple:server>
>
> I think the problem is in the SpringBus. The CXFServlet does not seem to
> have access to the ApplicationContext I have loaded using the
> ContextLoaderLister in the web.xml
>
> Is there some additional configuration required?
>
> Thanks,
> Jacob
>
> On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
> >
> > I think you could try to use the endpoint's attribute implementor.
> > It should be workable with the # convention.
> > Here is an example for it
> > <jaxws:endpoint id="endpoint1"
> >               implementor="#HelloService"
> >               address="/services/Greeter1"/>
> >
> > Willem
> >
> >
> > -----Original Message-----
> > From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> > Sent: Tue 7/17/2007 21:59
> > To: cxf-user@incubator.apache.org
> > Subject: How can cxf.xml refer to beans defined in the application
> > context? (Xfire to CXF migration)
> >
> > Hi all,
> >
> > I am an xfire user who is used to the xfire services.xml. I am now
> porting
> > the services.xml to cxf.xml and have it working for a simple 'Hello
> World'
> > case.
> >
> > I have a requirement to refer to beans defined else where in the cxf.xml
> .
> > XFire used to let me do this using the # convention.
> >
> > Example : <serviceBean>#ihelloService</serviceBean>.
> >
> > I tried a similar approach with cxf.  However, it cannot find the bean.
> > Has
> > anybody tried this? Is this approach supported in cxf?
> >
> > Thanks,
> > Jacob
> >
> >
> >
>
>

RE: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
I think the spring syntext should be  
  <simple:server id="Test" address="/hello"
    implementor="#helloService" serviceClass="com.test.Hello">
  </simple:server>

Because I checked the trunk code, it only deals with the attribute implementor now.

Willem.

-----Original Message-----
From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
Sent: Tue 7/17/2007 22:55
To: cxf-user@incubator.apache.org
Subject: Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)
 
I am using the Simple front end approach without annotations.

<simple:server id="Test" address="/hello"
    serviceBean="#helloService" serviceClass="com.test.Hello">
  </simple:server>

I think the problem is in the SpringBus. The CXFServlet does not seem to
have access to the ApplicationContext I have loaded using the
ContextLoaderLister in the web.xml

Is there some additional configuration required?

Thanks,
Jacob

On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
>
> I think you could try to use the endpoint's attribute implementor.
> It should be workable with the # convention.
> Here is an example for it
> <jaxws:endpoint id="endpoint1"
>               implementor="#HelloService"
>               address="/services/Greeter1"/>
>
> Willem
>
>
> -----Original Message-----
> From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> Sent: Tue 7/17/2007 21:59
> To: cxf-user@incubator.apache.org
> Subject: How can cxf.xml refer to beans defined in the application
> context? (Xfire to CXF migration)
>
> Hi all,
>
> I am an xfire user who is used to the xfire services.xml. I am now porting
> the services.xml to cxf.xml and have it working for a simple 'Hello World'
> case.
>
> I have a requirement to refer to beans defined else where in the cxf.xml.
> XFire used to let me do this using the # convention.
>
> Example : <serviceBean>#ihelloService</serviceBean>.
>
> I tried a similar approach with cxf.  However, it cannot find the bean.
> Has
> anybody tried this? Is this approach supported in cxf?
>
> Thanks,
> Jacob
>
>
>


Re: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by Jacob Marcus <ja...@gmail.com>.
I am using the Simple front end approach without annotations.

<simple:server id="Test" address="/hello"
    serviceBean="#helloService" serviceClass="com.test.Hello">
  </simple:server>

I think the problem is in the SpringBus. The CXFServlet does not seem to
have access to the ApplicationContext I have loaded using the
ContextLoaderLister in the web.xml

Is there some additional configuration required?

Thanks,
Jacob

On 7/17/07, Jiang, Ning (Willem) <Ni...@iona.com> wrote:
>
> I think you could try to use the endpoint's attribute implementor.
> It should be workable with the # convention.
> Here is an example for it
> <jaxws:endpoint id="endpoint1"
>               implementor="#HelloService"
>               address="/services/Greeter1"/>
>
> Willem
>
>
> -----Original Message-----
> From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
> Sent: Tue 7/17/2007 21:59
> To: cxf-user@incubator.apache.org
> Subject: How can cxf.xml refer to beans defined in the application
> context? (Xfire to CXF migration)
>
> Hi all,
>
> I am an xfire user who is used to the xfire services.xml. I am now porting
> the services.xml to cxf.xml and have it working for a simple 'Hello World'
> case.
>
> I have a requirement to refer to beans defined else where in the cxf.xml.
> XFire used to let me do this using the # convention.
>
> Example : <serviceBean>#ihelloService</serviceBean>.
>
> I tried a similar approach with cxf.  However, it cannot find the bean.
> Has
> anybody tried this? Is this approach supported in cxf?
>
> Thanks,
> Jacob
>
>
>

RE: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)

Posted by "Jiang, Ning (Willem)" <Ni...@iona.com>.
I think you could try to use the endpoint's attribute implementor.
It should be workable with the # convention.
Here is an example for it 
<jaxws:endpoint id="endpoint1" 
              implementor="#HelloService"
              address="/services/Greeter1"/>

Willem


-----Original Message-----
From: Jacob Marcus [mailto:jacob.marcus@gmail.com]
Sent: Tue 7/17/2007 21:59
To: cxf-user@incubator.apache.org
Subject: How can cxf.xml refer to beans defined in the application context? (Xfire to CXF migration)
 
Hi all,

I am an xfire user who is used to the xfire services.xml. I am now porting
the services.xml to cxf.xml and have it working for a simple 'Hello World'
case.

I have a requirement to refer to beans defined else where in the cxf.xml.
XFire used to let me do this using the # convention.

Example : <serviceBean>#ihelloService</serviceBean>.

I tried a similar approach with cxf.  However, it cannot find the bean. Has
anybody tried this? Is this approach supported in cxf?

Thanks,
Jacob