How to build WebService in Web applications with Xfire

Source: Internet
Author: User
Tags wsdl

1. Create a new Web project (no processing required)
2. Add the jar files required by Xfire
3. Configure Web. XML for details see my Space log
4. Create the Xfire framework publish file Services.xml, create the directory under the class folder:
Web-inf\classes\meta-inf\xfire\services.xml
5. SRC create interface and interface implementation class
6, modify the Services.xml, publish the service
Note: If your Web App uses the spring framework, you need to introduce Xbean-spring.jar
Unrecognized Xbean element mapping:services in namespace:
Http://xfire.codehaus.org/config/1.0 the solution to this problem is:
In the Services.xml file:

<beans xmlns="http://xfire.codehaus.org/config/1.0" >    <service>        </servie>    </bean>

Switch

<beans >    <service xmlns="http://xfire.codehaus.org/config/1.0">        </servie>    </bean>

When adding Xfire to a project, an error occurred as follows:
Org.xml.sax.SAXParseException:Document root element "Beans", must match DOCTYPE root "null ”.
Cause:
XFire 1.2 in Core libraries Spring-1.2.6.jar conflicts with Spring2 in the project.
FIX:
MyEclipse6.5 in
window->preferences->myeclipse Enterprise workbench->project capabilites- >web services-xfire
Select Spring-1.2.6.jar->remove->ok
Method Two:
You can also add a XFire framework to a common WEB project item by Right-click the project name >myeclipse>add XFire Web Service capabilities to make this project functional XFire project.
Common exceptions when integrating spring WebService with Xfire
1, Provider com.bea.xml.stream.MXParserFactory not found The reason is the missing jar package Wstx-asi.jar and Stax-api.jar
2, Java.lang.noclassdeffounderror:javax/wsdl/wsdlexception0 The reason is that Wsdl4j.jar
3 is missing, the servlet Xfireservlet is currently unavailable (Xfire error) when accessing the WSDL because of the lack of Xbean-spring.jar
4, Java.lang.classnotfoundexception:o Rg.apache.commons.fileupload.FileItemFactory reason is missing Commons-fileupload-1.2.1.jar
5, spring1.x

<?xml version="1.0" encoding="UTF-8"?>  <beans xmlns="http://www.springframework.org/schema/beans"    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"    xsi:schemaLocation="http://www.springframework.org/schema/beans    http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">  </beans>

attribute is not allowed in beans, should be

<?xml version="1.0" encoding="UTF-8"?>  <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" " http://www.springframework.org/dtd/spring-beans.dtd">  <beans></beans>

How to build WebService in Web applications with Xfire

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.