Web -API Get Call -Ursachen konnten keine Datei finden, wenn Code auf den Host verschoben wurdeC#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Web -API Get Call -Ursachen konnten keine Datei finden, wenn Code auf den Host verschoben wurde

Post by Anonymous »

Hier ist der Fehler, funktioniert gut über VS lokal, aber ich erhalte diesen Fehler, sobald ich ihn auf den Testserver verschiebe. Ich würde annehmen, dass es sich um eine Servereinstellung handelt, die den Prozesszugriff nicht zulässt, aber wenn es eine Arbeit gibt, die sich um jemanden widmet, würde ich mich darüber freuen. Ich treffe einen JSON -Get -API < /p>

Code: Select all

An error has occurred via the CCR Referrals application. See the exception details below for further explanation.
< /code>

System.net.webexception: konnte keine Datei 'C: \ Windows \ System32 \ inetrv \ mxy = 445544' finden. ---> system.net.webexception: konnte keine Datei 'c: \ windows \ system32 \ inetsrv \ mxy = 445544' finden. ---> System.io.FilenotFoundException: konnte keine Datei 'C: \ Windows \ System32 \ inetsrv \ mxy = 445544' finden. at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost) at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy) at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async) at system.net.filewebresponse..ctor (DateiwebRequest-Anfrage, URI URI, FileAccess-Zugriff, Boolean asynchint System.net.FilewebRequest.getresponsecallback (Objektzustand) --- Ende der inneren Ausnahme-Stack-Trace --- at system.net.webclient.downloadDatainternal (URI-Adresse, WebRequest & < /p>
< /blockquote>
string API_URL = (string)System.Configuration.ConfigurationManager.AppSettings["API_URL"];
string username = "TheDudeAbides";
string password = "xyz1234";
string credentials = Convert.ToBase64String(Encoding.ASCII.GetBytes(username + ":" + password));

//THE COMPLETED API URL plus the rn to lookup
API_URL = API_URL + "rn="+rn;

try
{
//get th json results from the response from the URL call
using (WebClient client2 = new WebClient())
{

//tell the call to use basic authorization and add the credentials to the client call
client2.Headers[HttpRequestHeader.Authorization] = "Basic " + credentials;
var responseOK = client2.DownloadString(PRES_API_URL);
List listProts = Service.GetOpenProtsAppTable();

if (responseOK != null)
{
if (responseOK != "")
{
JArray jsonArray = JArray.Parse(responseOK);
foreach(JObject item in jsonArray)
{

enrollment pe = new Patient_Enrollment();
//Find the protocol ID from the jSON response
var itemProperties = item.Children();
var protocolElement = itemProperties.FirstOrDefault(x => x.Name == "protocol");
var protocol = protocolElement.Value;

Protocol prot = listProts.FirstOrDefault(i => i.protocolId_Display == protocol.ToString());
if (prot != null)
{
pe.IprotocolId = prot.protocolId.ToString().Replace("-", "");
pe.IshortTitle = prot.shortTitle;
pe.IstudyId = Convert.ToString(prot.studyId);

//instatiate the PRES API information into Patient_Enrollment objects, to compare to what Referrals has for enrollment on the MRN.
enrollments.Add(pe);
}

}

}
}
}
}
catch (WebException e)
{
//email that the API is down.
Email.SendErrorNotification("API Down", e.ToString());
}

}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post