WebService重写url

废话不多说:

1、下载Intelligencia.UrlRewriter.dll文件   并且引用

2、 配置webconfig

 1 <configuration>
 2   <configSections>
 3     <section name="rewriter" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler,Intelligencia.UrlRewriter" />
 4   </configSections>
 5   <rewriter>
 6     <rewrite url="^/LogIn" to="~/LogIn.asmx" processing="stop" />
 7   </rewriter>
 8   <system.web>
 9     <httpModules>
10       <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter"/>
11     </httpModules>
12     <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN" fileEncoding="utf-8" />
13     <compilation debug="true" targetFramework="4.5" />
14     <httpRuntime targetFramework="4.5" />
15     <webServices>
16       <protocols>
17         <add name="HttpPost"/>
18         <add name="HttpGet"/>
19       </protocols>
20     </webServices>
21   </system.web>
22 </configuration>

其中 configSections  以及rewriter  还有httpModules 是跟重写URL有关的 位置 千万不要搞错了

12     <globalization requestEncoding="utf-8" responseEncoding="utf-8" culture="zh-CN" fileEncoding="utf-8" />  是为了防止中文乱码的   本人搞的webservice

3、   这个托管管道模式改成经典模式,很多的教程里都没有 ,这个必须要改不然的话会报错,找了半天的我差点没一口血喷在电脑屏幕上。

基本上到这里就已经OK了

4、如果配置IIS的话

这里改为经典模式

最后一步

把这里改成允许就可以了

到现在为之已经大功告成

然后后缀神奇的不见了

PS  下载的DLL Intelligencia.UrlRewriter.dll

下载地址:http://download.csdn.net/detail/just_smileoneveryday/7785835

我的是用的VS2012开发工具

希望对大家有所帮助。                  ------------Made by 夜色、花清浅

WebService重写url

时间: 2024-08-04 15:32:55

WebService重写url的相关文章

在Apache中使用mod_rewrite模块重写URL

如果有使用第三方框架做项目时,url路径是可以同过框架给的方法来设定的(如thinkphp),但如果使用原生php写的项目又想重写url,则可通过apache的一些设置来达到想要的效果. 在更改apache的配置之前,应该先了解一些apache的知识:apache中的Directory标签的作用是用于标记我们如何在特定目录订制apache的行为.该标签里会有一个绝对路径,该路径就是你想订制行为的目录. 总体通过apache修改URL的思路就是,在.htaccess文来中对你想要重写的url地址进

在js中获取query string 以及重写URL的函数

函数用途:如标题,1. 从URL中解析出参数,2.重写URL中的参数值 如下代码所示,包含了测试.可以直接copy到浏览器中,输入测试地址:localhost:xxx?a=1&b=2&c=3 ,在console中运行查看结果: // - test // - get from current location var url = document.location.href; // - extract param from url console.log(getUrlParam(url,&q

urlrewrite重写url(转)

环境: Maven 3.0.4 Urlrewrite 2.5.2 Myeclipse 8.6.1 借此机会顺便提一下 Maven Project 的创建,会了的朋友或还不想了解 Maven 的朋友,可以略过创建过程. 创建一个 Maven Project:New --> Other --> Maven Project 在弹出的对话框里,如果你想修改你项目的存放路径你可以改一下,其他的默认,我的所有项目都是存放在默认的工作区下,所以直接点NEXT 接下来找到并选择webapp,其他的默认,NEX

WebService Service(URL, QName, WebServiceFeature[]) is undefined

问题: 输入该命令后:wsimport -keep http://192.168.8.116:8989/webs1/hello?wsdl 出现WebService Service(URL, QName, WebServiceFeature[]) is undefined等错误信息-- 解决方案: 改用下面的命令:wsclient\src>wsimport -target 2.0 -keep http://192.168.8.116:8989/webs1/hello?wsdl 问题解决.

WebService &quot;因 URL 意外地以 结束,请求格式无法识别&quot; 的解决方法

问题出现的前提条件: 1.使用XMLHttpRequest向服务端发送请求,未正常返回信息 2.使用FireBug发现如标题所描述的问题 解决办法: 在WebConfig->system.web下添加webServices节点,入下所示 <webServices>          <protocols>              <add name= "HttpGet" />               <add name= "

HttpContext.Current.RewritePath方法重写URL

if (!IsPostBack) { //如果请求ID为空,则重写URL为:~/index.aspx?ID=shouji.115sou.com if (Request.QueryString["ID"]==null || Request.QueryString["ID"].Trim()=="") { HttpContext.Current.RewritePath("~/index.aspx?ID=shouji.115sou.com&qu

squid如何做正向代理,通过重定向器匹配正则重写url

首先是下载安装squid,squid的官网下载地址页面是http://www.squid-cache.org/Versions/,我安装的是3.5 stable版,此处不赘述,无非是configure.make.make install等 下文参考: http://www.liusuping.com/ubuntu-linux/squid-bianyi-anzhuang-canshu.html http://linuxme.blog.51cto.com/1850814/372960 http://

.htaccess重写URL讲解

使用ThinkPHP和Laravel等框架的都知道,所以的请求都需要经过index.php文件入口,无论你的URI是什么. 当然除了访问的是静态文件或者访问路径的文件真实存在,例如你访问xxx.com/home/page.html 首先,web服务器先去更目录找home文件夹下面的page.html,如果存在就访问这个文件,如果不存在就重新URL,进入index.php大入口 当然,这一切都是规则制定的.请看下面的.htaccess文件[不记得怎么写我教你,.ht+access ] <IfMod

【nginx重写url】之 当项目有多个入口文件时

为了让url更美观,我们不愿意看到 .php 字样的url(逼格高). 但当我们的php项目有多个入口文件时,(假如有index.php, admin.php, app.php, api.php 四个入口文件),在不处理的状态下,url会呈现出这般景象: www.example.com/index.php/xxx/xxx/... www.example.com/admin.php/xxx/xxx/... www.example.com/app.php/xxx/xxx/... www.exampl