One of my favorite’s features of the WSE 3.0 adapter is the capabilities to invoke Web Services that uses non-HTTP transports. That’s a feature that a lot of people, including myself, were expecting on the WSE 2.0 adapter for BTS 2004.
Now with on this version we are able to invoke Web Services hosted using transports like Tcp, MSMQ, etc. We can also expose orchestration as host-independent ASMX services and how those services in an application that uses a different transport.
Let’s run through a simple demo.
Suppose that we have the following WSE 3.0 Web Services hosted in a Console application using TCP-IP as transport.
public class UtilWebService: SoapService
public string Echo(string msg)
Console.WriteLine(“Request received: message=” + msg);
return “Message received: “ + msg;
Figure 1: WSE Service code
The Web Services host looks like the following:
static void Main (string args)
UtilWebService service = new UtilWebService();
Console.WriteLine(“Soap Tcp Service…”);
Uri to = new Uri(“soap.tcp://tc2003s:8089/MathWS”);
EndpointReference EPR = new EndpointReference(to);
Figure 2: WSE Service Tcp host
The WSE Schema Generator wizard is able to query a TCP endpoint using WS-MetaDataExchange (I blogged about this technique a while ago) to obtain the Web Service WSDL.
Figure 3: Importing schemas
The next required step is to configure the WSE 3.0 send port at deployment time. As part of the Send Port properties we can specify a soap:tcp address.
Figure 4: Send Port properties.
With that configuration the WSE 3 adapter will send the following Soap request to the WSE Service.
<soap:Envelope xmlns:wsa=”http://schemas.xmlsoap.org/ws/2004/08/addressing“ xmlns:soap=”http://schemas.xmlsoap.org/soap/envelope/“>
Figure 5: Soap Request