Travelport / travelport-uapi-tutorial

The travelport-uapi-tutorial is a Java project for Universal API that will help you connect and code a standard workflow including Air and Hotel.
45 stars 34 forks source link

Getting Error while using WSDL Webservice reference code using from Github Travelport/travelport-uapi-tutorial-c-sharp #4

Closed UttamNCrypted closed 9 years ago

UttamNCrypted commented 9 years ago

Hello there,

Please find below link is our asp.net MVC4.5.1 web application repository.

https://github.com/UttamNCrypted/Travelport-AirService-Demo

please download the above repository code and try to run the application you will get the exact error.

every configuration details for the making Travelport UAPI calls, you will find it from web.config file.

we have copied directory structure from https://github.com/Travelport/travelport-uapi-tutorial-c-sharp/tree/master/ConsoleApplication1/ConsoleApplication1

to our MVC based web application. we have replaced app.config file with web.config due to it's web application rather than desktop.

I have created Service Reference named AirService from WSDL/air_v29_0/Air.wsdl file.

I found In WSDL/air_v29_0/Air.wsdl file So My question is will this

"http://localhost:8080/kestrel/AirService" soapaction affects the code? In web.config there is section called

again endpoint address is "http://localhost:8080/kestrel/AirService" is this problem for us? our localhost address for this project is "http://localhost:1965/". we need to replace http://localhost:8080/ to http://localhost:1965/ please assist me ASAP, I am in big truble due to this.
vivekjyotipramanik commented 9 years ago

Hi UttamNCrypted,

I have gone through the code and service references. They looked fine to me. I tried to run the application but I am getting an error that 'Cannot read configuration file due to insufficient permissions' with HRRSULT 0x80070005. I am trying to fix the issue with IIS_USRS. I will update you soon on this. Thanks.

Thanks & Regards Vivekjyoti Pramanik

UttamNCrypted commented 9 years ago

Hello Vivekjyotipramanik,

Did find any solution related to above problem ?

vivekjyotipramanik commented 9 years ago

Hi UttamNCrypted,

I was able to remove the error with IIS Server. Please find below the application config I have used. Now when I am trying to run the application using the URL http://localhost/MVC4.5.1 it is showing me folder structure. Could you please let me know the steps to run the application so that I could replicate the error. Also, Could you please send me a screenshot/logs of the error you are getting. Thanks.

Thanks & Regards Vivekjyoti Pramanik

web_config

UttamNCrypted commented 9 years ago

Yes sure,

please run this url http://localhost/MVC4.5.1/Home/Test.

I have create Test() into HomeController.cs please find that from Controllers directory. there is code something like

public ActionResult Test() { try { AirSvcTest test = new AirSvcTest(); test.Availability();

            return View();
        }
        catch (Exception ex)
        {
            throw ex;
        }
    }

UserName, Password, BranchCode, ProviderCode everything that need to run the API is in Web.Config file you can find it from there. please let me know if you required more details on the same.

Regards, Uttam

UttamNCrypted commented 9 years ago

Please assist me ASAP, I am in big trouble due to the issue.

UttamNCrypted commented 9 years ago

this is the error that we got after running the application.

error

vivekjyotipramanik commented 9 years ago

Hi UttamNCrypted,

Please let me know your preferred time today and I will setup a goto meeting to solve the issue during the call. Thanks.

Thanks & Regards Vivekjyoti Pramanik

vivekjyotipramanik commented 9 years ago

Hi UttamNCrypted,

I could replicate the issue, I am currently working on to fix the problem. Thanks.

Thanks & Regards Vivekjyoti Pramanik

UttamNCrypted commented 9 years ago

Hi Vivekjyoti Pramanik,

I would available from 11:30 AM. to 6:30 PM. IST (GMT +5:30)

contact me on my cell number +91 9558140091 (Jignesh).

Please assist me ASAP.

Regards, Uttam

vivekjyotipramanik commented 9 years ago

Hi UttamNCrypted,

I have found and fixed the problem. Please update web.config in your project. Please use customBinding instead of basicHttpBinding. Please find below a sample for the same. I have also tested the fix with your project's web.config and it is working fine now. You can use the same bindingConfiguration = "CustomServiceBinding" for all of them instead of different config for different contracts. I will update the github code soon with the fix. Please let me know how it goes. Thanks.


<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
  </startup>
  <appSettings>
    <add key="Username" value="your username received in travelport welcome letter" />
    <add key="Password" value="your password received in travelport welcome letter" />
    <add key="1GTargetBranch" value="your 1P targetBranch/WAB received in travelport welcome letter" />
    <add key="1PTargetBranch" value="your 1P targetBranch/WAB received in travelport welcome letter" />
    <add key="1VTargetBranch" value="your 1V targetBranch/WAB received in travelport welcome letter" />
    <add key="TRMTargetBranch" value="your TRM targetBranch/WAB received in travelport welcome letter" />
    <add key="ClientSettingsProvider.ServiceUri" value="" />
  </appSettings>
  <system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="ExternalCacheAccessBinding" />
        <binding name="SystemPingBinding" />
        <binding name="SystemInfoBinding" />
        <binding name="SystemTimeBinding" />
      </basicHttpBinding>
      <customBinding>
        <binding name="CustomServiceBinding" closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:03:00">
          <textMessageEncoding messageVersion="Soap11" writeEncoding="utf-8">
            <readerQuotas maxDepth="32" maxStringContentLength="2147483646" maxArrayLength="2147483646"
                          maxBytesPerRead="2147483646" maxNameTableCharCount="2147483646" />
          </textMessageEncoding>
          <httpsTransport authenticationScheme="Basic" transferMode="Buffered" useDefaultWebProxy="true"
          bypassProxyOnLocal="false" hostNameComparisonMode="StrongWildcard" allowCookies="false"
          maxBufferPoolSize="524288" maxReceivedMessageSize="2147483646" maxBufferSize="2147483646"/>
        </binding>
      </customBinding>
    </bindings>
    <client>
      <endpoint address="http://localhost:8080/kestrel/ExternalCacheAccessService"
          binding="customBinding" bindingConfiguration="CustomServiceBinding"
          contract="SystemReference.ExternalCacheAccessPortType" name="ExternalCacheAccessPort" />
      <endpoint address="http://localhost:8080/kestrel/SystemService"
          binding="customBinding" bindingConfiguration="CustomServiceBinding"
          contract="SystemReference.SystemPingPortType" name="SystemPingPort" />
      <endpoint address="http://localhost:8080/kestrel/SystemService"
          binding="customBinding" bindingConfiguration="CustomServiceBinding"
          contract="SystemReference.SystemInfoPortType" name="SystemInfoPort" />
      <endpoint address="http://localhost:8080/kestrel/SystemService"
          binding="customBinding" bindingConfiguration="CustomServiceBinding"
          contract="SystemReference.SystemTimePortType" name="SystemtimePort" />
    </client>
  </system.serviceModel>
</configuration>
UttamNCrypted commented 9 years ago

Hi Vivekjyoti Pramanik,

Thank you very much for this solution, I have implemented the same and got successful response for flight availability. Now I will perform other operations like ticket booking and all. I will let you know if we face any issue in the same.

Thanks again.

Regards, Uttam

imAliAsad commented 8 years ago

Hey Uttam

Hope you're fine. Bro tell can you show me your fixed web.config file? Actually i followed same steps but stills facing errors. Thanks

Regards Ali

rehman22 commented 5 years ago

Ali i have also issue did u resolve issue .. let me know