INDY WebService over SSL contains link with HTTP protocol instead of HTTPS in WSDL

Posted by user1437820 on Stack Overflow See other posts from Stack Overflow or by user1437820
Published on 2012-06-06T10:37:16Z Indexed on 2012/06/06 10:40 UTC
Read the original article Hit count: 370

Filed under:
|
|
|
|

When creating new SOAP WebService server project using Delphi XE2 the wizard allows to set change port and HTTPS properties. Port is set to 443, HTTPS flag is checked, but when trying to connect to created server it returns incorrect transport (HTTP instead of HTTPS) in WSDL and generates HTTP links on the Service Info Page. The auto-generated page is not so important, but wrong information in WSDL file is a problem. Below you can see the returned WSDL - there are no 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>

When I'm trying to import WSDL to soapUI tool to check WebService work I need to change manually binding link to "https://" and only then RPCs will work.

I will be very grateful for any idea how to force INDY to return links in WSDL with HTTPS protocol. Thanks in advance!

© Stack Overflow or respective owner

Related posts about web-services

Related posts about ssl