C# WCF服务流图像
我想让WCF服务,可以把图像流 我在配置中有下一步:C# WCF服务流图像,c#,wcf,stream,datacontract,C#,Wcf,Stream,Datacontract,我想让WCF服务,可以把图像流 我在配置中有下一步: <service name="Images" behaviorConfiguration="ImagesBehavior"> <endpoint address="http://localhost:5523/Images.svc" binding="basicHttpBinding" contract="Images" /> <endpoint address="mex" bindi
<service name="Images" behaviorConfiguration="ImagesBehavior">
<endpoint address="http://localhost:5523/Images.svc"
binding="basicHttpBinding" contract="Images" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:5523/Images" />
</baseAddresses>
</host>
</service>
<behavior name="ImagesBehavior">
<serviceDebug includeExceptionDetailInFaults="true" />
<serviceMetadata httpGetEnabled="true" />
</behavior>
但当我通过类似浏览器的方式尝试时
http://localhost:5523/Images.svc/GetImage/imagecodeblabla
我有
400错误请求
什么时候
405方法不允许
怎么了?您的服务是SOAP还是REST?看起来您使用的是REST语法(WebGetAttribute),但您的绑定是BasicHttpBinding(SOAP)
尝试改用,看看效果如何 如果WebOperationContext.Current为空,您肯定会得到奇怪的响应。但我甚至没有进入函数。未达到断点。
http://localhost:5523/Images.svc/GetImage/imagecodeblabla