How to configure WebService in SSH

Source: Internet
Author: User

Service. xml file, placed under the WEB-INF

<? XML version = "1.0" encoding = "UTF-8"?> <Br/> <! Doctype beans public "-// spring // DTD bean // en" "http://www.springframework.org/dtd/spring-beans.dtd"> <br/> <beans> <br/> <! -- All Web service information will be written here in the future. --> <Br/> <! -- Introduce xfire pre-configuration information --> <br/> <import resource = "classpath: ORG/codehaus/xfire/spring/xfire. xml"/> <br/> <! -- Define the access URL --> <br/> <Bean class = "org. springframework. web. servlet. handler. simpleurlhandlermapping "> <br/> <property name =" urlmap "> <br/> <map> <br/> <! -- Display the WebService access path. You need to configure several paths when there are several paths. --> <Br/> <Entry key = "/jbtm. ws"> <br/> <ref bean = "jbtmws"/> <! -- Corresponds to the following. --> <Br/> </entry> <br/> </map> <br/> </property> <br/> </bean> <br/> <! -- Use the xfire export tool --> <br/> <bean id = "basewebservice" class = "org. codehaus. xfire. spring. remoting. xfireexporter "lazy-init =" false "abstract =" true "> <br/> <! -- Reference the factory defined in xfire. xml --> <br/> <property name = "servicefactory" ref = "xfire. servicefactory"/> <br/> <! -- Reference xfire. xfire instance in XML --> <br/> <property name = "xfire" ref = "xfire"/> <br/> </bean> <br/> <bean id = "jbtmws" parent = "basewebservice"> <br/> <! -- The address of the service request, which corresponds to the URL accessed above --> <br/> <! -- Business service Bean --> <! -- Implementation class of the interface I defined --> <br/> <property name = "servicebean" ref = "jbtmserviceimpl"/> <! -- Corresponds to the spring configuration file --> <br/> <! -- Narrow Interface Class of Business Service Bean --> <! -- Interface I defined --> <br/> <property name = "serviceclass" value = "com. mainone. WebService. server. jbtmservice"/> <! -- Interface, implementation class interface --> <br/> </bean> <br/> </beans>

 

Applicationcontext. xml file injection:

<! -- Web Service --> <br/> <bean id = "jbtmserviceimpl" parent = "txproxytemplate"> <br/> <property name = "target"> <br/> <Bean class = "com. mainone. webService. server. jbtmserviceimpl "> <br/> <property name =" daoa "> <ref bean =" daoa "/> </property> <br/> <property name =" codesetservice "> <ref bean = "codesetservice"/> </property> <br/> <property name = "buyproductcommonservice"> <ref bean = "buyproductcommonservice"/> </property> <br /> <property name = "productcommonservice"> <ref bean = "productcommonservice"/> </property> <br/> </bean> <br/> </property> <br/> </bean>

 

 

Load the service. xml file in the web. xml file

<Context-param> <br/> <param-Name> contextconfiglocation </param-Name> <br/> <param-value>/WEB-INF/applicationcontext. XML,/WEB-INF/action-servlet.xml,/WEB-INF/service. XML </param-value> <br/> </context-param>

 

 

<! -- WebService --> <br/> <servlet-Name> xfireservlet </servlet-Name> <br/> <servlet-class> Org. codehaus. xfire. spring. xfirespringservlet </servlet-class> <br/> </servlet> <br/> <servlet-mapping> <br/> <servlet-Name> xfireservlet </servlet-Name> <br/> <URL-pattern>/servlet/xfireservlet/* </url-pattern> <br/> </servlet-mapping> <br/> <servlet-mapping> <br/> <servlet-Name> xfireservlet </servlet-Name> <br/> <URL-pattern>/services/* </url-pattern> <br/> </servlet-mapping>

This is the file to be configured. You need to introduce the jar package of spring-1.2.6 under Lib.

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.