HttpBinding for windows server service bus - wcf

Can we have a HTTP protocol binding using WCF to receive a message from windows server service bus on topic/subscription ?

The only wcf Binding you can use is netmessagingbinding which runs over tcp not http. If you want to consume messages via http you will need to use the windows service bus rest api

Related

Sharing port 80 for NetTcpBinding and BasicHttpBinding in IIS 8 hosted WCF service possible?

I have created a .NET 4.0 WCF service to transfer large files from and to clients. Several sources in the web suggest that streaming via netTcpBinding performs significantly better than streaming via basicHttpBinding (streaming, mtom enabled).
On the other hand, establishing a connection to the server via net.tcp is reported to be prone to fail, in most cases due to firewalls, proxies or other company networking restrictions, while establishing a http connection on port 80 can be taken for granted.
What I'd like to do is to provide the streaming service with both http and net.tcp endpoints on the server side. The client tries to connect to the net.tcp endpoint, and in case of a connection error, connect to the http endpoint.
Is there a way to share port 80 between my http and net.tcp endpoints? I'm using IIS 8 as service host, the clients are tied to .NET 4.0, denying the use of .NET 4.5's newly introduced NetHttpBinding.
You can share ports between multiple basicHttp bindings, or between multiple netTcp bindings, but unfortunately you can't mix and have both netTcp and basicHttp share a port. WCF will give you an AddressAlreadyInUseException for that.

Request/response messaging pattern - Azure Service Bus

All ,
I have a doubt on the Request response pattern... Assume the following is my scenario
1.I have a service running on Windows Azure. This service can be called by users to execute a command.
2.I have a client applications that is running on my intranet. This client application will execute the command . The computer in which the client application is running is connected to internet , but does not have a static IP i.e machine cannot be accessed directly via the internet
3.I am planning to use Azure Service Bus through which my service on Windows Azure can communicate with the client application to execute....
In this scenario, can i use Request/response messaging i.e can the service post a message and expect a response from the client
OR
Should i use command queue for each client , the Service will push the command to be executed on a queue , the client will poll the queue and execute a command
Any help is appreciated
Since you are using WCF (based on the tag), you should consider using Service Bus Relay calling the WCF service asynchronously.
I assume you want to use Relaybinding here, using WCF.
Your web service (which is behind NAT, firewall devices, etc) is only opening outbound connections in that case. The service is listening on a registered endpoint in the cloud (that is accessible for him, because of credentials and protocol). All incoming service calls are sent over that port/socket. The response will then be sent back over the outgoing port again.
If the IP Address of your service changes, it wil register itself again (by listening on the same registered endpoint) and you can reach that service transparantly.
Another way you can achieve request/response in an asynchronous fashion, is through queues. This does not require any open connection between your client and your service and can happen fully asynchronous. This can be achieved by sending a message to the request queue for your specific service (with a Correlation Id). And when that service has processed that message, it can send the response to the response queue of your application, using sessions. A good example of this pattern can be found on Alan Smith's blog: http://www.cloudcasts.net/devguide/Default.aspx?id=13051

Javascript Client for Windows Azure Service Bus Relay service?

Is it possible to consume a WCF service via a Windows Azure Service Bus Relay in a JavaScript client?
You can setup a WebHttpRelay service that can be accessed via GET calls in JavaScript if you are using Node.
EDIT: This gives a good overview on how to setup a WCF service to support CORS. You need to enable it on your service to allow calls from a different host.

How does Servicebus Relay relays to correct End Point

I understand that in order to setup Service Bus we need to
Create Service Bus Namespace
Create on premise WCF and point to above Service Bus End Point through Binding.
WCF knows about Service Bus End Point, but how does Service Bus Relay know where to relay the message to specific WCF endpoint in the whole world?
Thanks.
Service Bus doesn't know where the endpoint is. The endpoint makes a connection to Service Bus and then Service bus uses that connection to send requests (relayed from the requesting WCF client) to the WCF endpoint.
The whole point of service bus relay is that there are no connections going from Azure into on premises machines because of the networking/NAT/firewall issues. There is only a connection from the on premises machine to Azure.
The Service Bus WCF Service Relay bindings implement the same behaviors as the corresponding regular WCF Service bindings with one major difference.
Generally, a WCF Service binding is setup to receive incoming connections from clients. The Relay Service bindings, however, are designed to establish an outgoing connection to the Relay service on Azure. The binding is designed to keep a control channel for this connection always alive. The message from the client arrives at the Relay endpoint for the WCF service on Azure, and is forwarded to WCF service through a variety of mechanisms depending on the binding type. The Relay Service bindings thus make it appear that a WCF service is receiving an incoming connection from the client, even though the initial connection was established as an outbound connection.

WCF with tcp.net binding testing with JMeter

I have a problem that in JMeter I can setup server / port, but my application is hosting on IIS 7.5 and WCF service is a "Application" under specific web site. So the service endpoint is
http://localhost:8002/Some.Aplication/Some.Application.svc
WCF application is supporting tcp.net binding also and I should use it(tcp.net).
Ho can I set up JMeter for sending specific packet over tcp to this endpoint ?
Thanks.
You need to use TCP Sampler, and probably write a custom TCPClient class for it for easier handling of custom reads/writes.