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
| using System;
using System.Collections;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
namespace WebApplication2
{
/// <summary>
/// Description résumée de $codebehindclassname$
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class Image : IHttpHandler
{
public void ProcessRequest(HttpContext context)
{
GridsureService service = new GridsureService();
getAuthenticationGridResponseType response = service.getAuthenticationGrid(new getAuthenticationGridType());
context.Session.Add("idGrid", response.token);
context.Response.ContentType = "image/jpeg";
System.IO.MemoryStream ms = new System.IO.MemoryStream(response.grid);
ms.WriteTo(context.Response.Write);
}
public bool IsReusable
{
get
{
return false;
}
}
}
} |