Creating native code C/C++ client to WCF services that uses wsHttpBinding with WWSAPI

Several developers have asked me this question and I have decided to create one blog post with the answer. If you use Windows 7 Beta version of wsutil.exe, you would see that it might not generate _CreateServiceProxy helper function in some cases for services that use WsHttpBinding. In Beta, wsutil.exe would issue the following warning:

No supported policy setting was found in input metadata. No policy information is generated.

Hao has mentioned the root cause of the issue in one his posts about WWSAPI to WCF Interop. To reiterate, the root cause of the issue is that WWSAPI in the first version (Windows 7) does not support full message security mode. Same time, the full message mode is the default security mode for wsHttpBinding in WCF. To use WWSAPI to build clients to this service, you have to change <security> configuration setting of the binding from "message" to "transport" with appropriate user authentication setting. Here is an example of the change.

Before:

<bindings>

    <wsHttpBinding>

        <binding name="wsHttpBindingWithTransportSecurity">

            <security mode="message">

            </security>

        </binding>

    </wsHttpBinding>

</bindings>

After (note that you have to change clientCredentialType to a desired setting in your case):

<bindings>

    <wsHttpBinding>

        <binding name="wsHttpBindingWithTransportSecurity">

            <security mode="Transport">

                <transport clientCredentialType="SomeCredType"/>

            </security>

        </binding>

    </wsHttpBinding>

</bindings>

Also in RC version of wsutil.exe, we have changed the warning message to describe the root cause of the problem. Now wsutil.exe outputs the following for this scenario:

warning WSUTIL0089 No supported policy setting has been found in the input metadata. The service may be using a binding configuration non-supported by WWSAPI such as message security setting. See documentation for the list of configurations supported by WWSAPI.

Policy information is not generated.

I hope that this post helps you with troubleshooting this issue.