locked
can't use wsutil.exe to generate c++ code for a duplex mode service RRS feed

  • Question

  • Hi,

          When I tried to use wsutil.exe to generatio C++ code from .wsdl, it just gave me some error messages and failed to output any c++ code.

          It seems the wsutil.exe met some problem when it was handling callback contract.

    Here are the error messages.

    D:\Src\WebCast20090120pm_Demo\WcfServiceLibrary2>wsutil.exe *.wsdl *.xsd
    Microsoft (R) Windows Web Services Tool, version 1.0092
    Copyright (c) Microsoft Corporation.  All rights reserved.
    error WSUTIL0059  There is no input binding information for operation 'Equals'.       
    error WSUTIL0059  There is no input binding information for operation 'Equation'
    .

    //"Equals" and "Equation" are  functions in the callback contract
    warning WSUTIL0089  No supported policy setting has been found in the input meta
    data. The service may be using a binding configuration non-supported by WWSAPI s
    uch as message security setting. See documentation for the list of configuration
    s supported by WWSAPI.

    Policy information is not generated.


    warning WSUTIL0083  Error during compilation. No file was generated.

     

    Here are my interfaces:

     

    namespace WcfServiceLibrary2
    {
        [ServiceContract(Namespace = "http://Microsoft.ServiceModel.Samples", SessionMode = SessionMode.Required,
                 CallbackContract = typeof(ICalculatorDuplexCallback))]
        public interface ICalculatorDuplex
        {
            [OperationContract(IsOneWay = true)]
            void Clear();
            [OperationContract(IsOneWay = true)]
            void AddTo(double n);
            [OperationContract(IsOneWay = true)]
            void SubtractFrom(double n);
            [OperationContract(IsOneWay = true)]
            void MultiplyBy(double n);
            [OperationContract(IsOneWay = true)]
            void DivideBy(double n);
        }

        public interface ICalculatorDuplexCallback
        {
            [OperationContract(IsOneWay = true)]
            void Equals(double result);
            [OperationContract(IsOneWay = true)]
            void Equation(string eqn);
        }

    }

    and ABC in my app.config

     

        <service name="WcfServiceLibrary2.CalculatorService" behaviorConfiguration="WcfServiceLibrary2.Service1Behavior">
            <host>
              <baseAddresses>
                <add baseAddress="http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary2/CalculatorService/"   />
              </baseAddresses>
            </host>
            <!-- Service Endpoints -->
            <!-- Unless fully qualified, address is relative to base address supplied above -->
            <endpoint address=""  binding="wsDualHttpBinding" contract="WcfServiceLibrary2.ICalculatorDuplex">
              <!--
                  Upon deployment, the following identity element should be removed or replaced to reflect the
                  identity under which the deployed service runs.  If removed, WCF will infer an appropriate identity
                  automatically.
              -->
              <identity>
                <dns value="localhost"/>
              </identity>
            </endpoint>
            <!-- Metadata Endpoints -->
            <!-- The Metadata Exchange endpoint is used by the service to describe itself to clients. -->
            <!-- This endpoint does not use a secure binding and should be secured or removed before deployment -->
            <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
          </service>

     

    I debuged this code with my vs2008, so I can use\

    svcutil.exe /t:metadata http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary2/CalculatorService

    to download wsdl and xsd.

    Then I used

    wsutil.exe *.wsdl *.xsd.

    to generate the code.

     

    I excuted these command in windows 7 and .net 3.5 sp1 sdk command shell.

     

    Dose anyone know what is wrong about it ? Is there anything I need to do to make it works?

    Thanks

    Gavin

    Friday, May 28, 2010 8:52 AM

Answers

  • The callback contract is not supported by WWSAPI.

     

    If you cannot change the service side you can implement it on your own. Hao posted a prototype of such implementation here: http://social.msdn.microsoft.com/Forums/en/wwsapi/thread/32c85bf8-e966-40a9-9caa-b7d13cb7406e (see the last post).

    • Marked as answer by Gavin Liu Monday, May 31, 2010 2:04 AM
    Friday, May 28, 2010 4:25 PM

All replies

  • The callback contract is not supported by WWSAPI.

     

    If you cannot change the service side you can implement it on your own. Hao posted a prototype of such implementation here: http://social.msdn.microsoft.com/Forums/en/wwsapi/thread/32c85bf8-e966-40a9-9caa-b7d13cb7406e (see the last post).

    • Marked as answer by Gavin Liu Monday, May 31, 2010 2:04 AM
    Friday, May 28, 2010 4:25 PM
  • Thanks, Piotr,

     

    It is exactly what I need.

    Tuesday, June 1, 2010 9:56 AM