Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / March 2005

Tip: Looking for answers? Try searching our database.

Webservice with data retrieval

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
MLSrinivas - 10 Mar 2005 06:07 GMT
Hi all,

This is my first task with web services and quite new .NET.

I tried a test webservice with "hello world" and "addnum" functions.
When I tested them, they worked fine. Then in the same service I added
webmethods which interact with database and returns me the output.

When I execute these methods while testing, I'm getting "Page cannot
be displayed" in browser.

How to locate the problem? And what could be the problem?

Please help.

thanks
-srinivas
Daniel Hobert - 29 Mar 2005 23:00 GMT
Hi Srinivas,

Unfortunately I don't have an answer, but I'm in the same predicament and
posted a similar message (including my code) in the
microsoft.public.dotnet.framework.aspnet.webservices news group.  If I get a
response or some sort of revelation as to why this is happening I'll be sure
to post the solution here.

Cheers and Good Luck,

Daniel
> Hi all,
>
[quoted text clipped - 13 lines]
> thanks
> -srinivas
Daniel Hobert - 29 Mar 2005 23:26 GMT
Hi again,

I was browsing through this newsgroup hoping for an answer when I noticed a
snippet of code in a semi-related thread that I thought might help shed some
light onto why I was unable to retrieve the information necessary and why
the page was incapable of being displayed.

I added the code below to my webMethod that is returning a string of XML
data and suddenly I was able to get to the heart of my issue.

So here goes.

  string xmlPlayerList;
  try
  {
   sdaManageRoster.SelectCommand.Connection.Open();
   sdaManageRoster.SelectCommand.Prepare();
   sdaManageRoster.SelectCommand.Parameters["@player_id"].Value =
player_id;
   sdaManageRoster.SelectCommand.Parameters["@is_active"].Value =
is_active;

   sdaManageRoster.Fill(dsPlayerList);
   xmlPlayerList = dsPlayerList.GetXml();
  }
  catch(Exception ex)
  {
   xmlPlayerList = ex.ToString();
  }

  sdaManageRoster.SelectCommand.Connection.Close();

  return xmlPlayerList;

 What this did for me was return the exact text of the exception I was
experiencing (but not seeing).  The gist of it is that the default user was
not able to execute a stored procedure in the master database and so I was
unable to open the Connection in the first place.  Once I put in the
necessary login info and made sure it was saved, my list of players was
successfully returned and displayed on the page.

Of course now I'm faced with the problem of figuring out the best way to
supply the login and password without having it hardcoded into the page
itself, but that's a minor issue compared to tracking down this one.

Cheers and I hope this helps,

Daniel
> Hi all,
>
[quoted text clipped - 13 lines]
> thanks
> -srinivas

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.