NServiceBus routing to SOAP endpoint - nservicebus

We are investigating using NServiceBus for our ESB implementation. We have several external partners that do not use Microsoft technologies. Is there a way of routing using NServiceBus to a SOAP or REST service and then accepting the message as processed based on the response from the service.

Yes, you can have a service expose a WCF endpoint to accept a Command, process it, and return an error/return code which is then delivered in the web service response.
Check out the article How Do I Expose An NServiceBus Endpoint As A Web/Wcf Service? on the NServiceBus support site, but be aware that as of NServiceBus 4.0 (currently in beta) the Webservice option the article mentions is being removed, as Microsoft has officialy declared ASMX web services to be a "legacy technology".
That aside, a WcfService should work quite well for this scenario.

Related

Mule:The difference between the Web Service Consumer and SOAP Connect

Why do we have SOAP connect option while creating a connector when we already have a Web Service Consumer connector? We can configure a wsdl with Web Service Consumer and access a web service. What is the difference between the two options?
"Why do we have SOAP connect option" because MuleSoft want to provide a method for ISV to provide connectors to new and existing endpoints without Mulesoft themselves having to create them. Mulesoft Anypoint Platform success is built on the premise of connecting to anything and therefore SOAP Connect helps this.
Secondly connecting to a using WSDL location for consuming a soap web service involves a developer to know the service pretty well and therefore allowing error and interpretation errors but if you internally create a connector you can reduce implementation time and errors.
Thirdly on WSDL there are often many methods not applicable or and an enterprise does not want to consume and therefore a connector can filter these methods.
Connectors = Re-Use
Web Service Consumer connector = manual process
The Web Service Consumer is an existing connector that you can configure to point to a WSDL location for consuming a soap web service. SOAP Connect is a DevKit wizard that creates an Anypoint Connector that connects to a specific service, which can expose multiple WSDLs of the service.
With Web Service Consumer we have to call each API separately in separate flows. With SOAP Connect, you can package multiple WSDL files and API versions into a single connector, making the process of creating, maintaining and using a connector for SOAP APIs much faster and easier.

Consuming WCF service (without metadata) on a non-.net platform

I have created a WCF service and hosted it through self hosting. This service doesn't have any metada published.
First Question
Can I consume it through Visual Studio, Add Service Reference? Hopefully not.
Can I consume it by creating manual proxy, i.e. ChannelFactory<ServiceContract>....?Hopefully yes.
Now in the second scenario, the client must be .Net, right?
So it implies that, to consume a wcf service on a non-.net platform, we have to expose its metadata?
Can't a WCF service without metadata, consume by Ajax client, or say Java client??
There are 3 options to consume a WCF Service:
If the service exposes a WSDL use "add service reference" from VS (or an equivalent from another platform). Note that if you do not want to expose the WSDL you could expose it just temporarly, save the WSDL in a file, and then send it to user in any platform to generate proxy from it. You can turn off the WSDL immediately after you save it. Also note that even if the WSDL is not exposed still you need to protect the web service from unauthorized access.
If this is a .Net client it can compile with the same Service Contract assembly and use ChannelFactory etc.
Any platform can send raw soap message (e.g. XML) to the service. Of course they need to know what is the right format. A WSDL can help but even without it if they have a working sample they can imitate it.
WCF provides REST (Representational State Transfer) support to consume it by non .NET client like JavaScript (AJAX), java, Objective C, web browser, etc...
Basically WCF REST is exposes methods and transferring data over the HTTP protocol and it supports all HTTP operations (GET, POST, PUT, and DELETE). This feature is making it platform independent as well as it doesn’t require metadata exposed.
Please refere below links to get more about WCF REST:
An Introduction To RESTful Services With WCF
WCF REST Programming Model Overview
WCF Rest vs. WCF SOAP
Create RESTful WCF Service API: Step By Step Guide

Microsoft WCF - SOAP messaging protocol

is that correct that the default Web Service created using WCF will have WSDL but the message transmission required should not have SOAP tags like
<soap:envelope>, <soap:header>, <soap:body> ?
Are they still using SOAP 1.1 in this case then?
And then, how can I create another web service using JAX-WS that is following this standard?
Thanks a bunch,
Robert
It's not clear to me what you're asking but if you're trying to invoke java based services (Apache, Metro, etc...) with a WCF client, take a look at the WCF Express Interop bindings.

How to publish binding details of the WCF web service to clients on the internet?

I want to host my WCF web service in the public domain (on internet) so that any client application (java, .net etc.) can consume it.
The WSDL will give details of the service (what it offers etc.). But,
How to inform the binding details to the clients?
I want to know how do we inform binding details to the outside world when you are on internet and you do not know who the client will be. WSDL gives the details of the service; similarly what mechanism is there to inform the binding that's required to communicate with the service.
Do I need to stick to some specific bindings when I want to publish my web service over internet where anybody can consume it?
svcutil or Visual Studio (using svcutil in background) will understand binding specification provided by metadata exchange binding (look here)
it wouldn't. If You want Your web service to by used by technologies other than .NET You shouldn't use .NET specific implementations.
basicHttpBinding works with soap 1.1. wsHttpBinding with soap 1.2 and WS-*. You shouldn't use other bindings if you want your web service to be interoperable.

Exposing meta data for a WCF 4.0 Rest Template Service

Probably missing something very basic. I created a WCF 4.0 Rest Service. It works no problems when I'm hitting the url from a browser and I'm getting back what I want.
But now I want to use that service from a client mvc application (it will also be used by other non .net platforms which is why it's a rest service in the first place).
Problem is how do I get a service reference to it so I can start to use it in my c# code? With the new minimal WCF .net 4 config approach and no interface for the service contract, I don't know how to specify a mex endpoint. Ultimately I don't want a mex endpoint in production, just during development. I would love to be able to specify that all my services (around 10 in one application) have endpoints with one tiny piece of config that vs2010 .config transformations just rips out when I publish.
Stop. REST service doesn't use metadata. Metadata (Mex endpoint) are only for SOAP services because WSDL 1.1 (the only version supported by WCF) is able to describe only SOAP service. WADL or WSDL 2.0 is able to describe REST service but non of them is currently supported by WCF.
REST service is consumed by using WebRequest directly or by building ChannelFactory on top of shared contracts. Both methods are described here. Other method is to use HttpClient from REST Starter kit (former API). The problem with Starter kit is that it has never reached RTM (it was replaced by WCF 4). Instead of metadata endpoint WCF 4 REST service offers help page where all operation are described. When using WCF 4 REST template the help page should be already turned on - just add /help sufix to address of your service. Here is another article about building REST clients.