以下是我想从SQL JOB调用ASP1.1 Web方法的场景(存储过程) 但我收到内部服务器错误(500)。 但它成功调用了ASP.NET4.0 url(调用webservice)。
所以现在我从ASP.NEt4.0 web服务
调用1.1 web方法ASP.NET4.0
[WebMethod]
public void CALLEV()
{
EVAutoService.POSEVAutomation wsEVAuto = new EVAutoService.POSEVAutomation();
wsEVAuto.AutomateEVForTodaySchPatient();
}
ASP1.1 WEB方法代码
<WebMethod(EnableSession:=True)> _
Public Function AutomateEVForTodaySchPatient()
CheckPhySchPatEV(getStaffId())
End Function
收到错误消息
System.Web.Services.Protocols.SoapException: Server was unable to process request. --> String was not recognized as a valid Boolean. at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall) at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at POS.EVAutoService.POSEVAutomation.AutomateEVForTodaySchPatient()
我还在ASP.NET4.0 webservice中使用webrequest来调用1.1 web方法
WebRequest request = HttpWebRequest.Create(GetHWServiceURL());
using (WebResponse response = request.GetResponse())
{
using (StreamReader reader = new StreamReader(response.GetResponseStream()))
{
string urlText = reader.ReadToEnd();
//Do whatever you need to do
}
}
但它没有用但是得到Net.WebException
System.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at
因为我怀疑它是由于某些安全性异常,因为两者都在同一台服务器上使用,但两者都是localhost上的独立项目。