OS11 - SOAP error "The provided URI scheme 'https' is invalid; expected 'http'."

Hi,

We've just upgraded to Out Systems 11 and we can't set up new SOAP web services any more. I can give it my WSDL and everything seems fine in Service Studio, but when I publish and try to call the web service, I get:

The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via


Of course, I need to use HTTPS, as I'm handling private data. The internet is suggesting I need to add the following to my binding, but I don't see where I would do that:

<security mode="Transport">


Here's a sanitised version of the WSDL I'm trying to use (based on one that was generated by Out Systems):

<wsdl:definitions xmlns:s="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="https://abc.co.uk" xmlns:s0="https://abc.co.uk" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tm="http://microsoft.com/wsdl/mime/textMatching/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" targetNamespace="https://abc.co.uk">
  <wsdl:types>
    <s:schema elementFormDefault="qualified" targetNamespace="https://abc.co.uk">
      <s:element name="Request">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="1" maxOccurs="1" name="AccountNumber" type="s:string"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:element name="ResponseData">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="unbounded" name="DMC" type="s0:DMC"/>
          </s:sequence>
        </s:complexType>
      </s:element>
      <s:complexType name="DMC">
        <s:sequence>
          <s:element minOccurs="1" maxOccurs="1" name="Keycode" type="s:string"/>
          <s:element minOccurs="1" maxOccurs="1" name="Name" type="s:string"/>
        </s:sequence>
      </s:complexType>
    </s:schema>
  </wsdl:types>
  <wsdl:message name="SoapIn">
    <wsdl:part name="parameters" element="s0:Request"/>
  </wsdl:message>
  <wsdl:message name="SoapOut">
    <wsdl:part name="parameters" element="s0:ResponseData"/>
  </wsdl:message>
  <wsdl:portType name="WebServiceSoap">
    <wsdl:operation name="sanitised">
      <wsdl:input message="tns:SoapIn"/>
      <wsdl:output message="tns:SoapOut"/>
    </wsdl:operation>
  </wsdl:portType>
  <wsdl:binding name="sanitised" type="tns:WebServiceSoap">
    <soap12:binding transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sanitised">
      <soap12:operation soapAction="abc.co.uk:1234/sanitised" style="document"/>
      <wsdl:input>
        <soap12:body use="literal"/>
      </wsdl:input>
      <wsdl:output>
        <soap12:body use="literal"/>
      </wsdl:output>
    </wsdl:operation>
  </wsdl:binding>
  <wsdl:service name="sanitised">
    <wsdl:port name="sanitised" binding="tns:sanitised">
      <soap12:address location="abc.co.uk:1234/sanitised"/>
    </wsdl:port>
  </wsdl:service>
</wsdl:definitions>

Some questions:

  • You are trying to expose a SOAP service, correct?
  • Have you set up a certificate on the server/platform?
  • Were you able to expose SOAP services prior to updating to OS11?
  • Have you tried exposing REST services, and if so, are you able to expose and call them without issues?

Sorry, no I'm trying to consume a web service I've already created on our back-end platform.

The certificates seem to be in line. We did previously have an error message relating to certificates, but that's been fixed now.

We were consuming web services before the upgrade. We're in the middle of a project which makes heavy use of SOAP to transfer data between Out Systems and our back-end platform. We had already set up about 60 web services on OS10 and after upgrading they all still work. However if I rename an existing WSDL and try to consume it, it fails. We think this was down to the new SOAP 1.2 standard requiring some differences in the WSDL, so we've generated a fresh WSDL in Out Systems and tweaked it to create the above. This WSDL appears to work on Service Studio but, as mentioned, the web service then fails when we try to actually call it.

Our back-end requires us to use SOAP but for the sake of investigation, I've just tried consuming the (admittedly rather simple) REST API at https://www.gov.uk/bank-holidays.json and that has worked fine.

Mike,

Perhaps your exposed webservice does not have HTTP Security on ?

Hi Stefano,

Our back-end platform only accepts HTTPS connections. I've tried using HTTP to see what would happen and it gets rejected. So it's definitely requiring a secure connection.

Mike,

I get that your backend is not OS. I'm sorry i misunderstood.

Please check this:

https://success.outsystems.com/Documentation/11/Extensibility_and_Integration/SOAP/Consuming_SOAP_Web_Services/Configure_a_SOAP_Web_Service_at_Runtime

You might be able to make the right adjustments.

Thanks Stefano.

I've had a look through that page and the related pages but I've not found anything that helps. I'm not using username/password authentication, so that's just set to "(None)".

The endpoint is set to use https and is definitely correct, as I can copy and paste it into a different programme (I'm using SOAP UI to test these web services) and it works fine.

Then the only way to find the problem is to set your logging level high and check the Integrations log. 

Good luck and please keep us posted on your progress.

Here's what I get in the integration error log:


The provided URI scheme 'https' is invalid; expected 'http'.
Parameter name: via
   at System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via)
   at System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via)
   at System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannelCore(EndpointAddress remoteAddress, Uri via)
   at System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via)
   at System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via)
   at System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via)
   at System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via)
   at System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via)
   at System.ServiceModel.ClientBase`1.CreateChannel()
   at System.ServiceModel.ClientBase`1.CreateChannelInternal()
   at System.ServiceModel.ClientBase`1.get_Channel()
   at ssAgentPortal_IS.ssProxy.WebServiceSoapClient.APGetDMCKeycodes(APGetDMCKeycodesRequest request)
   at ssAgentPortal_IS.CcAPGetDMCKeycodes.ActionAPGetDMCKeycodes(HeContext heContext, ICcAPGetDMCKeycodesCallbacks _callbacks, String inParamGUID, String inParamSessionID, String inParamUserID, String inParamCompanyID, String inParamAccountNumber, RLDMC2List& outParamDMC)

Mike,

What do you mean with: "Here's a sanitised version of the WSDL I'm trying to use (based on one that was generated by Out Systems):"

How can you generate a wsdl with outsystems when you only consume it?

Hi Stefano,

I created a web service on Out Systems (expose) with all the same input and output parameters, then downloaded the WSDL and changed the endpoint to my actual web service's endpoint. This way I can be sure the WSDL is in a format that Out Systems likes.

This resolved my initial problem, which was Out Systems not importing the WSDL properly. It was creating an action with one input and one output parameter when there should have been multiple of each. My previous WSDL format was missing a lot of the namespaces included in this new version.

And soap ui also worked with this wsdl? Or did you use the original?

I think one of the https in your definition is not correct and should be http. 


Perhaps it will help if you post your original wsdl, the one that didnt work in OS.

Solution

Fixed it!

It all comes down to my targetNamespace (targetNamespace="https://abc.co.uk"). OutSystems was looking for elements prefixed with "https:", because of this targetNamespace.

I've changed it to "targetNamespace="abc.co.uk" and prefixed my elements with "abc:" and now it works!

It seems the http/https confusion was a red herring caused by the first few letters of my targetNamespace!


Thanks for your help! :)

Solution