Expedia的阿比ASP.Net(403开发者无效) [英] Expedia Api and ASP.Net ( 403 Developer Inactive)

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

问题描述

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

我想找回酒店某市..我用的附加服务的参考。


  1. 不接受XML架构(<$c$c>http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx])
    它接受了肥皂WSDL (<$c$c>http://api.ean.com/ean-services/rs/hotel/v3?_wadl&type=xml&apiKey=[xxxYourAPIkeyxxx])


  2. 在我可以访问类,但我不知道我怎样才能返回列表或挑起他的方法我试图创建一个表单,我已经设定的动作的 http://api.ean.com/ean-services/ws/hotel/v3/ 如前所述在文档中



 &LT;形式=服务器行动=htt​​p://api.ean.com/ean-services/ws/hotel/v3/&GT;
&LT; ASP:按钮的ID =Button1的=服务器的onclick =Unnamed1_Click/&GT;
&LT; /表及GT;


此返回403错误开发商停用

的XML

我已经加入我的IP地址在EAN网站应用

请我需要任何帮助,您可以给我是否教程,范例或一些解释


解决方案

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


 &LT;形式=服务器&GT;
&LT; ASP:按钮的ID =按钮3=服务器的OnClick =button3_Click/&GT;
&LT; /表及GT;


按钮将调用在defualt.aspx.cs方法button3_Click(ExpediaAPIShared的名字我给服务时,我说的话)


  ExpediaAPIShared.HotelServicesClient客户端=新HotelServicesClient();
  ExpediaAPIShared.HotelListRequest hotelListRequest =新HotelListRequest();
  ExpediaAPIShared.HotelList hotelList =新HotelList();
  ExpediaAPIShared.HotelListResponse hotelListResponse =新HotelListResponse();
  client.Open();
  hotelListRequest.apiKey =6ppdh333hagfauy5724hdggn; //使用乌尔自己的钥匙
  hotelListRequest.cid = 55505; //这是用于测试的CID
  hotelListRequest.city =利雅得;
  hotelListRequest.datelessSupplierSort = TRUE;
  hotelListResponse = client.getList(hotelListRequest);
  hotelList = hotelListResponse.HotelList;
    的for(int i = 0; I&LT; hotelList.size;我++)
    {
        的Response.Write(hotelList.HotelSummary [我]。名称);
        的Response.Write(&LT; / BR&gt;中);
   }


我需要启动每种类型的,因为如果我没有对象的值将保持空,我将不能添加任何价值,它的属性。

这code只会返回酒店的名字在利雅得..

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的阿比ASP.Net(403开发者无效)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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