1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
|
protected void Page_Load(object sender, EventArgs e)
{
//Execution des methodes d'appel de l'api en fonction
//du paramètre passe dans l'url
switch (Request.Params.Get("RequestType"))
{
case "Request": RequestMethod();
break;
case "Response": ResponseMethod();
break;
case "AutoResponse": AutoResponseMethod();
break;
default :
;
break;
}
}
public void RequestMethod()
{
try{
Response.ContentType="text/html";
TextWriter responseWriter = Response.Output;
responseWriter.WriteLine("<html><head><title>Essais</title></head>");
responseWriter.WriteLine("<body bgcolor=#ffffff>");
responseWriter.WriteLine ("<Font color=#000000>");
responseWriter.WriteLine ("<center><h1>Test en C#</h1></center><br /><br />");
SIPSApiWeb api = new SIPSApiWeb("c:\\repertoire\\myfile");
SIPSDataObject call = (SIPSDataObject) new SIPSCallParm();
/**************************** Parametre *************************/
call.setValue("merc_id","111111");
responseWriter.WriteLine(api.sipsPaymentCallFunc(call));
responseWriter.WriteLine ("<br /><br />");
responseWriter.WriteLine ("</body>");
responseWriter.WriteLine ("</html>");
responseWriter.Close();
}
catch(Exception e){
TextWriter responseWriter;
Response.ContentType="text/html";
responseWriter = Response.Output;
responseWriter.WriteLine("<center>");
responseWriter.WriteLine("<br />");
responseWriter.WriteLine("Error = " + e.GetType().FullName+e.Message);
responseWriter.WriteLine("</center>");
responseWriter.WriteLine("</body>");
responseWriter.WriteLine("</html>");
responseWriter.Close();
}
} |
Partager