WWSAPI to WCF interop 1: WSHttpBinding with no security
WCF provides a number of standard bindings, each targeting a specific usage scenario. WSHttpBinding is for the mainline Internet web services scenario. It uses the newer SOAP version 1.2 and WS-Addressing version 1.0 and enables a wide range of security settings over the public http/https transport. WWSAPI does not have an equivalence of the WSHttpBinding (or any of the WCF standard bindings), but since its default SOAP version, WS-Addressing version and encoding format match those in WSHttpBinding, interoperating between WWSAPI and WSHttpBinding is straightforward. For example, to use service proxy to talk to a WSHttpBinding endpoint without security, you only need to write the code like following snippet (variable declaration and heap/error creation omitted). Notice that no channel properties or security description is specified at WsCreateServiceProxy.
// Create the proxy
hr = WsCreateServiceProxy(
WS_CHANNEL_TYPE_REQUEST,
WS_HTTP_CHANNEL_BINDING,
NULL, // security description
NULL, // proxy properties
0, // proxy property count
NULL, // channel properties
0, // channel property count
&proxy,
error);
if (FAILED(hr))
{
goto Exit;
}
hr = WsOpenServiceProxy(
proxy,
&address,
NULL,
error);
if (FAILED(hr))
{
goto Exit;
}
// make the call through the proxy
hr = WSHttpBinding_ICalculator_Add(
proxy,
1,
2,
&result,
heap,
NULL,
0,
NULL,
error);
if (FAILED(hr))
{
goto Exit;
}
Comments
Anonymous
November 18, 2008
If you have questions about interoperability between Windows Communication Foundation (WCF) and WindowsAnonymous
April 06, 2009
Below you may links to resources available for connecting C/C++ code and Web Services using Windows Web