Types: 描述了所有请求参数的类型
举例说明:每一个wsdl文件都有会如下格式的文件
<types> <xsd:schema> <xsd:import namespace="http://ws.java.com/" schemaLocation="http://192.168.1.103:7878/web?xsd=1"/> </xsd:schema> </types>
访问: http://192.168.1.103:7878/web?xsd=1(案例地址)将会看到更加详细的方法解析。例如传递参数的类型。返回参数的类型()
<xs:schema xmlns:tns="http://ws.java.com/" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="1.0" targetNamespace="http://ws.java.com/"> <xs:element name="add" type="tns:add"/> <xs:element name="addResponse" type="tns:addResponse"/> <xs:element name="minute" type="tns:minute"/> <xs:element name="minuteResponse" type="tns:minuteResponse"/> <xs:complexType name="add"> <xs:sequence> <xs:element name="arg0" type="xs:int"/> <xs:element name="arg1" type="xs:int"/> </xs:sequence> </xs:complexType> <xs:complexType name="addResponse"> <xs:sequence> <xs:element name="return" type="xs:int"/> </xs:sequence> </xs:complexType> <xs:complexType name="minute"> <xs:sequence> <xs:element name="arg0" type="xs:int"/> <xs:element name="arg1" type="xs:int"/> </xs:sequence> </xs:complexType> <xs:complexType name="minuteResponse"> <xs:sequence> <xs:element name="return" type="xs:int"/> </xs:sequence> </xs:complexType> </xs:schema>
每一个complexType 在用wsimport命令生成Java的时候都会有相应命名的java文件
Message:SOAP消息和types对应的方法阐述元素相对应 message|types
<message name="add"> <part name="parameters" element="tns:add"/> </message> <message name="addResponse"> <part name="parameters" element="tns:addResponse"/> </message> <message name="minute"> <part name="parameters" element="tns:minute"/> </message> <message name="minuteResponse"> <part name="parameters" element="tns:minuteResponse"/> </message>
portType:指明服务器的接口,并且通过operation指定in和out的消息。其中input表示参数。Output表示返回值
<portType name="WsServerDao"> <operation name="add"> <input wsam:Action="http://ws.java.com/WsServerDao/addRequest" message="tns:add"/> <output wsam:Action="http://ws.java.com/WsServerDao/addResponse" message="tns:addResponse"/> </operation> <operation name="minute"> <input wsam:Action="http://ws.java.com/WsServerDao/minuteRequest" message="tns:minute"/> <output wsam:Action="http://ws.java.com/WsServerDao/minuteResponse" message="tns:minuteResponse"/> </operation> </portType>
Binding : 指定我们传递消息所使用的格式。一般都是literal
<soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/> <operation name="add"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> <operation name="minute"> <soap:operation soapAction=""/> <input> <soap:body use="literal"/> </input> <output> <soap:body use="literal"/> </output> </operation> </binding>
Service : 指定服务所有发布的一些基本信息
<service name="WsServerImplService"> <port name="WsServerImplPort" binding="tns:WsServerImplPortBinding"> <soap:address location="http://192.168.1.103:7878/web"/> </port> </service>