Java Records-webservice Development deployment

Source: Internet
Author: User

JWS, Axis2, CXF

1. Download Axis2.war and Axis2.bin.zip

2. Deploy the Axis2.war package to Tomcat and start the Tomcat test: HTTP://LOCALHOST:8089/AXIS2

3. Create a new Web project, create a new class in src to write good code as a service side, without the package name, compile build. Class,

Copy to Tomcat\webapps\axis2\web-inf\pojo (new Pojo required)

4. Run http://localhost:8089/axis2/services/listServices to view the service name

5. Access to services: Http://localhost:8089/axis2/services/DataGetService

6. Client calls write class code and run HTTP://LOCALHOST:8089/AXIS2/SERVICES/DATAGETSERVICE?WSDL

# # #集成到ssmm The Web project, copy the Axis2-web to WebApp, and copy lib, conf, modules, services to Web-inf,

Spring-axis2.xml:
<?xml version= "1.0" encoding= "UTF-8"?>
<! DOCTYPE beans Public "-//spring//dtd bean//en"
"Http://www.springframework.org/dtd/spring-beans.dtd" >
<beans>
<bean id= "ApplicationContext" class= "Org.apache.axis2.extensions.spring.receivers.ApplicationContextHolder"/ >
<bean id= "HelloWorld" class= "Com.net.xinfang.axis2.server.HelloWorld" ></bean>
</beans>

web.xml join
<SERVLET>
Span style= "font-size:16px" ><SERVLET-NAME>AXISSERVLET</SERVLET-NAME>
<SERVLET-CLASS>ORG.APACHE.AXIS2.TRANSPORT.HTTP.AXISSERVLET</SERVLET-CLASS>
<LOAD-ON-STARTUP>2</LOAD-ON-STARTUP>
</SERVLET>
<servlet-mapping>
Span style= "font-size:16px" > <servlet-name>AxisServlet</servlet-name>
<url-pattern>/services/*</url-pattern>
</servlet-mapping>

New Hello under Services, new Servicedata.xml and Services.xml in Hello
Servicedata.xml
<?xml version= "1.0" encoding= "UTF-8"?>
<ServiceData>
</ServiceData>

Services.xml
<serviceGroup>
<service name= "HelloWorld" >
<description>
Test Service Example
</description>
<parameter name= "Serviceobjectsupplier" ><!--fixed--
Org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier
</parameter>
<parameter name= "springbeanname" >HelloWorld</parameter><!--Bean name --
<parameter name= "ServiceClass" >
Com.net.xinfang.service.HelloWorld
</parameter>
<messageReceivers>
<messagereceiver mep= "http://www.w3.org/2004/08/wsdl/in-only" class= " Org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver "/>
<messagereceiver mep= "Http://www.w3.org/2004/08/wsdl/in-out" class= " Org.apache.axis2.rpc.receivers.RPCMessageReceiver "/>
</messageReceivers>
</service>
</serviceGroup>
or

<service name= "HelloWorld" >
<description>
HelloWorld Service Example
</description>
<parameter name= "ServiceClass" >
Com.cm.service.HelloWorld
</parameter>
<operation name= "SayHello" >
<messagereceiver class= "Org.apache.axis2.rpc.receivers.RPCMessageReceiver"/>
</operation>
</service>

Java Records-webservice Development deployment

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.