[MonoDevelop] MonoDevelop: Problem with Bing API and GTK# Application

Abhi arup281 at gmail.com
Sun Aug 5 19:13:33 UTC 2012


Hello,

i'm using MonoDevelop 3.0.3 under Ubuntu 12.04. i'm trying to develop a
desktop search tool using Bing API in C# (GTK# GUI project). my idea is
simple:
1. an entry widget to enter search term
2. a button labeled as 'search'
3. a textview widget to display result (response from the api request)
when user enter something in that entry box and hit the 'search' button, it
will display 10 search result response in that textview.
for that i make a dll file called 'BingService' from wsdl file of Bing API
and add that dll to my project (.NET assembly).
i did that accroding to this link: http://www.mono-project.com/Web_Services
(see consuming web services part)
the link for bing API is: http://api.bing.net/search.wsdl?Appid=<AppID>

then i wrote the following C# code for 'search' button:

---------starts from
here------------------------------------------------------------------------------

BingService service = new BingService ();
        SearchRequest request = new SearchRequest ();
        request.AppId = "my App ID";
        request.Query = entry2.Text;
        request.Sources = new SourceType[] {SourceType.Web};
        request.Market = "en-us";
        request.Adult = AdultOption.Off;
        request.AdultSpecified = true;
        request.Web = new WebRequest ();
        request.Web.Count = 10;
        request.Web.CountSpecified = true;
        request.Web.Offset = 0;
        request.Web.OffsetSpecified = true;
        SearchResponse response = service.Search (request);
        foreach (WebResult result in response.Web.Results)
        {
          textview2.Buffer.Text= textview2.Buffer.Text + (result.Title + "
\nURL: " + result.Url + "\n\n");
        }

---------------------------------------end-----------------------------------------------------------------------------

this project build and run well without any error/warning.
but the problem is, when i enter something into entry box and hit 'search'
button, it can't show any result in the textview.
the application just waits for some moments and then crashes. it's
happening again and again. i can't understand what's going wrong :(

For info, i did the same project under Windows using Visual Studio and it
works there without any issue. i can't understand why it's not working for
monodevelop.
Can anybody help me out with this? Thanks in advance.
Regards.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ximian.com/pipermail/monodevelop-list/attachments/20120806/4c9a91d6/attachment.html>


More information about the Monodevelop-list mailing list