1

Delphi XE2 を使用して新しい SOAP WebService サーバー プロジェクトを作成する場合、ウィザードでポートと HTTPS プロパティの変更を設定できます。ポートは 443 に設定され、HTTPS フラグがチェックされますが、作成されたサーバーに接続しようとすると、WSDL で正しくないトランスポート (HTTPS ではなく HTTP) が返され、サービス情報ページに HTTP リンクが生成されます。自動生成されたページはそれほど重要ではありませんが、WSDL ファイルの間違った情報が問題になります。以下に、返された 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>

Web サービスの動作を確認するために WSDL を soapUI ツールにインポートしようとしているときに、バインディング リンクを「https://」に手動で変更する必要があります。そうしないと、RPC が動作しません。

INDY に HTTPS プロトコルを使用して WSDL のリンクを返すように強制する方法については、非常に感謝しています。前もって感謝します!

4

1 に答える 1

0

私は同じ問題を抱えていて、次のように解決しました:

生成されたWSDLHTMLPublish1のプロパティを確認します。プロパティPublishOptions->poPublishLocationAsSecureをtrueに変更します

于 2013-01-30T11:16:01.413 に答える