在 AIX Version 5.3 中使用 Java 和 PHP 技术进行开发 (4)
2008-11-10 08:25:59 来源:WEB开发网SetSurveyResponse:这个方法接受问卷调查 ID、问题 ID,以及实际的回答。
这与本教程中前面介绍的用于 Web 服务接口的模型是相匹配的。
使用 Eclipse 建模所需的 WSDL。采用这种方式创建 WSDL 文件已超出了本教程的范围,所以让我们来研究所生成的 WSDL XML 规范。
生成的 WSDL
为这个 Web 服务所生成的 WSDL 的完整内容如清单 1 中所示。
清单 1. 生成的 WSDL
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="http://localhost:8080/axis/services/SQWSSOAP/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="SurveyQuestions"
targetNamespace="http://localhost:8080/axis/services/SQWSSOAP/">
<wsdl:types>
<xsd:schema targetNamespace="http://localhost:8080/axis/services/SQWSSOAP/">
<xsd:element name="GetSurveyQuestionCount">
<xsd:complexType>
<xsd:sequence> </xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSurveyQuestionCountResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSurveyQuestion">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSurveyQuestionResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="questiontext" type="xsd:string"/>
<xsd:element name="questionhelp" type="xsd:string"/>
<xsd:element name="options" type="xsd:boolean"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SetSurveyResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="surveyid" type="xsd:int"/>
<xsd:element name="surveyquestion" type="xsd:int"/>
<xsd:element name="surveyvalue" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="SetSurveyResponseResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InitializeSurvey">
<xsd:complexType>
<xsd:sequence> </xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="InitializeSurveyResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="surveyresponseid" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSurveyQuestionOptions">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="questionno" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="GetSurveyQuestionOptionsResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="options" type="xsd:string" maxOccurs="unbounded"
minOccurs="1"> </xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="NewOperation">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="in" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name="NewOperationResponse">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="out" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name="GetSurveyQuestionCountRequest">
<wsdl:part element="tns:GetSurveyQuestionCount" name="parameters"/>
</wsdl:message>
<wsdl:message name="GetSurveyQuestionCountResponse">
<wsdl:part element="tns:GetSurveyQuestionCountResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="GetSurveyQuestionRequest">
<wsdl:part name="parameters" element="tns:GetSurveyQuestion"/>
</wsdl:message>
<wsdl:message name="GetSurveyQuestionResponse">
<wsdl:part name="parameters" element="tns:GetSurveyQuestionResponse"
> </wsdl:part>
</wsdl:message>
<wsdl:message name="SetSurveyResponseRequest">
<wsdl:part name="parameters" element="tns:SetSurveyResponse"/>
</wsdl:message>
<wsdl:message name="SetSurveyResponseResponse">
<wsdl:part name="parameters" element="tns:SetSurveyResponseResponse"/>
</wsdl:message>
<wsdl:message name="InitializeSurveyRequest">
<wsdl:part name="parameters" element="tns:InitializeSurvey"/>
</wsdl:message>
<wsdl:message name="InitializeSurveyResponse">
<wsdl:part name="parameters" element="tns:InitializeSurveyResponse"/>
</wsdl:message>
<wsdl:message name="GetSurveyQuestionOptionsRequest">
<wsdl:part name="parameters" element="tns:GetSurveyQuestionOptions"/>
</wsdl:message>
<wsdl:message name="GetSurveyQuestionOptionsResponse">
<wsdl:part name="parameters" element="tns:GetSurveyQuestionOptionsResponse"
/>
</wsdl:message>
<wsdl:message name="NewOperationRequest">
<wsdl:part name="parameters" element="tns:NewOperation"/>
</wsdl:message>
<wsdl:message name="NewOperationResponse">
<wsdl:part name="parameters" element="tns:NewOperationResponse"/>
</wsdl:message>
<wsdl:portType name="SurveyQuestions">
<wsdl:operation name="GetSurveyQuestionCount">
<wsdl:input message="tns:GetSurveyQuestionCountRequest"/>
<wsdl:output message="tns:GetSurveyQuestionCountResponse"/>
</wsdl:operation>
<wsdl:operation name="GetSurveyQuestion">
<wsdl:input message="tns:GetSurveyQuestionRequest"/>
<wsdl:output message="tns:GetSurveyQuestionResponse"/>
</wsdl:operation>
<wsdl:operation name="SetSurveyResponse">
<wsdl:input message="tns:SetSurveyResponseRequest"/>
<wsdl:output message="tns:SetSurveyResponseResponse"/>
</wsdl:operation>
<wsdl:operation name="InitializeSurvey">
<wsdl:input message="tns:InitializeSurveyRequest"/>
<wsdl:output message="tns:InitializeSurveyResponse"/>
</wsdl:operation>
<wsdl:operation name="GetSurveyQuestionOptions">
<wsdl:input message="tns:GetSurveyQuestionOptionsRequest"/>
<wsdl:output message="tns:GetSurveyQuestionOptionsResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SurveyQuestionsSOAP" type="tns:SurveyQuestions">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetSurveyQuestionCount">
<soap:operation
soapAction="http://localhost:8080/axis/services/SQWSSOAP
/GetSurveyQuestionCount"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSurveyQuestion">
<soap:operation
soapAction="http://localhost:8080/axis/services/SQWSSOAP/GetSurveyQuestion"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="SetSurveyResponse">
<soap:operation
soapAction="http://localhost:8080/axis/services/SQWSSOAP/SetSurveyResponse"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="InitializeSurvey">
<soap:operation
soapAction="http://localhost:8080/axis/services/SQWSSOAP/InitializeSurvey"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="GetSurveyQuestionOptions">
<soap:operation
soapAction="http://localhost:8080/axis/services/SQWSSOAP
/GetSurveyQuestionOptions"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SurveyQuestions">
<wsdl:port binding="tns:SurveyQuestionsSOAP" name="SurveyQuestionsSOAP">
<soap:address location="http://localhost:8080/axis/survey"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
更多精彩
赞助商链接