IT Community - Software Programming, Web Development and Technical Support

WebServices in DotNet

This is a discussion on WebServices in DotNet within the ASP and ASP.NET Programming forums, part of the Web Development category; Yes ... You can control it through the web.config file. What you do is right click your Web Reference, and ...


Go Back   IT Community - Software Programming, Web Development and Technical Support > Web Development > ASP and ASP.NET Programming

Register FAQ Members List Calendar Mark Forums Read
  #41 (permalink)  
Old 09-07-2007, 08:20 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: WebServices in DotNet

Yes ...

You can control it through the web.config file.

What you do is right click your Web Reference, and select properties. Then change the Web Service Url From Static to Dynamic. Once that happens you will see something new in the web.config file, which will contain the URL for the web service, and allow you to change it through the config file.
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #42 (permalink)  
Old 09-08-2007, 04:11 AM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Question Re: WebServices in DotNet

I have a web service that posts data somewhere, however, I want the ability to turn this off on the fly without having to change a value in web.config or going in and flipping some flag in the database and then having to hit the DB every time to check for the value. So right now I have a web method that simply changes a value and caches it, so if I want to turn it on/off all I have to do is hit webservice.asmx and run a "test" of the operation. I just pass in the number of minutes which determines how long the value is cached for and thats it. So if I put 30, it inserts a given value in the cache for 30 minutes, and each time my web service goes to post the data, it first checks to see if this value exists in cache and if it does it does not try posting the data. Simple enough. One problem though, in my function that checks to see if this value exists in cache I'm checking by saying something like:

If HttpContext.Current.Cache.Item("myKey") = "1" Then

Its off, return false

This would work great, only problem is that the process that calls this web service is a background thread, so there is no HttpContext. So even though my value might exist in cache, it never works. Does anyone know of a solution I could use instead? I'm using vb.net, 1.1. Any input is greatly appreciated. Thanks.
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #43 (permalink)  
Old 09-08-2007, 05:50 AM
Mramesh Mramesh is offline
D-Web Sr.Programmer
 
Join Date: Sep 2007
Location: Chennai
Posts: 106
Mramesh is on a distinguished road
Send a message via MSN to Mramesh
Default Re: WebServices in DotNet

I think I understand your problem. Looks like you need to find another place to cache your variable. You say you don't want to use a database. You say you don't want to use the web.config. So you opt for using the httpcontext cache which goes away after your http request to the webservice has ended. Yep, once you get your response back from your webservice **POOF**, your cache value is kaput. Not a particularly good idea. So, find another place to cache your variable.
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #44 (permalink)  
Old 09-08-2007, 06:59 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: WebServices in DotNet

You can always access the cache through HttpRuntime.Cache instead, or why not just use a static member variable the HttpApplication class (Global.asax)
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #45 (permalink)  
Old 09-09-2007, 11:30 PM
SaravananJ SaravananJ is offline
D-Web Programmer
 
Join Date: Aug 2007
Posts: 79
SaravananJ is on a distinguished road
Lightbulb Re: WebServices in DotNet

I never messed around with HttpRuntime.Cache

Thanks!
__________________
J.Saravanan
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #46 (permalink)  
Old 09-10-2007, 08:51 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: WebServices in DotNet

HttpRuntime.Cache is the same cache. The property "Cache" on HttpContext is:

Code:
public Cache Cache
{
    get
    {
        return HttpRuntime.Cache;
    }
}
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #47 (permalink)  
Old 09-11-2007, 04:58 AM
mobilegeek mobilegeek is offline
D-Web Analyst
 
Join Date: Jun 2007
Posts: 205
mobilegeek is on a distinguished road
Question Re: WebServices in DotNet

Hey Vinoth,

How to set Timeout property when I call my web service?

What is TimeOut property using?
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #48 (permalink)  
Old 09-11-2007, 08:41 AM
S.Vinothkumar S.Vinothkumar is offline
D-Web Genius
 
Join Date: May 2007
Posts: 1,061
S.Vinothkumar is on a distinguished road
Wink Re: WebServices in DotNet

You can use as follows,

Code:
service.TimeOut=15000; // Here service is object of ur WebService
__________________
S.VinothkumaR
Behind me is infinite power,
Before me is Endless Possibility,
Around me is Boundless Opportunity,
Why should I fear!
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Easy Property Class Generator for DOTNET Developers Anandavinayagam ASP and ASP.NET Programming 4 01-16-2008 03:54 AM
What is Ngen.exe in DotNet? leoraja8 VB.NET Programming 11 10-31-2007 02:17 AM
OOPs Tips for DotNet. S.Vinothkumar Interview Questions & Answers and Tips 11 10-29-2007 07:20 AM
Transaction Scope in DotNet using C#. S.Vinothkumar C# Programming 52 09-22-2007 01:15 AM
Does Using Json Instead Of Xml Speeds Up Webservices Architecture ramkumaraol HTML, CSS and Javascript Coding Techniques 0 07-18-2007 02:59 AM


All times are GMT -7. The time now is 12:26 PM.


Copyright ©2004 - 2007, DiscussWeb. All Rights Reserved.

SEO by vBSEO 3.0.0