我正在尝试设置NetTCP WCF服务。
这是我的服务器代码:
iSync.cs :
[ServiceContract]
public interface ISync
{
[OperationContract(IsOneWay = true)]
void UploadMotionDynamic(byte[] jpegStream, string alias, Int16 camIndex, byte[] motionLog, double mul, byte isLive, byte doIsave);
}
Sync.cs :
public class Sync : ISync
{
public void UploadMotionDynamic(byte[] jpegData, string alias, Int16 camIndex, byte[] motionLog,double mul,byte isLive, byte doIsave)
{
//do stuff
}
}
的web.config :
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="NetTCPBehaviour">
<serviceDebug includeExceptionDetailInFaults="True" />
<dataContractSerializer maxItemsInObjectGraph="65536" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="Sync" behaviorConfiguration="NetTCPBehaviour">
<endpoint address="net.tcp://localhost:8888/Sync" binding="netTcpBinding" contract="ISync" name="wsSyncerMotion" bindingConfiguration="NetTCPBindingEndPoint"/>
</service>
</services>
<bindings>
<netTcpBinding>
<binding name="NetTCPBindingEndPoint" sendTimeout="00:01:00">
<security mode="None" />
</binding>
</netTcpBinding>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
</system.serviceModel>
现在它不能被阻塞,因为我甚至通过关闭防火墙来测试它。
我得到的错误(现在)是:
(我似乎无法通过在不同标签中查看来放大此图像)