I am doing a web socket communication process. I was successfully able to do the same by setting the interface and by adding the service reference without any parameters
But I need to send as below:
I have the parameter values from DB but how to pass this base address over a web socket in below Url and get the end point address.
baseaddress
https://10.10.10.1/Test/test?entityDetails= {"requestData":””, "requestkData":“ “} & entityId=”””)
Endpoint address expected:
wss://10.10.10.1/Test/test?entityDetails= {"requestData":””, "requestkData":“ “} & entityId=”””) .
What I have tried:
Interface that worked without querystring
[ServiceContract(CallbackContract = typeof(IWebSocketCallback))]
public interface IWebSocket
{
[OperationContract(IsOneWay = true)]
Task ExecandSendFinancial(string strResponseAPI);
}
public interface IWebSocketCallback
{
[OperationContract(IsOneWay = true)]
Task OnExecandSendFinancial(string strResponseAPI);
}
Task IWebSocket.ExecandSendFinancial(string strResponseAPI)
{
var callback = OperationContext.Current.GetCallbackChannel<IWebSocketCallback>();
In web.config done as below:
<pre> <host>
<baseAddresses>
<add baseAddress="http://localhost:53272/WebSocket.svc" />
</baseAddresses>
</host>
and in the server part
by adding the same service reference got the end point address
<endpoint address="ws://localhost:53272/WebSocket.svc"