Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 155905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T10:14:17+00:00 2026-05-11T10:14:17+00:00

I need to get unmanaged Windows C++ clients to talk to a WCF service.

  • 0

I need to get unmanaged Windows C++ clients to talk to a WCF service. C++ clients could be running on Win2000 and later. I have a control over both WCF service and which C++ API is being used. Since it’s for a proprietary application, it is preferable to use Microsoft stuff where possible, definitely not GNU licensed APIs. Those of you who have it working, can you share a step-by-step process how to make it working?

I have researched following options so far:

  • WWSAPI – not good, will not work on Win 2000 clients.
  • ATL Server, used following guide as a reference. I followed the steps outlined (remove policy refs and flatten WSDL), however the resulting WSDL is still not usable by sproxy

Any more ideas? Please answer only if you actually have it working yourself.

Edit1: I apologize for anyone who I might have confused: what I was looking for was a way to call WCF service from client(s) where no .NET framework is installed, so using .NET-based helper library is not an option, it must be pure unmanaged C++

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T10:14:18+00:00Added an answer on May 11, 2026 at 10:14 am

    For those who are interested, I found one semi-working ATL Server solution. Following is the host code, notice it is using BasicHttpBinding, it’s the only one which works with ATL Server:

            var svc =  new Service1();         Uri uri = new Uri('http://localhost:8200/Service1');         ServiceHost host = new ServiceHost(typeof(Service1), uri);          var binding = new BasicHttpBinding();         ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(IService1), binding, uri);         endpoint.Behaviors.Add(new InlineXsdInWsdlBehavior());          host.Description.Behaviors.Add(new ServiceMetadataBehavior() { HttpGetEnabled = true });         var mex = host.AddServiceEndpoint(typeof(IMetadataExchange), MetadataExchangeBindings.CreateMexHttpBinding(), 'mex');         host.Open();          Console.ReadLine(); 

    code for InlineXsdInWsdlBehavior could be found here . One important change needs to be done to the InlineXsdInWsdlBehavior in order for it to work properly with sproxy when complex types are involved. It is caused by the bug in sproxy, which does not properly scope the namespace aliases, so wsdl cannot have repeating namespace aliases or sproxy will crap out. Here’s the functions which needs to change:

        public void ExportEndpoint(WsdlExporter exporter, WsdlEndpointConversionContext context)     {         int tnsCount = 0;          XmlSchemaSet schemaSet = exporter.GeneratedXmlSchemas;          foreach (WsdlDescription wsdl in exporter.GeneratedWsdlDocuments)         {             //             // Recursively find all schemas imported by this wsdl             // and then add them. In the process, remove any             // <xsd:imports/>             //             List<XmlSchema> importsList = new List<XmlSchema>();             foreach (XmlSchema schema in wsdl.Types.Schemas)             {                 AddImportedSchemas(schema, schemaSet, importsList, ref tnsCount);             }             wsdl.Types.Schemas.Clear();             foreach (XmlSchema schema in importsList)             {                 RemoveXsdImports(schema);                 wsdl.Types.Schemas.Add(schema);             }         }     }       private void AddImportedSchemas(XmlSchema schema, XmlSchemaSet schemaSet, List<XmlSchema> importsList, ref int tnsCount)     {         foreach (XmlSchemaImport import in schema.Includes)         {             ICollection realSchemas = schemaSet.Schemas(import.Namespace);             foreach (XmlSchema ixsd in realSchemas)             {                 if (!importsList.Contains(ixsd))                 {                     var new_namespaces = new XmlSerializerNamespaces();                     foreach (var ns in ixsd.Namespaces.ToArray())                     {                         var new_pfx = (ns.Name == 'tns') ? string.Format('tns{0}', tnsCount++) : ns.Name;                         new_namespaces.Add(new_pfx, ns.Namespace);                     }                      ixsd.Namespaces = new_namespaces;                     importsList.Add(ixsd);                     AddImportedSchemas(ixsd, schemaSet, importsList, ref tnsCount);                 }             }         }     } 

    Next step is to generate C++ header:

    sproxy.exe /wsdl http://localhost:8200/Service1?wsdl 

    and then C++ program looks like this:

    using namespace Service1;  CoInitializeEx( NULL, COINIT_MULTITHREADED  );  {     CService1T<CSoapWininetClient> cli;     cli.SetUrl( _T('http://localhost:8200/Service1') );      HRESULT hr = cli.HelloWorld(); //todo: analyze hr }  CoUninitialize(); return 0; 

    Resulting C++ code handles complex types pretty decently, except that it cannot assign NULL to the objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 78k
  • Answers 78k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Such an open-ended question with not a lot of detail… May 11, 2026 at 3:39 pm
  • added an answer $('.draggable_text > li').draggable({ helper: function(event, ui) { var type =… May 11, 2026 at 3:39 pm
  • added an answer dgIPs.DataSource = from act in Master.dc.Activities where act.Session.UID == Master.u.ID… May 11, 2026 at 3:39 pm

Related Questions

I have a C# class library that contains methods that need to be used
I'm fairly new to localized programming, and I'm trying to figure out how to
I'm working in a C++ unmanaged project. I need to know how can I
I have an unmanaged class that I'm trying to dllexport from a managed DLL

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.