CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2011
    Posts
    4

    Question Consuming a WCF Service with an unmanaged C++ client

    Hi,

    I need to code one windows service using C++ and publish in all machine [XP;W2000;NT ] to consume a WCF Service C# using sockets.
    I need to credential passing over both (WCF -> c++ client and c++ client -> WCF)

    I have developed one sample WCF Service having single method that returns String value.
    This service has been hosted on IIS 7.0.

    How to consume this service (WCF Service - web) from unmanaged C++ Client using sockets ?

    Thanks

  2. #2
    Join Date
    Oct 2002
    Location
    Timisoara, Romania
    Posts
    14,360

    Re: Consuming a WCF Service with an unmanaged C++ client

    Does it have to be C++? Can't it be mixed-mode DLL in C++/CLI, which bridges your C++ with the WCF service?
    Marius Bancila
    Home Page
    My CodeGuru articles

    I do not offer technical support via PM or e-mail. Please use vbBulletin codes.

  3. #3
    Join Date
    Jan 2011
    Posts
    4

    Re: Consuming a WCF Service with an unmanaged C++ client

    I don’t want to install WCF bits in the target machines (Xp, W2000 and NT). The idea is each machine has one C++ application (Windows Service) that communicates with the WCF Web Service using sockets.

    The main idea (SOA):

    1- Build one web application (ASP.NET) that communicates with the WCF Web Service.
    [Client - ASP.NET]<->[WebServices - WCF]

    2- The WCF Web Service communicates with the C++ application (windows Services installed in each machine).
    [WebServices - WCF] <-> [Server - C++ Window Service]

    3- That C++ application is hosted in target machines (Xp, W2000 and NT).


    What I need is to know how to build the communication (using sockets) between the WCF Web Service and the C++ application and secure all the process. The WCF Web Service will be the bridge between the Client (web or windows application) and the server (Xp, W2000 and NT machines with one C++ application).

    Thanks

  4. #4
    Join Date
    Jan 2011
    Posts
    4

    Re: Consuming a WCF Service with an unmanaged C++ client

    By the way, the target machines (Xp, W2000 and NT) can&#180;t have .NET framework install. The only this we can install is one C++ Window Service.

    All help will be great!!

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: Consuming a WCF Service with an unmanaged C++ client

    Never did this with C++ though...
    Microsoft (R) Web Services Description Language Utility
    [Microsoft (R) .NET Framework, Version 4.0.30319.1]
    Copyright (C) Microsoft Corporation. All rights reserved.

    wsdl.exe -
    Utility to generate code for xml web service clients and xml web services
    using ASP.NET from WSDL contract files, XSD schemas and .discomap
    discovery documents. This tool can be used in conjunction with disco.exe.

    wsdl.exe <options> <url or path> <url or path> ...

    - OPTIONS -

    <url or path> -
    A url or path to a WSDL contract, an XSD schema or .discomap document.

    /nologo
    Suppresses the banner.

    /language:<language>
    The language to use for the generated proxy class. Choose from 'CS',
    'VB', 'JS', 'VJS', 'CPP' or provide a fully-qualified name for a class
    implementing System.CodeDom.Compiler.CodeDomProvider. The default
    language is 'CS' (CSharp). Short form is '/l:'.

    /sharetypes
    Turns on type sharing feature. This feature creates one code file with
    a single type definition for identical types shared between different
    services (namespace, name and wire signature must be identical).
    Reference the services with http:// URLs as command-line parameters
    or create a discomap document for local files.

    /verbose
    Displays extra information when the /sharetypes switch is specified.
    Short form is '/v'.

    /fields
    Generate fields instead of properties. Short form is '/f'.

    /order
    Generate explicit order identifiers on particle members.

    /enableDataBinding
    Implement INotifyPropertyChanged interface on all generated types
    to enable data binding. Short form is '/edb'.

    /namespace:<namespace>
    The namespace for the generated proxy or template. The default namespace
    is the global namespace. Short form is '/n:'.

    /out:<fileName|directoryPath>
    The filename or directory path for the generated proxy code. The default
    filename is derived from the service name. Short form is '/o:'.

    /protocol:<protocol>
    Override the default protocol to implement. Choose from 'SOAP',
    'SOAP12', 'HttpGet', 'HttpPost'.

    /username:<username>
    /password:<password>
    /domain:<domain>
    The credentials to use when connecting to a server that
    requires authentication. Short forms are '/u:', '/p:' and '/d:'.

    /proxy:<url>
    The url of the proxy server to use for http requests.
    The default is to use the system proxy setting.

    /proxyusername:<username>
    /proxypassword:<password>
    /proxydomain:<domain>
    The credentials to use when the connecting to a proxy server that
    requires authentication. Short forms are '/pu:', '/pp:' and '/pd:'.

    /appsettingurlkey:<key>
    The configuration key to use in the code generation to read the default
    value for the Url property. The default is to not read from the config
    file. Short form is '/urlkey:'.

    /appsettingbaseurl:<baseurl>
    The base url to use when calculating the url fragment. The
    appsettingurlkey option must also be specified. The url fragment is
    the result of calculating the relative url from the appsettingbaseurl
    to the url in the WSDL document. Short form is '/baseurl:'.

    /parsableerrors
    Print errors in a format similar to those reported by compilers.

    - ADVANCED -

    /server
    Server switch has been deprecated. Please use /serverInterface instead.
    Generate an abstract class for an xml web service implementation using
    ASP.NET based on the contracts. The default is to generate client proxy
    classes.

    /serverInterface
    Generates interfaces for server-side implementation of an ASP.Net
    Web Service. An interface is generated for each binding in the wsdl
    document(s). The wsdl alone implements the wsdl contract (classes
    that implement the interface should not include either of the following
    on the class methods: Web Service attributes or Serialization
    attributes that change the wsdl contract). Short form is '/si'.

    /parameters:<file>
    Read command-line options from the specified xml file. This allows you
    to specify options not available from command line such as choosing
    which type of asynchronous programming model is generated. For details,
    please see the tool documentation. Short form is '/par:'.
    Best regards,
    Igor

  6. #6
    Join Date
    Jan 2011
    Posts
    4

    Re: Consuming a WCF Service with an unmanaged C++ client

    Ok but the point is: how consume that service (WCF Service - web) from unmanaged C++ Client using sockets ?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured