Discussion on:

20
Comments

Join the conversation!

Follow via:
RSS
Email Alert
If so, how are you doing it? REST? SOAP? AJAX? What has your experience been with it, and would you recommend that approach to others?

J.Ja
0 Votes
+ -
Thanks for article
rick@... Updated - 17th Sep 2009
I am not currently doing any web searches as part of an app but now that I see how easy it is I'll keep it in mind when spec'ing out a project.

I appreciate the information and think the "hands on" column will be nice to have.
0 Votes
+ -
Contributr
Great!
Justin James 17th Sep 2009
Rick -

Glad you found it useful! That sounds like my experience too; until I saw someone else demo it, I had no idea that it was really this easy to deal with.

Also, thanks for the feedback on the "hands on" column idea! You may have noticed a shift in our content here over the last few months, I am trying to include more "real world" stuff like this article and the "code concepts" pieces to introduce new ideas to people in a plain language way.

J.Ja
Hi James,
I did get a AppID and when I substituted in the URL that you mention above and it does seem to discover, because I see the method name Search under Methods. But at the same time, on the right side it gives the following (in the Web services found at this URL:) section, Operation is not valid due to the current state of the object and the Add Reference button is not enabled. Also the first clue that something is not jiving was that the method is not in blue (enabled), rather it is in black.

So please let me know what is amiss here? Respond to pankaja_shankar@ml.com

Thanks.
0 Votes
+ -
Contributr
Sorry, I have no way of knowing what could or could not be the problem. I'm sure that you can submit your questions to Bing and see if they can tell you what's going on. It worked for me with no problems on two seperate occassions (once when I did it, and once to write the article and verify).

J.Ja
it would be great, if you can share the project code. This will enable us to download and test the same.
I am not sure, if your reply was to my post or not, anyway, here is what I did I opened up a new Windows Application (it doesn't matter what kind of project I open, I get the same error), then tried to follow the steps outlined by James, i.e. to add the Bing service reference. I obtained the AppID for my application and used that in the URL: http://api.bing.net/search.wsdl?AppID=027377727E0CB50903ACE9F02013887591002C3A&Version=2.2 and clicked Go. It seems to search for the site, then I do get the method available on the left side (but disabled) and on the right side of the window, I see this error - Operation is not valid due to the current state of the object. Due to this obviously the Add Reference button doesn't get enabled. So I am stuck at this point itself, forget about the actual testing of the Lookup method from James's article.
0 Votes
+ -
Nice article
damon.mac88@... Updated - 29th Sep 2009
i think the article was very straightforward. clean code!

Hands on Programming is a good idea,Keep these nice blogs coming. I hope future articles will be even more informative
0 Votes
+ -
Contributr
Thanks!
Justin James 29th Sep 2009
Glad that you liked it! Don't worry, we will be having plenty more of these kinds of articles in the future.

J.Ja
This is largely unrelated to the Bing WS, however, might make one think twice before promoting the service. I found the revamped search service from MS kind of interesting and even got swayed into buying an Iphone upgrade via their Cashback program with AT&T. After they refused to honor the offer due to a hidden technicality all of my interest in Bing just "flew out of the window". That's too bad because as a Web Developer I might have considered using Bing more, but not now!
0 Votes
+ -
Slight change
mdboothe 30th Sep 2009
Nice article, however I had to change one part in item #4 above to get to the Live Search web service. I had to change api.bing.net to api.search.live.net like in the documentation. I was then able to use your sample code. Thanks.
0 Votes
+ -
Contributr
Yeah, I copied that URL from one piece of documentation when I wrote the article, but I see in my test app, I am using the address you provided. Thanks for the update, good catch!

J.Ja
0 Votes
+ -
Slight Change 2
mdboothe 30th Sep 2009
I thought that might have been what happened. I've done that more times than I care to remember. I see now that both of those api's are available to use, with slightly different objects and syntax. Do you know if the net.bing.api is going to replace the api.live.search.net? Is the bing.api for the newer version of Bing? Been working with this all afternoon. Fun stuff. Thanks.
0 Votes
+ -
Contributr
The Bing API will replace the Bing API, but to the best of my knowledge:

* The Live URLs will continue to work
* Code written with the older APIs will continue to work

J.Ja
0 Votes
+ -
Contributr
I just made the change in my test project, here's what I learned:

1. Create a new Web reference with the new URL.
2. Update the "using" or "Imports" statements in your code to use the new class.
3. Change the type of the "service" variable from "LiveSearchService" to "BingService".

I did that, and all was well. Glad you are enjoying using it!

J.Ja
Gee, cool, now we can hook up with another useless pile of junk from Miserosoft and look at cute pictures instead of getting relevant search results. How cool - almost like the demented animated puppies replacing a useful seacrh interface in Win XP. Nothing wrong with Justin's code, it's his intent that's all wrong.
0 Votes
+ -
Contributr
That's a good question. First, glad that you liked the code itself, nice to be on the right track there. Here's the primary reason why you would use this: Google does not (to the best of my knowledge) offer search results directly as a Web service. If they do, I could not find it (I looked a few weeks ago). If you can find it and point me in the right direction, I would be delighted to write an article about integrating with them! But, as far as I can tell, Google only offers up its search results via AJAX drop-ins which, while handy and convenient for many Web-based apps, is absolutely useless for a server-based process, desktop app, etc. And as you may be aware, Yahoo! is now going to be using Bing as its backend, so whatever they offer is a wash in this discussion.

Related to that point, is that by using Bing (or a similar provider) instead of Google (I am going to assume you meant Google as a better choice, since it is who most people usually mean), is actually a winner in one way, which is "choice". Google does not like you modifying their results, because then you might work around their ads which pay their bills. It's their right, but not everyone likes the Google ads, particularly with the tracking. As an example, I find it very creepy that I made a purchase from a particular site a few months ago, and now I see ads for that site in all of the "ads by Google" boxes on sites I go to, even when they are not relevant. Depending on the topic of the content, that may be highly inappropriate behavior. Also, you may wish to display the results different than what the Google AJAX code will do for you.

Also related to that, is that Bing provides a WSDL, which makes an integration with .NET code drop dead simple. While SOAP may be a high-overhead protocol on the whole, the tools baked into .NET and Visual Studio for consuming it make it a no brainer to prefer it whenever possible.

Again, if you can point me in the right direction for a similar Web service based search provider, I'd be happy to write another article with that one as well!

J.Ja
0 Votes
+ -
Aren't you that acne infested 20 something that is playing a MICROSOFT Xbox in your parents basement?
0 Votes
+ -
Linq2Bing
KodefuGuru Updated - 30th Oct 2009
I used the typical webservice access you did in my demonstration, but since that time Linq2Bing has come out and it makes things that much cooler.

from p in linq2Bing.Web
where p.Text == searchText
select p;
0 Votes
+ -
Contributr
Ah, neat!
Justin James 31st Oct 2009
I knews that there was a Linq2Bing under development, but I wasn't sure how stable it was. I'll have to check it out. At this time, Rat Catcher's Bing usage is really simplistic, so there is no real need to change it, but it will be good to know for future usage.

J.Ja
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.