问题描述
如果这个问题很抽象,我很抱歉。我会尽量具体。总而言之,我使用“HttpTransportBindingElement”类从主机到客户端来回发送一些 SOAP。这里唯一的区别是我不处理会议的开始和结束,因为这个链接建议人们应该这样做。 https://docs.microsoft.com/en-us/dotnet/api/system.servicemodel.channels.httptransportbindingelement?view=dotnet-plat-ext-5.0
相反,一旦一切都设置好,我就会将它交给一个类来处理,该类是为了使用 SOAP 与服务器通信而编写的。我的问题是,即使我将控制权交给了不同的班级,有没有办法让我重新获得控制权?更具体地说,我想向服务器发送一个 FIN/ACK。类(或 Onvif WSDL)和服务器的构造方式似乎只有服务器发送 FIN。我的具体应用要求我保留在需要时向服务器发送 FIN 的能力。
//Building HttpTransport object
HttpTransportBindingElement httpTransport = new HttpTransportBindingElement();
httpTransport.AuthenticationScheme = System.Net.AuthenticationSchemes.Digest;
deviceUri.Host = ip;
var messageElement = new TextMessageEncodingBindingElement();
messageElement.MessageVersion = MessageVersion.CreateVersion(EnvelopeVersion.soap12,AddressingVersion.None);
System.ServiceModel.Channels.CustomBinding customBinding = new System.ServiceModel.Channels.CustomBinding(messageElement,httpTransport);
binding = new System.ServiceModel.Channels.CustomBinding(new TextMessageEncodingBindingElement(MessageVersion.soap12,Encoding.UTF8),httpTransport);
//Hand it off to Onvif Object.
DeviceClient Onvif_Device = new DeviceClient(binding,new EndpointAddress(deviceUri.ToString()));
//Utilize Object Device Services
OnvifDevice.Service[] service = Onvif_Device.GetServices(false)
//Send FIN to sever on port 80.
请参阅... https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl 以了解 Onvif WSDL。
任何帮助将不胜感激。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)