hadoopСW
`
`
  • ע2018-09-13
  • l160
  • QQ3234520070
  • 360ö
  • ۽z0
  • 0
x21614؏ͣ1

美式足球的规则 :HanLPbweb servicesյ^̽B

#
lڣ2019-08-09 10:03
ǰ_2019󔵓BaI֪Pע]Ϣhanlp2.0汾l֪hanlp2.0汾֌Щµ׃ʂڿ܉õһЩhanlp2.0YõԒro@ƪPڌhanlpbweb servicesеµIJփ޸xՈע

www.dhkyo.com DƬDƬ51111.png



1. Apache Axis2ҪB

Apache Axis2 һNweb services֧SOAPWSDLfhЃɷNZԵČFքejavaFApache Axis2/JavaApache Axis2/C

Apache Axis2H֧SOAP1.1SOAP1.2fhͬr߀֧RESTLąfhApache Axis1Apache Axis2ӸЧ֧XMLʽݔdzǶ?߰ȫԺȶ?WS-SecurityWS-Addressing

Apache Axis2Ҫ12ȴռ??Ჿ4Web Services5֧MEPݔҎ6`Uչ7߷ԣ8MIJ9SMTPFTPݔӅfh֮ϣ10֧WSDLfhژstubsLգ11MϺ͔Uչ

2. HanLPbweb servicesյ^

1ʂ乤

axis2Ҫ\servletԱdtomcat≺C:\Program Files\apache-tomcat-7.0.92íh׃
Path=C:\Program Files\apache-tomcat-7.0.92\bin
daxis2binaryb≺C:\Program Files\axis2-1.7.9íh׃
AXIS2_HOME=C:\Program Files\axis2-1.7.9
Path=%AXIS2_HOME%\bin
2

½һserviceӷ

package service;

import com.hankcs.hanlp.HanLP;

public class AnyService {
// սӿں1
public String fun1(String text) {
if(text == null) {
return "";
}else {
return HanLP.XXX(text);
}
}
// սӿں2
public void fun2(String text) {
if(text == null) {
HanLP.XXX(text);
}
}
}
Զx₀սӿںȲԌHanLP

3services.xml

½һĿMETA-INFԓĿ½services.xmlļ޸ģݔ߅

<service name="AnyService">
<parameter name="ServiceClass">
service.AnyService
</parameter>
<messageReceivers>
<messageReceiver
mep="//www.w3.org/ns/wsdl/in-out"
class="org.apache.axis2.rpc.receivers.RPCMessageReceiver" />
<messageReceiver
mep="//www.w3.org/ns/wsdl/in-only"
class="org.apache.axis2.rpc.receivers.RPCInOnlyMessageReceiver" />
</messageReceivers>
</service>
AnyServiceԸQԼҪķQǷQcǰ߅xķQһ

4 ".aar"惦C:\Program Files\apache-tomcat-7.0.92\webapps\axis2\WEB-INF\services

5HanLPļhanlp.propertiesؐC:\Program Files\apache-tomcat-7.0.92\webapps\axis2\WEB-INF\classesHanLPdataĿλ

root=dataڵĿ
HanLPC:\Program Files\apache-tomcat-7.0.92\webapps\axis2\WEB-INF\classesĿŒļȻxȡ

5tomcatʹÞg[L

pC:\Program Files\apache-tomcat-7.0.92\binĿµstartup.batļڞg[Lַݔ

//localhost:8080/axis2/services/AnyService/fun1?text=ă

ϲg0 u0
DKHadoop߀e
؏
taiyuanzhou
·
·
  • ע2019-08-25
  • l2
  • QQ1259811303
  • ۽z0
  • 0
ɳl#
lڣ2019-08-25 09:15
ԇԇǺǺ

؏(0) ϲg(0)     u
ο