Expedia Api 和 ASP.Net(403 Developer Inactive) [英] Expedia Api and ASP.Net ( 403 Developer Inactive)

查看:14
本文介绍了Expedia Api 和 ASP.Net(403 Developer Inactive)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Web 服务和 ASP.Net 的新手..

我正在尝试检索某个城市的酒店..我使用了添加服务引用..

  1. 它不接受 XML 模式 (http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx])它接受了 Soap WSDL (http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx])

  2. 之后我可以访问这些类,但我不知道如何返回列表或激发他尝试创建表单的方法并将操作设置为 http://api.ean.com/ean-services/ws/hotel/v3/ 如前所述在文档中

<块引用>

<asp:Button ID="Button1" runat="server" onclick="Unnamed1_Click"/></表单>

这将返回一个带有错误 403 developer Inactive 的 XML

我已将我的 IP 地址添加到 EAN 网站中的应用程序

请我需要任何帮助,无论是教程、示例还是一些解释

解决方案

添加服务引用后,我在我的 defualt.aspx 中创建了一个表单和一个按钮

<块引用>

<asp:Button ID="button3" runat="server" OnClick="button3_Click"/></表单>

按钮调用defualt.aspx.cs中的button3_Click方法(ExpediaAPIShared是我添加时给服务起的名字)

<块引用>

 ExpediaAPIShared.HotelServicesClient client = new HotelServicesClient();ExpediaAPIShared.HotelListRequest hotelListRequest = new HotelListRequest();ExpediaAPIShared.HotelList hotelList = new HotelList();ExpediaAPIShared.HotelListResponse hotelListResponse = new HotelListResponse();客户端打开();hotelListRequest.apiKey = "6ppdh333hagfauy5724hdggn";//使用你自己的密钥hotelListRequest.cid = 55505;//这是用于测试的CIDhotelListRequest.city = "利雅得";hotelListRequest.datelessSupplierSort = true;hotelListResponse = client.getList(hotelListRequest);hotelList = hotelListResponse.HotelList;for (int i = 0; i 

我需要初始化每种类型,因为如果我不这样做,对象的值将保持为 null,并且我将无法为其属性添加任何值.

此代码将仅返回利雅得的酒店名称..

I'm new to Webservices and to ASP.Net..

I'm trying to retrieve the hotel in a certain city.. I used add service reference..

  1. it didn't accept the XML schema (http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx]) It accepted the Soap WSDL (http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx])

  2. After that I could access the classes but I have no Idea how can i return the list or provoke he method I tried to create a form and I've set the action to http://api.ean.com/ean-services/ws/hotel/v3/ as mentioned in the documentation

<form runat="server" action="http://api.ean.com/ean-services/ws/hotel/v3/">
<asp:Button ID="Button1" runat="server" onclick="Unnamed1_Click"/>
</form>

this returns an XML with error 403 developer Inactive

I have added my IP address to the application in the EAN website

Please I need any help you can give me whether in tutorials , examples or some explanation

解决方案

After adding a service reference I created a form and a button in my defualt.aspx

<form runat="server">
<asp:Button ID="button3" runat="server" OnClick="button3_Click" />
</form>

the button invokes the method button3_Click in the defualt.aspx.cs (ExpediaAPIShared is the name I gave the service when I added it)

  ExpediaAPIShared.HotelServicesClient client = new HotelServicesClient();
  ExpediaAPIShared.HotelListRequest hotelListRequest = new HotelListRequest();
  ExpediaAPIShared.HotelList hotelList = new HotelList();
  ExpediaAPIShared.HotelListResponse hotelListResponse = new HotelListResponse();
  client.Open();
  hotelListRequest.apiKey = "6ppdh333hagfauy5724hdggn";//use ur own key
  hotelListRequest.cid = 55505; //this is the CID for testing
  hotelListRequest.city = "Riyadh";
  hotelListRequest.datelessSupplierSort = true;
  hotelListResponse = client.getList(hotelListRequest);
  hotelList = hotelListResponse.HotelList; 
    for (int i = 0; i < hotelList.size; i++)
    {
        Response.Write(hotelList.HotelSummary[i].name);
        Response.Write("</br>");
   }

I needed to initiate each type because if i didn't the value of the object will remain null and I won't be able to add any value to it's attribute.

This code will return only the names of hotels in Riyadh..

这篇关于Expedia Api 和 ASP.Net(403 Developer Inactive)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆