.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Url Rewrite for web service ...

Posted By:      Posted Date: August 24, 2010    Points: 0   Category :ASP.Net

Hello ,

how i can rewrite url for an web service ?!

i use it :

<add name="WebService" virtualUrl="^~/include/(.*).do" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Def/WebService/$1.asmx" ignoreCase="true"/>

but when run sie , get some error(405 (Method Not Allowed) OR 500 ..) ...

Now I need to how to rewrite the web service address.

please help me ...

thanks .

View Complete Post

More Related Resource Links

Url Rewrite for web service ...

Hello , how i can rewrite url for an web service ?! i use it :   <add name="WebService" virtualUrl="^~/include/(.*).do" rewriteUrlParameter="ExcludeFromClientQueryString" destinationUrl="~/Def/WebService/$1.asmx" ignoreCase="true"/>  but when run site and call a method(webservice.asmx/ChangeImage) , get error :The resource cannot be found. and if call web service mathod with jquery get error(405:Method Not Allowed). this is replay : <html> <head> <title>The HTTP verb POST used to access path '/Game-Root/Def/WebService/webservice.asmx/ChangeImage' is not allowed.</title> <style> body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px} b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px} H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red } H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon } pre {font-family:"Lucida Console";font-size: .9em} .marker {font-weight: bold; color: black;text-decoration: none;} .version {color: gray;} .error {margin-bottom: 10px;} .expandable { text-decoration:

Windows Service Applications Tutorials

You can easily create services by creating an application that is installed as a service. For example, suppose you want to monitor performance counter data and react to threshold values. You could write a Windows Service application that listens to the performance counter data, deploy the application, and begin collecting and analyzing data.

WCF Tip: Using Properties in Service Contracts

you'll notice all of the Service Contracts are implemented with interfaces containing only methods. For the longest time I thought that's all that was supported, until I thought about it a little more. In C# land, properties are simply wrappers around a get method and set method, so why wouldn't we be able to use properties in a service contract? Well the answer is we can.

Realizing a Service-Oriented Architecture with .NET

This article is meant to be a practical discussion guide to building a .NET application in a service-oriented architecture. We will consider real-world goals, real-world obstacles, and experience-based solutions. I quickly concede the approaches discussed here are not exhaustive or infallible. This paper is focused on application development, not application integration. We will specifically consider architectural issues and component design issues.

The Potential of Web Services

Web Service for uploading documents into SharePoint

WS UploadService is a web service written for Microsoft Office SharePoint Server 2007 and Windows SharePoint Services 3.0 and is meant for uploading documents into SharePoint. I have just uploaded the zip file to GotDotNet.com so it will take some time before the zip file appears in the list of downloads. For the time being, you can download the zip file from the following location

Creating and Using an ASP.NET Web Service in Visual Web Developer

In addition to letting you create Web pages, Microsoft Visual Studio also lets you create Web services that use ASP.NET XML. Creating a Web service in Visual Studio is similar to creating a Web page. You can also use the Microsoft Visual Web Developer Web development tool to reference and use Web services that are in a Visual Web Developer solution, on your local computer or in a local or external UDDI directory. In this walkthrough, you will create the Web service in one solution and use it in another.

Tasks illustrated in this walkthrough include:

Creating a simple XML Web service in Visual Web Developer.

Creating a separate Web site that uses the Web service.

AutoGenerateSelectButton="False" ignored when using Domain Service


Crosspost from RIA Services forum: http://forums.silverlight.net/forums/t/196466.aspx

I'm creating a Dynamic Data application in VS2010 and have recently switched to using a Domain Service to give greater control over the data presented to the client. I've noticed that the AutoGenerate<Action>Button attributes on my GridView are being ignored. The presence of the Edit and Delete buttons appear to be contingent on the existence of Update and Delete methods on the partial classes autogenerated in the Domain Service, but i'm not seeing how to control the generation of the Select button. Is there a way to control this from within the Domain Service class?

Any framework for creating a job scheduler service?


Just curious to know if there was any official Microsoft code blocks, classes, or such for writing a service that runs other assemblies or WCF services?  That can be configured easily from a web page, pre-coded, for running tasks at certain times on certain recurring intervals?  I've already built one but am open to anything done better- which I'm sure there is.  Thanks!!!

Url rewrite with timer



I'm trying to rewrite my urls, which kinda work now.

The problem is that in my page i'm using a timer to refresh the data every couple of seconds.
But in Mozilla firebug I can see that the url keeps changing: it's getting bigger after each timer update, like this:


etc etc, until it returns a 404 not found.

What can I do to prevent this?


URL Rewrite causes AppSettings to Fail?


Hi there,

I just implemented basic URL rewriting to change a page from, for example, /member.aspx?id=123 to /member.aspx/erik.  That works and I'm happy with it.  However, I am now getting an error message that states "the connectionstring property has not been initialized".  Normally, I've been storing the connectionstring in web.config, and I access it with:

Dim Connect As SqlConnection = New SqlConnection
Dim ConnectString As String
ConnectString = ConfigurationManager.AppSettings("linktomysite")
Connect.ConnectionString = ConnectString

This is what I do on every other page of the site and it works fine.  The only way it will work on the page where I'm URL re-writing, however, is if I replace "ConfigurationManager.AppSettings("linktomysite")" with the actual connection string itself.  For security reasons, obviously I would prefer to keep that info out of the page.  What can I do?



Arabic QueryString with Url Rewrite Solution


Alsalamo 3alaykom ,

as we know that if you use Intelligencia.UrlRewriter.RewriterHttpModule or IIS URL Rewriting , we will face problems with arabic urls

as this

http://localhost:1234/Pages/???? ?????? ?????? ??????????

and the Rule is :

<rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" />

you will recive the QueryString["Page"] Like this

نائب العميد للشؤون الأكاديمية

so it's a big problem , and there is a solution that is :

remove the Rule of that rewriting ,,

<rewrite url="~/Pages/(.+)" to="~/ShowPages.aspx?Page=$1" />

then open your Global.asax file and Application_BeginRequest method exactly

use the following code to handle you request

void Application_BeginRequest(object sender, EventArgs e)
if (HttpContext.Current.Request.Url.ToString().Contains("/Pages/"))
	String[] txt= Regex.Split(HttpContext.Current.Request.Url.ToString(), @"/");
	String page = txt[txt.Length-1];

Convert WCF service to self hosting application


 I created project as a  WCF Service application and now according to recuriment that needs to be converted as a self hosting application

How can i do this?

Converting WCF service app to Self hosting app?

WCF Data Service to JSON example? v4


I would like to take WCF Data Service and produce JSON output to consume on various mobile apps.

Can anyone give me a how-to on the JSON part?  I.e., what is different than normal XML outut?



Problem to obtain client IP on web service



I'm having problems to obtain the client IP on web service. Here's my scenario:

One server with Windows 2003, hosting the web service using .Net Framework 2.0, with IP and host name ServerTransaction.
Other server with Windows 2003, hosting a web application using .Net Framework 2.0, that consuming the web service on  ServerTransaction, with IP and host name ServerApplication.
Many other computers on the local network (IPs:,,, ...) acessing the web application on ServerApplication.

On the code of the web service I've tried to use HttpContext.Current.Request.UserHostAddress or HttpContext.Current.Request.ServerVariables("REMOTE_ADDR") or HttpContext.Current.Request.ServerVariables("HTTP_X_FORWARDED_FORR"), but always I can only get the IP of ServerApplication (

Any idea or tip?

Thanks and sorry for my bad english.

A lengthy operation in an ASP.NET web service


I've built an ASP.NET web service with .NET 2.0 (an asmx file). I invoke a web service method using Ajax. The method takes a substantial amount of time to execute (5 minutes to 1 hour). I believe it's not a good idea to "hang" the web request for so long.
I'm wondering if the web service method could spawn an additional process which in turn would execute the lengthy operation and notify the web service once the operation is completed.
Are there any good practices regarding this kind of functionality?


.Net Frameword 4 SOAP Web Service



We want to upgrade from VS2005 to VS2010. Before we do that, I would like some clarity about some things.


Can we build typical SOAP webservices with the 4 Framework as I could with 2.0?


Would a WCF Service allow me to have both REST/SOAP services in one application?


Is Framework 4 ONLY for REST services and I need to stick to 3.5 for SOAP?


I downloaded the free Web Developer 2010, but I cannot seem to get anywhere trying to figure this out.


Thanks for any input.





problem compiling web service


Using Visual Studio 2010.

I created a webservice GetDemographicData asmx, GetDemographicData asmx.cs and then used wsdl to create a proxy, then used csc.exe to create dll.

first time when I generate proxy, it looks and works fine, but when I make some changes to my webservice and regenerate proxy the following problems occur:

1.I lost the function: public DataSet Get_GetDemographicData(string CaseNum, int Version)
2. The namespace changed to my-labs

Why?? Please see my code below:

Any help is appreciated. Thanks.

<%@ WebService Language="C#" CodeBehind="~/App_Code/GetDemographicData.cs" Class="GetDemographicData" %>
GetDemographicData.cs was created under AppDataas follows:

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Configuration;
using System.Data.SqlClient;
using System.Data;

/// <summary>
/// Summary description for GetCurrentReportVersion
/// </summary>
[WebService(Namespace = "http://localhost/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, u
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend