WTP1.0开辟WebService之操纵WSDL生成Service[Java编程]
本文“WTP1.0开辟WebService之操纵WSDL生成Service[Java编程]”是由七道奇为您精心收集,来源于网络转载,文章版权归文章作者所有,本站不对其观点以及内容做任何评价,请读者自行判断,以下是其具体内容:
1.肯定安装了Apache Tomcat(这里利用Tomcat5.0),新建一个dynamic Web project取名为 AreaProj.
2.示例中利用的WSDL文档.(该文档定义了一个计算长方形面积的服务)
AreaService.wsdl
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://tempuri.org/AreaService/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="AreaService"
targetNamespace="http://tempuri.org/AreaService/">
<wsdl:types>
<xsd:schema targetNamespace=http://tempuri.org/AreaService/
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="area" type="xsd:float"/>
<xsd:element name="parameters" type="tns:dimensions"/>
<xsd:complexType name="dimensions">
<xsd:sequence>
<xsd:element name="width" type="xsd:float"></xsd:element>
<xsd:element name="height" type="xsd:float"></xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="CalculateRectAreaResponse">
<wsdl:part element="tns:area" name="area"/>
</wsdl:message>
<wsdl:message name="CalculateRectAreaRequest">
<wsdl:part element="tns:parameters" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AreaService">
<wsdl:operation name="CalculateRectArea">
<wsdl:input message="tns:CalculateRectAreaRequest"/>
<wsdl:output message="tns:CalculateRectAreaResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AreaServiceSOAP" type="tns:AreaService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="CalculateRectArea">
<soap:operation soapAction="http://tempuri.org/AreaService/NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AreaService">
<wsdl:port binding="tns:AreaServiceSOAP" name="AreaServiceSOAP">
<soap:address location="http://tempuri.org"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
以上是“WTP1.0开辟WebService之操纵WSDL生成Service[Java编程]”的内容,如果你对以上该文章内容感兴趣,你可以看看七道奇为您推荐以下文章:
本文地址: | 与您的QQ/BBS好友分享! |