手写Axis1.4发布WebService以及客户端调用

备忘,感觉Axis1比2好用,只要在一个配置文件里面写就可以了。
<?xml version="1.0" encoding="UTF-8"?>
<deployment xmlns="http://xml.apache.org/axis/wsdd/"
	xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
	<globalConfiguration>
		<parameter name="sendMultiRefs" value="true" />
		<parameter name="disablePrettyXML" value="true" />
		<parameter name="adminPassword" value="admin" />

		<parameter name="dotNetSoapEncFix" value="true" />
		<parameter name="enableNamespacePrefixOptimization" value="false" />
		<parameter name="sendXMLDeclaration" value="true" />
		<parameter name="sendXsiTypes" value="true" />
		<parameter name="attachments.implementation"
			value="org.apache.axis.attachments.AttachmentsImpl" />
		<requestFlow>
			<handler type="java:org.apache.axis.handlers.JWSHandler">
				<parameter name="scope" value="session" />
			</handler>
			<handler type="java:org.apache.axis.handlers.JWSHandler">
				<parameter name="scope" value="request" />
				<parameter name="extension" value=".jwr" />
			</handler>
		</requestFlow>
	</globalConfiguration>

	<handler name="LocalResponder"
		type="java:org.apache.axis.transport.local.LocalResponder" />
	<handler name="URLMapper" type="java:org.apache.axis.handlers.http.URLMapper" />
	<handler name="Authenticate"
		type="java:org.apache.axis.handlers.SimpleAuthenticationHandler" />
	<service name="AdminService" provider="java:MSG">
		<parameter name="allowedMethods" value="AdminService" />
		<parameter name="enableRemoteAdmin" value="false" />
		<parameter name="className" value="org.apache.axis.utils.Admin" />
		<namespace>http://xml.apache.org/axis/wsdd/</namespace>
	</service>

	<service name="Version" provider="java:RPC">
		<parameter name="allowedMethods" value="getVersion" />
		<parameter name="className" value="org.apache.axis.Version" />
	</service>
	<service name="SOAPMonitorService" provider="java:RPC">
		<parameter name="allowedMethods" value="publishMessage" />
		<parameter name="scope" value="Application" />
		<parameter name="className" value="org.apache.axis.monitor.SOAPMonitorService" />
	</service>

<!-- 配置自己发布的WebServices -->
	<service name="TestAxis1WebService" provider="java:RPC" style="wrapped"
		use="literal">
		<parameter name="className" value="com.gisinfo.web.ws.TestAxis1WebService" />
		<parameter name="allowedMethods" value="*" />
		<parameter name="scope" value="Application" />
		<namespace>http://ws.web.gisinfo.com</namespace>
	</service>


	<handler name="soapmonitor"
		type="java:org.apache.axis.handlers.SOAPMonitorHandler">
		<parameter name="wsdlURL" value="/axis/SOAPMonitorService-impl.wsdl" />
		<parameter name="serviceName" value="SOAPMonitorService" />
		<parameter name="namespace"
			value="http://tempuri.org/wsdl/2001/12/SOAPMonitorService-impl.wsdl" />
		<parameter name="portName" value="Demo" />
	</handler>
	<transport name="http">
		<requestFlow>
			<handler type="URLMapper" />
			<handler type="java:org.apache.axis.handlers.http.HTTPAuthHandler" />

			<!--comment following line for REMOVING wsdl spying via SOAPMonitor -->
			<handler type="soapmonitor" />
		</requestFlow>
		<responseFlow>
			<!--comment following line for REMOVING wsdl spying via SOAPMonitor -->
			<handler type="soapmonitor" />
		</responseFlow>
		<parameter name="qs:list"
			value="org.apache.axis.transport.http.QSListHandler" />
		<parameter name="qs:wsdl"
			value="org.apache.axis.transport.http.QSWSDLHandler" />
		<parameter name="qs.list"
			value="org.apache.axis.transport.http.QSListHandler" />
		<parameter name="qs.method"
			value="org.apache.axis.transport.http.QSMethodHandler" />
		<parameter name="qs:method"
			value="org.apache.axis.transport.http.QSMethodHandler" />
		<parameter name="qs.wsdl"
			value="org.apache.axis.transport.http.QSWSDLHandler" />
	</transport>
	<transport name="local">
		<responseFlow>
			<handler type="LocalResponder" />
		</responseFlow>
	</transport>
</deployment>

http://item.taobao.com/item.htm?id=16283195800&

你可能感兴趣的:(axis1.4)