1
使用Delphi XE2創建新的SOAP WebService服務器項目時,該向導允許設置更改端口和HTTPS屬性。端口設置爲443,HTTPS標誌被選中,但是當嘗試連接到創建的服務器時,它將在WSDL中返回不正確的傳輸(HTTP而不是HTTPS),並在服務信息頁面上生成HTTP鏈接。自動生成的頁面並不重要,但WSDL文件中的錯誤信息是一個問題。下面你可以看到返回的WSDL - 沒有HTTPS:INDY通過SSL的WebService包含與HTTP協議的鏈接,而不是WSDL中的HTTPS
<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Itest123service" targetNamespace="http://tempuri.org/" xmlns:tns="http://tempuri.org/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:ns1="urn:test123Intf">
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:test123Intf">
<simpleType name="TEnumTest">
<restriction base="string">
<enumeration value="etNone"/>
<enumeration value="etAFew"/>
<enumeration value="etSome"/>
<enumeration value="etAlot"/>
</restriction>
</simpleType>
<complexType name="TDoubleArray">
<complexContent>
<restriction base="soapenc:Array">
<sequence/>
<attribute ref="soapenc:arrayType" n1:arrayType="xs:double[]" xmlns:n1="http://schemas.xmlsoap.org/wsdl/"/>
</restriction>
</complexContent>
</complexType>
<complexType name="TMyEmployee">
<sequence>
<element name="LastName" type="xs:string"/>
<element name="FirstName" type="xs:string"/>
<element name="Salary" type="xs:double"/>
</sequence>
</complexType>
</schema>
</types>
<message name="echoEnum0Request">
<part name="Value" type="ns1:TEnumTest"/>
</message>
<message name="echoEnum0Response">
<part name="return" type="ns1:TEnumTest"/>
</message>
<message name="echoDoubleArray1Request">
<part name="Value" type="ns1:TDoubleArray"/>
</message>
<message name="echoDoubleArray1Response">
<part name="return" type="ns1:TDoubleArray"/>
</message>
<message name="echoMyEmployee2Request">
<part name="Value" type="ns1:TMyEmployee"/>
</message>
<message name="echoMyEmployee2Response">
<part name="return" type="ns1:TMyEmployee"/>
</message>
<message name="echoDouble3Request">
<part name="Value" type="xs:double"/>
</message>
<message name="echoDouble3Response">
<part name="return" type="xs:double"/>
</message>
<portType name="Itest123">
<operation name="echoEnum">
<input message="tns:echoEnum0Request"/>
<output message="tns:echoEnum0Response"/>
</operation>
<operation name="echoDoubleArray">
<input message="tns:echoDoubleArray1Request"/>
<output message="tns:echoDoubleArray1Response"/>
</operation>
<operation name="echoMyEmployee">
<input message="tns:echoMyEmployee2Request"/>
<output message="tns:echoMyEmployee2Response"/>
</operation>
<operation name="echoDouble">
<input message="tns:echoDouble3Request"/>
<output message="tns:echoDouble3Response"/>
</operation>
</portType>
<binding name="Itest123binding" type="tns:Itest123">
<binding xmlns="http://schemas.xmlsoap.org/wsdl/soap/" style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="echoEnum">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoEnum" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoDoubleArray">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoDoubleArray" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoMyEmployee">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoMyEmployee" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
<operation name="echoDouble">
<operation xmlns="http://schemas.xmlsoap.org/wsdl/soap/" soapAction="urn:test123Intf-Itest123#echoDouble" style="rpc"/>
<input>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</input>
<output>
<body xmlns="http://schemas.xmlsoap.org/wsdl/soap/" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="urn:test123Intf-Itest123"/>
</output>
</operation>
</binding>
<service name="Itest123service">
<port name="Itest123Port" binding="tns:Itest123binding">
<address xmlns="http://schemas.xmlsoap.org/wsdl/soap/" location="http://localhost:443/soap/Itest123"/>
</port>
</service>
</definitions>
當我試圖導入WSDL來的soapUI工具來檢查WebService的工作,我需要手動更改綁定到「https://開頭」和只有RPC才能工作。
我將非常感謝任何想法如何強制INDY返回WSDL中的鏈接與HTTPS協議。提前致謝!