웹 서비스에서 이미지 데이터 형식을 보낼 수 없습니다 :내가 데이터를 전송하는 웹 서비스 코드의 라인을 사용
byte[] bajtat = (byte[])dr["Logo"];
MemoryStream ms = new MemoryStream(bajtat, 0, bajtat.Length);
ms.Write(bajtat, 0, bajtat.Length);
Image img = Image.FromStream(ms, true);
var partite = new Partite
{
EmriPartite = dr.GetString(2),
/*
* SqlDataReader.GetString - gets the value of the specified column as a string
*/
NrPartive = dr.GetInt32(1),
Akronimi = dr.GetString(4),
Foto = img
};
을 그리고 그것은 나에게 오류 보여줍니다
System.Web.Services.Protocols.SoapException을 : 서버가 요청을 처리 할 수 없습니다. ---> System.InvalidOperationException : XML 문서를 생성하는 중 오류가 발생했습니다. System.InvalidOperationException ---> System.Drawing.Bitmap 형식이 필요하지 않습니다. 정적으로 알 수없는 형식을 지정하려면 XmlInclude 또는 SoapInclude 특성을 사용하십시오. at
(123) 개발자를 가질 수 있습니다 바이트 [] 버퍼 = 바이트로 값 []; BitmapSource MyImageSource; // 새로운 BitmapSource()를 만들 수 없습니다. MyImageSource.SetSource (new MemoryStream (buffer, 0, buffer.Length); – Edon