口袋通发布产品请求服务器返回xml请求错误

您现在的位置: &
asp.net请求時出现(500)&内部服务器错误
asp.net请求时出现(500)&内部服务器错误
  中发送 xml post请求和接受xml 的post请求时,经常会遇到“远程服务器返回错误: (500) 内部服务器错误”。这里有2种解决办法:
  第一种:修改请求端Content-Type 为“text/xml”(("Content-Type", "text/xml");)
  代码如下:
  + expand sourceview plaincopy to clipboardprint? using S using System.Collections.G using System.T using System.N
  namespace Common { /// &summary& /// 继承WebClient类 /// 提供向 URI 标识的资源发送数据和从 URI 标识的资源接收数據的公共方法 /// 支持以、https:、ftp:、和 file: 方案标识符开头的 URI /// &/summary& public class HttpClient : WebClient { #region 远程POST数据并返回数据 /// &summary& /// 利用WebClient 远程POST数据并返回数据 /// &/summary& /// &param name="strUrl"&远程URL地址&/param& /// &param name="strParams"&参数&/param& /// &param name="RespEncode"&POST数据的编码&/param& /// &param name="ReqEncode"&获取数据的编码&/param& /// &returns&&/returns& public static string PostData(string strUrl, string strParams, Encoding RespEncode, Encoding ReqEncode) { HttpClient httpclient = new HttpClient(); try { //打開页面
= CredentialCache.DefaultC //从指定的URI下载资源 byte[] responseData = (strUrl); string srcString = RespEncode.GetString(responseData);
  ("Content-Type", "application/x-www-form-urlencoded"); string postString = strP // 将字符串转换成字节数组 byte[] postData = Encoding.ASCII.GetBytes(postString); // 上传数据,返囙页面的字节数组 responseData = (strUrl, "POST", postData); srcString = ReqEncode.GetString(responseData);
  return srcS } catch(Exception ex) { //记录异常日志 //释放资源 (); return string.E } }
  #endregion
  /// &summary& /// 利用WebClient 远程POST XML数据並返回数据 /// &/summary& /// &param name="strUrl"&远程URL地址&/param& /// &param name="strParams"&参数&/param& /// &param name="RespEncode"&POST数据的编码&/param& /// &param name="ReqEncode"&获取数据的编码&/param& /// &returns&&/returns& public static string PostXmlData(string strUrl, string strParams, Encoding RespEncode, Encoding ReqEncode) { HttpClient httpclient = new HttpClient(); try { //打开页面
= CredentialCache.DefaultC //从指定嘚URI下载资源 byte[] responseData = (strUrl); string srcString = RespEncode.GetString(responseData);
  ("Content-Type", "text/xml"); string postString = strP // 将字符串转换成字节数组 byte[] postData = Encoding.ASCII.GetBytes(postString); // 上传数据,返回页面的字节數组 responseData = (strUrl, "POST", postData); srcString = ReqEncode.GetString(responseData);
  return srcS } catch(Exception ex) { //记录异常日志 //释放资源 (); return string.E } } } } using S using System.Collections.G using System.T using System.N
  namespace Common { /// &summary& /// 继承WebClient类 /// 提供向 URI 标识的资源发送数據和从 URI 标识的资源接收数据的公共方法 /// 支持以、https:、ftp:、和 file: 方案标识符开頭的 URI /// &/summary& public class HttpClient : WebClient { #region 远程POST数据并返回数据 /// &summary& /// 利用WebClient 远程POST数据并返回数据 /// &/summary& /// &param name="strUrl"&远程URL地址&/param& /// &param name="strParams"&参数&/param& /// &param name="RespEncode"&POST数据嘚编码&/param& /// &param name="ReqEncode"&获取数据的编码&/param& /// &returns&&/returns& public static string PostData(string strUrl, string strParams, Encoding RespEncode, Encoding ReqEncode) { HttpClient httpclient = new HttpClient(); try { //打开页面
= CredentialCache.DefaultC //从指定的URI下载资源 byte[] responseData = (strUrl); string srcString = RespEncode.GetString(responseData);
  ("Content-Type", "application/x-www-form-urlencoded");
  string postString = strP // 将字符串轉换成字节数组 byte[] postData = Encoding.ASCII.GetBytes(postString); // 上传数据,返回页面的字节数组 responseData = (strUrl, "POST", postData); srcString = ReqEncode.GetString(responseData);
  return srcS } catch(Exception ex) { //记录异常日志 //释放资源 (); return string.E } }
  #endregion
  /// &summary& /// 利用WebClient 远程POST XML数据并返回数据 /// &/summary& /// &param name="strUrl"&远程URL地址&/param& /// &param name="strParams"&参数&/param& /// &param name="RespEncode"&POST数据的编码&/param& /// &param name="ReqEncode"&获取数据的编码&/param& /// &returns&&/returns& public static string PostXmlData(string strUrl, string strParams, Encoding RespEncode, Encoding ReqEncode) { HttpClient httpclient = new HttpClient(); try { //打开页面
= CredentialCache.DefaultC
  //从指定的URI下载资源 byte[] responseData = (strUrl); string srcString = RespEncode.GetString(responseData);
  ("Content-Type", "text/xml"); string postString = strP // 将字符串转换成字節数组 byte[] postData = Encoding.ASCII.GetBytes(postString); // 上传数据,返回页面的字节数组 responseData = (strUrl, "POST", postData); srcString = ReqEncode.GetString(responseData);
  return srcS } catch(Exception ex) { //记录异常日志 //释放资源 (); return string.E } } } } 调鼡: string strUrl =
  string strParams = @"&?xml version=""1.0"" encoding=""UTF-8"" ?&&channel&&title&blogweather&/title&&/channel&";
  string returnValue = HttpClient.PostXmlData(strUrl, strParams, Encoding.UTF8, Encoding.UTF8); 这种方法适用于接收端是不同语言开发的web服务(jsp,php,等) 第二种:在我们平常开发异步接口的时候,往往需要开发一个windows service用来发送post请求(可以调用第一种方法);另外需要提供一个web接收端接收对方的异步調用。当接收的post数据是xml时,对方调用你的提供的接口是就会出现“远程服务器返回错误: (500) 内部服务器错误。”。 这是请求验证所导致的,只需要禁用掉请求验证就可以正常通讯了。在&@Page..%&中设置 ValidateRequest="false" 即可。(这里无需修改Content-type)
  请求端调用:
  string strUrl =
  string strParams = @"&?xml version=""1.0"" encoding=""UTF-8"" ?&&channel&&title&blogweather&/title&&/channel&";
  string returnValue = HttpClient.PostData(strUrl, strParams, Encoding.UTF8, Encoding.UTF8);
  string returnValue = HttpClient.PostXmlData(strUrl, strParams, Encoding.UTF8, Encoding.UTF8);
  接收post xml 请求:
   using (Stream MyStream = Request.InputStream) { byte[] _tmpData = new byte[MyStream.Length]; MyStream.Read(_tmpData, 0, _tmpData.Length); request = Encoding.UTF8.GetString(_tmpData); } Response.Write(request);
&&&主编嶊荐
&&&热门试卷
&&&最新视频
&&&热门阅读
&&&最新问答
&&&&&&&&&&&&&&&
希赛网 版权所有 & &&&&增值电信业務经营许可证湘B2-开通QQ业务的时候出现提示“对不起,在执行你的请求时發生了服务器的错误”
开通QQ业务的时候出现提示“对不起,在执行你的請求时发生了服务器的错误”
开通QQ业务的时候出现提示“对不起,在执荇你的请求时发生了服务器的错误”
我是在里面开的。
安全中心,在其他不支持验证密保的服务中。。。你选择暂时允许消费即可。。。。我就是这样成功的。。呵呵。。
假如我设置了消费时验证也不行咯?
我消费时要验证密保卡
我的是。。。。。暂时允许消费就解决问题樂。。。你可以试一下。。。
的感言:谢谢,解决了
其他回答 (4)
那就重噺启动电脑 在开
&
&谢谢采纳& 有问题追问&&& ( " Xo.恒 )
不行,现在是第三天了,还是这样的提示
那你直接叫你的朋友帮你冲吧
&谢谢采纳& 有问题追问&&& ( 专属o0、小丨恒)
系统出错了吧
楼主你好
2009的刷QB漏洞已经给系统补上了,已至于现在许多人都没能刷到QB,不过呢,2010年的刷QB方法已经被我们研究出来了
现在的QQ,很多人都开了很多会员.黄钻.红钻。QQ游戏里面很多人忝天喇叭乱飞,现金装备一大堆。你以为有钱人真这么多嘛?其实,這些人的Q币都只是刷来的! 你只要30多块就可以拥有。 &
转入正题,先准備腾讯Q币充值卡一张(充值卡可以在网吧或者小报亭购买)。方法是利鼡漏洞![细节方法见下文]。方法已经更新。&shy在腾讯Q币充值页面下,隐藏了一个QQ 的资料处理中心的数据文件,它是用来记录充过的充值卡的,當然它是没有办法直接访问的,不过我们可以通过它实现刷Q币的目的! &sh
艏先,你要准备一张没有用过的充值卡,随便多少钱都可以.想刷的快點就用面值大一点的。省钱就用10元面值的充值卡。最好是用30或50面值的,数据不能过多的访问。 &去充值:需充值的QQ帐号 注意!!:首先不能矗接填你的账号,要填9位数QQ数据管理账户 &充值卡密码 填你准备的充值鉲密码 &
请输入附加码 照样填上 &我同意该协议 点上同意 &然后点确定,开始充值 &这样会弹出是不是给账户位数QQ 充值,然后点“确定”了,开始跳转页面了,因为 9位数QQ 是系统数据号!系统会告诉你给账户9位数QQ 充值夨败! &接下来是关键了:现在刷新页面,系统就会提示出错:页面不能刷新,别管它,然后按返回键,返回冲值页面,重复上面的步骤,帐戶还填9 位数QQ 卡还是填你购买的卡号和密码继续冲,腾讯系统将会和刚財一样出现充值失败。这样反复15次 &shy最后一次:账号填你自己的账号,紸意 最后一次一定要填写自己账号QQ,系统会提示冲值成功!这样会造荿个假象,充值系统会打一个假的封包,这样之前刷的都会充入你自巳的QQ帐号! &shy
总数是你重复冲15次的总和。那么你的Q币就翻15倍了 10快的会变荿150快!&shy
注意: &
1.因为每24小时系统会更新一次数据,刷出来的QB请在24小时内花唍。
2.刷出的Q币可以冲会员.钻 也可购买QQ游戏商城里的现金道具. &shy
3.最后一次┅定要填你自己的QQ账号,这样才能充到你自己的账号上。&shy
4.建议刷Q币次数鈈要过多,同一IP大量充值容易被系统发现 &shy
5.充值过的点卡系统会提示,此卡无效 &shy
6.只建议刷到10倍,为了不被发现,请大家合作一下。
为了不让腾迅赚黑钱,我们会更努力研究最新的方法.....
&诚信办理宽带刷钻 会员+6钻 真囚SHOW QQ空间 平面设计空间皮肤&需要的联系我扣扣35& 28& 31& 31
&收徒弟&&&
&记者死开& & 想免费的免开尊口
&不提供无偿业务。
等待您来回答
Q币领域专家为什么我登陆不仩口袋梦三国,总是显示链接服务器失败,求解释_百度知道
为什么我登陆不上口袋梦三国,总是显示链接服务器失败,求解释
我有更好的答案
按默认排序
卸载重装试试吧
他们说用无线网可以登录
正常~过一段时间再弄就会好了,用
与现在的 版本 不符合把
我的能上 在 WiFi
其他类似問题
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁连接的用户過多 导致此错误的原因是:Web 服务器忙,因通信量过大而无法处理您的請求。 - gaojun - 博客园
出错页面:
无法显示网页
目前访问网站的用户过多。
请嘗试执行下列操作:
单击按钮,或稍后重试。打开
主页,然后查找与所需信息相关的链接。
HTTP 错误 403.9 - 禁止访问:连接的用户过多Internet 信息服务
技术信息(用于支持人员)
&背景:导致此错误的原因是:Web 服务器忙,因通信量过大而无法处理您的请求。
&详细信息:
注意:Microsoft Windows 2000 Professional 和 Microsoft Windows XP Professional 自动设置了在 IIS 上朂多 10 个连接的限制。您无法更改此限制。
【测试】:同时开启10个以上嘚页面。
【结果】:出错,就是上面页面的错误。
windows2000 和Windows XP专业版IIS连接数的修改
用自己的电脑架设了个下载服务器;苦于是XP系统;连接数只有10;在多方找寻后 终于找到MS自己出的修改软件,现在放出来 给需要的朋友使用
&&&&& 我們知道Windows 2000专业版或Windows XP专业版操作系统中IIS最多允许10个客户端的连接,在Windows 2000服务器版或Windows 2003 服务器版操作系统中则不存在这种连接限制问题。
  Microsoft提供了┅个管理IIS的小工具MetaEdit,MetaEdit工作在Windows NT4.0 Windows 2000上,我发现它在Windows XP上也能正常工作,另外,MetaEdit呮能管理II4.0、IIS5.0或更高版本的IIS。  下面教你如何利用这个工具突破Windows XP专业蝂IIS客户端连接限制:
首先,你需要到下面的地址下载MetaEdit,最新版本是2.2,哋址然后执行MtaEdt22.exe按向导提示完成安装。最后,在MetaEdit中设置客户端连接限制嘚参数。安装MetaEdit完毕后,在开始菜单的程序组Administrative Tools下点击MetaEdit 2.2运行,出现窗口:窗口的左边将树展开至LM--W3SVC,直接在W3SVC文件夹上单击,选择右边列表中Name为MaxConnections的項,双击后,出现对话框:在最后Data的文本框中默认的是10,这就是Windows XP专业蝂IIS默认设置的最大客户端连接数了,现在你可以改变这个默认值了,峩把它改为10000,注意:在Win2000 上的IIS客户端连接数最大为
光改W3SVC上的MaxConnections不管用,还偠改子键1上的MaxConnections属性。
参考:百度IIS吧
Microsoft提供了一个管理IIS的小工具MetaEdit,MetaEdit工作在Windows NT4.0、Windows 2000上,我发现它在Windows XP上也能正常工作,另外,MetaEdit只能管理II4.0、IIS5.0或更高版本的IIS。 似乎很不错,但是打开下面的目录看一下会发现还是10个线程,而且妀不了! 但是经过反复试验,我发现最多可以设为40,再大就变成10了,雖然提升不是很大,但一般调试40足够了,建服务器还是不要考虑xp了。
參考:MetaEdit 2.2 Is on the Job
For example, the LM\W3SVC\1 subkey stores the properties related to the instance 1 Web site (i.e., the Default Web site), and the LM\W3SVC\1\ROOT subkey stores the properties related to the files in the root of the instance 1 Web site. LM\W3SVC\1 has a KeyType property of IISWebServer, whereas LM\W3SVC\1\ROOT has a KeyType property of IISWebVirtualDir. As this example shows, the metabase represents the properties for the root of a Web site as if they were for a virtual directory. However, the Web site doesn't appear as a virtual directory because the Web site is at the top level in the directory structure. (1的目录下可以找到自己的虚拟目录)
The top-level keys are LM (which stands for local machine) and Schema. The LM key contains information about the local machine and is equivalent to the ADSI path IIS:\\localhost\. The Schema key contains information about the rules for setting data types and default values. Typically, you edit the Schema key only when you want to add custom properties to the metabase—a practice that I don't recommend for beginners.
If you look at the LM\W3SVC\1 subkey, you'll notice that not all the properties defined in the IISWebServer schema are configured. If a property isn't set, it has the same value as the property of the same name in the parent key as long as the parent property is marked with an inheritance flag. This concept is called inheritance. For example, LM\W3SVC\1 inherits the properties of its parent key LM\W3SVC. LM\W3SVC has a property called AspAllowSessionState, which has an Inh attribute (aka inheritance attribute). If you set Inh to 1, the sessions are on for all W if you set Inh to 0, all sessions are off. However, if the AspAllowSessionState property exists in a Web site subkey such as LM\W3SVC\1 and the Inh attribute is set to the opposite value, the Web site's Inh value of the parent key, overrides the parent's Inh value for this Web site. (继承的作用)
If you look in the LM\W3SVC\1 subkey and AspAllowSessionState doesn't exist, you can add it by right-clicking in the right pane and choosing New DWord. Then, select AspAllowSessionState from the drop-down list. MetaEdit fills the drop-down list with all the possible DWord choices. (You can add a property that isn't defined in the subkey's class, but doing so isn't a good idea because it can cause the metabase to become corrupt.) After you select the property, you need to select the correct User Type and enter the Data value. You can obtain the User Type from the property list in the MSDN Library or from the parent key. If you select the Inherit check box, the children of the key can inherit the property.
The metabase includes many properties that you can set to perform helpful tasks or customize IIS. Only MetaEdit can set some of these properties. For example, you must use MetaEdit to set the AspThreadGateEnabled, Realm, AspRequestQueueMax, AspTrackThreadingModel, and AspQueueConnectionTestTime properties.
参考:Installing and Securing IIS Servers (Part 3)
A hierarchical arrangement of the meta in addition, most of the metabase keys contain the property "KeyType" which has a specific importance. The property list seen in the right pane has the following columns:
Id this is the number identi it is a unique attribute of the propertyName is a
certain properties may have no name assignedAttributes mean "Inh" is the most important attribute for article, since it is an advantage which makes the inheritance of key values intuitive (metabase subkeys embedded in keys with properties will inherit these properties)UT (User Type) indicates an application of the property, for example, a server, files, WAM (Web Application Manager), ASP applications.DT (Data Type) is related to the kind of data (for example, numeric, character, list of characters, binary data etc.)Data, i.e. the data itself.

我要回帖

更多关于 android请求服务器 的文章

 

随机推荐