您好我有这个Web服务http://cloudinvoice.azurewebsites.net/Invoice,我想要做的就是将它连接到我的Windows Phone照片上传应用程序。有什么建议?
*。SVC
[ServiceBehavior(
ConcurrencyMode = ConcurrencyMode.Multiple,
InstanceContextMode = InstanceContextMode.Single
)]
public class InvoiceSvc : IInvoiceSvc
{
public void UploadInvoice(InvoiceImg invoice)
{
using (InvoiceContext db = new InvoiceContext())
{
Invoice dbinv = new Invoice();
dbinv.Name = invoice.Name;
dbinv.Surname = invoice.Surname;
dbinv.shotDate = invoice.ShotDate;
dbinv.uploadDate = DateTime.Now;
dbinv.imgData = invoice.ImgData;
db.Invoices.Add(dbinv);
db.SaveChanges();
}
}
}
}
* CS
[ServiceContract]
public interface IInvoiceSvc
{
[OperationContract]
void UploadInvoice(InvoiceImg invoice);
}
[DataContract]
public class InvoiceImg
{
[DataMember]
public string Name { get; set; }
[DataMember]
public string Surname { get; set; }
[DataMember]
public DateTime ShotDate { get; set; }
[DataMember]
public byte[] ImgData { get; set; }
}
}