1

I have been trying to send ping request to https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/SystemService but i am receiving following error: Error making ping request: The provided URI scheme 'https' is invalid; expected 'http'.

The end point provided to me uses https. How can I correct this error?

Here is my web.config

<?xml version="1.0"?>
 <configuration>
<system.web>
  <compilation debug="true" targetFramework="4.5" />
  <httpRuntime targetFramework="4.5" />
</system.web>

<system.serviceModel>
    <bindings>
        <basicHttpBinding>
            <binding name="ExternalCacheAccessBinding" />
            <binding name="SystemPingBinding" />
            <binding name="SystemInfoBinding" />
            <binding name="SystemTimeBinding" />
        </basicHttpBinding>
    </bindings>
    <client>
        <endpoint address="https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/SystemService"
            binding="basicHttpBinding" bindingConfiguration="ExternalCacheAccessBinding"
            contract="WSDLService.ExternalCacheAccessPortType" name="ExternalCacheAccessPort" />
        <endpoint address="https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/SystemService"
            binding="basicHttpBinding" bindingConfiguration="SystemPingBinding"
            contract="WSDLService.SystemPingPortType" name="SystemPingPort" />
        <endpoint address="https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/SystemService"
            binding="basicHttpBinding" bindingConfiguration="SystemInfoBinding"
            contract="WSDLService.SystemInfoPortType" name="SystemInfoPort" />
        <endpoint address="https://americas-uapi.copy-webservices.travelport.com/B2BGateway/connect/uAPI/SystemService"
            binding="basicHttpBinding" bindingConfiguration="SystemTimeBinding"
            contract="WSDLService.SystemTimePortType" name="SystemtimePort" />
    </client>
</system.serviceModel>

This is the request I am sending following a tutorial:

// PING REQUEST
    //

    String payload= "this my payload; there are many like it but this one is mine";
    String someTraceId = "doesntmatter-8176";

    //set up the request parameters into a PingReq object
    PingReq req = new PingReq();
    PingRsp rsp = new PingRsp();
    req.Payload=payload;
    req.TraceId=someTraceId;
    SystemPingPortTypeClient port = new SystemPingPortTypeClient();
    try {
        //run the ping request
        UserNamePasswordClientCredential creds = port.ClientCredentials.UserName;
        creds.UserName = "MyUserName";
        creds.Password = "MyPassword";

        rsp = port.service(req);
        //print results.. payload and trace ID are echoed back in response
        Label1.Text = rsp.Payload;
        Label2.Text = rsp.TraceId;
        Label3.Text = rsp.TransactionId;
        } 
    catch (Exception ex) {
    //usually only the error message is useful, not the full stack
    //trace, since the stack trace in is your address space...
    Label1.Text = "Error making ping request: " + ex.Message;
Tehreem
  • 939
  • 2
  • 14
  • 31

1 Answers1

4
<security mode="Transport"> in Servicereference.ClientConfig file

Here

Check here too

UPDATE : As per your comments :

 <bindings>
   <basicHttpBinding>
   <security mode="Transport">
Community
  • 1
  • 1
Suraj Singh
  • 4,041
  • 1
  • 21
  • 36
  • Do you mean Web.Config? I have Web.Config but no Servicereference.ClientConfig anywhere. I have referenced these services through a wsdl file given to me. VS generated a reference.cs file but no config..? – Tehreem Dec 03 '13 at 15:55