开发者

how to optimize time in webservice while sending request and receiving response?

I m working with some web services where i m requesting for web service around 4000 times in loop each time i m getting some data from web service, that is working fine...but the problem is that it's taking time...obviously 4000 times cost a time, but is there any way that we can optimize the time with this? thanks.

Actually .. i have 3 dropdownlistbox. first dropdownlistbox is about to country , second one is about to cities of that selected country. and third one is all cities of world. third dropdownlistbox is around 4413 cities from all over the world.

why am i using this? because in . this web services is for taking data for airport countries.

first. user select contry in first dropdownlistbox s开发者_JS百科o. its postback and fill the second one using webservices request and response. by cities name of that selected country.

now. select country from second dropdownlistbox, which place is my start point.

and now i am matching that country's airport flight services to other cities and list all that cities name into third dropdownlistbox which is connecting with that country.

now. this all data which i filled in dropdownlistbox is .. using webservices. request and respones..

now problem is that. in world there are 4414 cities. so. i matched that one city with all this cities. so. request is increasing and response taking so much time.

so help me get out of this problem.

tell me any method that i used for reducing this time. i am doing some coding. which is right. but because of this problem . its taking so much time in response. so .tell me any method .which i used to reduce time.

thanks.


cache city list, it won't change in a week.


If you have access to the webservice (= you're the developer of it) and the client using it, you should optimize it (or make an extra function) so that you can put all the data from the 4000 queries into one call to avoid the connection/call overhead.

If the webservice is not yours, you should see if the server supports keep alive as this would you allow you to send several HTTP requests on the same connection, without reconnecting each time.

Both of these assume that you are calling the same method with different values on the same server.


I'm not sure I fully understand your scenario. However you should simply cache the airport / city lists in your app. You can update the cache every day or something to make sure it's fresh.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜