调用具体webservice方法时时报错误:请求因 HTTP 状态 503 失败: Service Temporarily Unavailable
添加web引用会在相应项目的app.cofig文件中产生如下代码:
<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="BS.EAP.BizMgt.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</sectionGroup>
………………
<BS.EAP.BizMgt.Properties.Settings>
<setting name="BS_EAP_BizMgt_IPersonCard_PetroChina" serializeAs="String">
<value>http://10.27.213.172:8080/PetroChinaService/PetroChina</value>
</setting>
<setting name="BS_EAP_BizMgt_GetVisitService_ReportSSO" serializeAs="String">
<value>http://10.88.248.111:88/dm/cxf-services/ReportSSO</value>
</setting>
</BS.EAP.BizMgt.Properties.Settings>
</applicationSettings>
</configuration>
红色字部分是所引用web服务地址:http://10.88.248.111/dm/cxf-services/ReportSSO
要手动增加上端口88问题解决
以下内容应用自:http://www.cnblogs.com/BruceLee521/archive/2012/03/28/2420776.html
环境:
Webservice部署到内网机器,地址:http://aaa.bbb.ccc.ddd/xkzjk/LicensesService.asmx
通过端口影射到外网地址:http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx
同事碰到的第一个问题:
在Visual Studio中引用Webservice报如下错误:
在Visual Studio 2008下报如下错误:
Unable to download following files from.
http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx?wsdl
Do you want to skip these files and continue?

在Visual Studio 2010报如下错误:
An error(Details) occurred while attempting to find services at ‘http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx’
元数据包含无法解析的引用:“http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx?wsdl”。
下载“http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx?wsdl”时出错。
请求因 HTTP 状态 503 失败: Service Temporarily Unavailable。
元数据包含无法解析的引用:“http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx?wsdl”。
元数据包含无法解析的引用:“http://eee.fff.ggg.hhh:88/xkzjk/LicensesService.asmx?wsdl”。
If the service is defined in the current solution, try building the solution and adding the service reference again.
原因:
开发人员对Webservice不懂,WSDL不知道是干什么的,引用的地址少了?wsdl,第一个问题解决。
同事碰到的第二个问题:
调用具体webservice方法时时报如下错误
请求因 HTTP 状态 503 失败: Service Temporarily Unavailable。
说明: 执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。
异常详细信息: System.Net.WebException: 请求因 HTTP 状态 503 失败: Service Temporarily Unavailable。
分析:
具体去看异常内部信息:
ResponseUri={http://eee.fff.ggg.hhh/xkzjk/LicensesService.asmx},开始没仔细看,后来找了很久,发现少了外网映射的端口88。
原因:
在Visual Studio 2008中引用Webservice时,在Web.config中自动增加如下节
<applicationSettings>
<Test.Web.Properties.Settings>
<setting name="Test_Web_LicService_LicensesService" serializeAs="String">
<value>http://eee.fff.ggg.hhh/xkzjk/LicensesService.asmx</value>
</setting>
</Test.Web.Properties.Settings>
</applicationSettings>
在工程的Settings.settings文件中增加了App的设置,代理类会使用该设置的变量。
在Visual Studio 2010中引用Webservice时,在Web.config中自动增加如下节
endpoint address="http://eee.fff.ggg.hhh/xkzjk/LicensesService.asmx"
binding="basicHttpBinding" bindingConfiguration="LicensesServiceSoap"
contract="ServiceReference1.LicensesServiceSoap" name="LicensesServiceSoap" />
定义了Webservice的一些基本信息。
请注意Visual Studio都把端口去掉了。手动在Web.config里增加上88端口问题解决。
总结:第一个问题是因为对Webservice的原理不明白。第二个对Visual Studio引用Webservice的原理不清楚,只会用,现在很多人对Webservice的一些基本理论知识都不明白,就是上来就用Visual Studio引用,然后调用。
调用具体webservice方法时时报错误:请求因 HTTP 状态 503 失败: Service Temporarily Unavailable的更多相关文章
- 调用webserver时出现:请求因 HTTP 状态 401 失败: Unauthorized。
请求因 HTTP 状态 401 失败: Unauthorized 今天在调用webserver时出现了上述标题的错误,开始认为是由于端口的问题,我把端口恢复80默认端口后,但是问题并没有解决!后来我自 ...
- android ksoap2调用.net Webservice 方法总结
android ksoap2调用.net Webservice 方法直接放到一个类里: package com.util; import org.ksoap2.SoapEnvelope; impor ...
- 在执行context.getContentResolver.query()方法时出现错误。
1. 在执行context.getContentResolver.query()方法时出现错误. 07-15 18:46:13.470: E/AndroidRuntime(13624): FATAL ...
- 无法解析此远程名称: 'www.***.com' 解决办法 请求因 HTTP 状态 417 失败
今天在做接口开发时,遇到了一个异常:无法解析此远程名称: 'www.***.com'.我的网站一直是运行正常的,从昨天开始出现异常,用户可以使用,但我的服务器怎么也无法实现对数据库的更新. 分析原因: ...
- Web service request SetParameters to Report Server http://host/reportserver failed. Error: 请求因 HTTP 状态 401 失败: Unauthorized
迁移CRM服务器完成后在访问CRM的内部报表时报错,在查看应用服务器的日志时发现报"Web service request SetParameters to Report Server ht ...
- Magento Service Temporarily Unavailable解决方法
插件升级错误或安装失败时 会出现Service Temporarily Unavailable错误,使网站前台后台都无法显示. 在操作完成的情况下,仍然出现这个错误时可以采用以下方法: 1.删除网站站 ...
- OSGI.NET,请求因HTTP状态404 失败:Not Found
在VS里使用OSGI.NET可以正常运行项目和插件,开放工厂远程管理工具也可以使用,没有任何异常.可是,当我把项目部署到IIS上,网站可以正常运行,插件也正常:使用开放工厂远程管理工具时,就出现&qu ...
- magento错误 Service Temporarily Unavailable magento
前台访问出现错误 Service Temporarily Unavailable magento 解决方法 Service TemporarilyUnavailable字面意思是此服务暂时无法使用,如 ...
- Java调用.NET webservice方法的几种方式
最近做项目,涉及到web-service调用,现学了一个星期,现简单的做一个小结.下面实现的是对传喜物流系统(http://vip.cxcod.com/PodApi/GetPodStr.asmx?ws ...
随机推荐
- Swift 流程控制
import Foundation ...{ == { print(index) } } // 可选变量 类型后面加? var myName:String?="jikexueyuan&quo ...
- C#中对Excel进行操作
工作中要处理一批数据,主要是处理从别处导出来的Excel表格(大概有一千多行,三十多列),拿到表格对Excel表格进行分析,按照一定的规则进行拆分成为一万多行的数据:首先这个需求要用程序进行处理的背景 ...
- 有几数组表单,js怎么获得数组并动态相加输出到文本框
有几数组表单,js如何获得数组并动态相加输出到文本框<input name= "fee1[] "> <input name= "fee2[] & ...
- SDP (Session Description Protocol)
SDP的描述网络上一大堆中文的,可以看看RFC2327 SDP 信息是文本信息,采用 UTF-8 编 码中的 ISO 10646 字符集.SDP 会话描述如下:(标注 * 符号的表示可选字段): v ...
- php 中PHP_EOL使用
一个小小的换行,其实在不同的平台有着不同的实现,为什么要这样,可以是世界是多样的.本来在unix世界换行就用/n来代替,但是windows为了体现他的不同,就用/r/n,更有意思的是在mac中用/r. ...
- python 中变量的命名规范
出自:http://www.diybl.com/course/3_program/python/20111130/563643.html 模块名: 小写字母,单词之间用_分割 ad_stats.py ...
- BASE64的实现
原由 项目中经常需要使用base64进行处理,通过base64可以将特殊字符转化为普通可见字符,便于网络传输,代价是增长了传输长度. base64将每3个byte转化为4个6bit位,然后高位补两个零 ...
- ASIHTTPRequest中的DELETE、PUT、GET、POST请求实例-备用
感谢分享 // ASIFormDataRequestTests.m // Part of ASIHTTPRequest -> http://allseeing-i.com/ASIHTTPRe ...
- hdu Big Number
#include <cstdio> #include <cstring> #include <cmath> using namespace std; int mai ...
- BZOJ 1492 货币兑换Cash
http://www.lydsy.com/JudgeOnline/problem.php?id=1492 思路: 问题转变为维护一个凸包,每次转移都找凸包上的点,并更新凸壳 可以用splay维护,或者 ...