服务遇到错误 [英] Service Encountered an error

查看:69
本文介绍了服务遇到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮助我吗,我遇到这样的错误:
System.InvalidOperationException:为使操作UploadImage中的请求成为流,该操作必须具有一个类型为Stream的单个参数.

这是我在servicecontract中的代码

Can anyone help me on this , I am getting an error like this :
System.InvalidOperationException: For request in operation UploadImage to be a stream the operation must have a single parameter whose type is Stream.

This is my code in servicecontract

[OperationContract]
[WebInvoke(Method = "POST", ResponseFormat = WebMessageFormat.Json, BodyStyle = WebMessageBodyStyle.Wrapped, UriTemplate = "{DataBaseName}/{TableName}/UploadImages?ID={ID}")]
bool UploadImage(string DataBaseName, string TableName, int ID, Stream ImageStream);

推荐答案

您为ImageStream提供的值是Stream类型.错误消息会告诉您确切的问题.向我们显示您拨打电话的代码,我们可能会提供进一步的帮助.
You need to make sure that the value you supply for ImageStream is of type Stream. The error message tells you exactly what is wrong. Show us the code where you make the call and we may be able to help further.


这篇关于服务遇到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆