3

I am implementing a relatively complex object model service using WWSAPI (WCF hosted) and have successfully downloaded the wsdl and code gen'd the service implementation. My question is, has anyone else noticed all of the

#if defined(WS_CPLUSPLUS)

defines littered throughout the generated code? Inside them is a C++ object representation of my service payload that would be 100x easier to use, however when I define WS_CPLUSPLUS all sorts of bad breaks loose on the compiler.

My question is this: Has anyone successfully gotten that define to work, and if so, what resource or example did you use to get it to work?

Mranz
  • 1,260
  • 1
  • 12
  • 20
  • what do you mean with "WCF hosted" ? can you provide sample or references ? – PeeWee2201 Aug 02 '11 at 21:49
  • Meaning that the actual service host is written in WCF. It is largely irrelevant. I did however find my solution, and until I can answer it, I will keep it as the following comment. – Mranz Aug 02 '11 at 22:31
  • 2
    Ok, answered my own question after digging through the sdk samples. Once you generate the schema and wsdl files and import them into your project do the following: Select all of the generated .c files, and right click -> properties **In the [Precompiled Headers] section:** Change [Precompiled Header] to "Not Using Precompiled Headers" **In the [Advanced] section:** Change [Compile As] to "Compile as C++ Code (/TP)" Once you do this, you should successfully be able to add the "WS_CPLUSPLUS" preprocessor definition. I hope this can help brighten someones day. – Mranz Aug 02 '11 at 22:31
  • Strangely (and unfortunately) the answer is no - there are no WS_CPLUSPLUS defines in my generated code. I am using VS2010 however, which runs version 1.0092 of wsutil. So... which version did you run? – gbjbaanb Apr 23 '15 at 16:11

1 Answers1

2

Ok, answered my own question after digging through the sdk samples.

Once you generate the schema and wsdl files and import them into your project do the following:

  • Select all of the generated .c files, and right click -> properties
  • In the [Precompiled Headers] section: Change [Precompiled Header] to "Not Using Precompiled Headers"
  • In the [Advanced] section: Change [Compile As] to "Compile as C++ Code (/TP)"

Once you do this, you should successfully be able to add the "WS_CPLUSPLUS" preprocessor definition. I hope this can help brighten someones day

Mranz
  • 1,260
  • 1
  • 12
  • 20