DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Coding
  3. Frameworks
  4. Configuring Spring Beans with CXF

Configuring Spring Beans with CXF

Sandeep Bhandari user avatar by
Sandeep Bhandari
·
May. 12, 11 · Interview
Like (0)
Save
Tweet
Share
7.50K Views

Join the DZone community and get the full member experience.

Join For Free

The Spring IoC can be used to initialize web service implementation classes in CXF.xml. This also means that Soring beans initialized using beanfactory or applicationcontext are also available in CXF configuration.


Thus a datasource or DAO bean initialized by the regulaar spring configuration can be injected into the CXF implementation classes. By CXF implementation class, I mean the SOAP or REST based web service implementation class.

Here is an example of how to initialize the DAO and then inject that DAO bean to the web service class using the CXF.xml

app-context.xml

<beans>
- - - - - - - - - -
- - - - - - - - -
<bean class="com.company.app.SampleDAO" id="sampleDAO">
<property name="sampleDAO">
<ref bean="sampleDAO" />
</property>
</bean>
</beans>
CXF.xml
<bean class="com.company.app.SampleService" id="sampleWebService">
<property name="sampleDAO">
<ref bean="sampleDAO"/>
</property>
</bean>

From http://extreme-java.blogspot.com/2011/05/configuring-spring-beans-with-cxf.html

Spring Framework

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Asynchronous Messaging Service
  • REST vs. Messaging for Microservices
  • Use AWS Controllers for Kubernetes To Deploy a Serverless Data Processing Solution With SQS, Lambda, and DynamoDB
  • What Are the Benefits of Java Module With Example

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: