Click here to Skip to main content
15,500,453 members
Articles / Programming Languages / C++
Posted 31 Jan 2011

Tagged as


3 bookmarked

How do I make GSOAP support Unicode?

Rate me:
Please Sign up or sign in to vote.
4.92/5 (5 votes)
3 Feb 2011CPOL1 min read
How do I make GSOAP support Unicode?
It's my first tip and trick, so please analyse it and give your suggestions.

The gSOAP is an open source toolkit for SOAP/XML Web services. It is available at the link below:
GSoap 2.8.0 ->[^]

Using gSOAP, we can easily develop the SOAP and XML Web services in C/C++. We can use it to automatically convert XML to/from C and C++ data.

GSoap does not support Unicode, this trick is helpful to make gSoap client that support Unicode data.

Steps to create gsoap client that supports unicode
1) Open command prompt.

2) Set the path of gsoap win32 folder.
cd PATH_OF_GSOAP_FOLDER\gsoap_2.8.0\gsoap-2.8\gsoap\bin\win32

3) Generate header file using wsdl2h.exe.

Note: If proxy is enabled, than only use -r

4) Add code in OUTPUT_FILE_NAME.h file:
class xsd__wstring : public xsd__anyType
{ public:
    std::wstring                          __item;

5) Update variable which you want to update on your code with std::string to std::wstring.

6) Now create client using this command:
soapcpp2.exe -I "gsoap2.8\import" -1 GSOAPCLIENT.h

7) After executing this line, a number of files are generated. These are:

a) SoapC.cpp
b) SoapH.h
c) soapClient.cpp
d) soapStub.h
e) .nsmap and .h file with same name
f) soapServer.cpp

Add these file to your source code.

Now you can send and receive Unicode data also using gSoap.

Thanks :rose:


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Written By
Software Developer (Senior)
India India
5+ year experience in VC++ technology.
Worked as a Sr. Software Engineer with (India) Pvt Ltd.

Comments and Discussions

Questiongreat thanks Pin
dental-soft.ru21-Oct-17 12:48
Memberdental-soft.ru21-Oct-17 12:48 
AnswerWorks, but solution is different than explained Pin
Robert van Engelen29-Jun-16 11:19
MemberRobert van Engelen29-Jun-16 11:19 
GeneralIt didnt work (2.8.15) Pin
ondera2-Aug-13 14:59
Memberondera2-Aug-13 14:59 
GeneralRe: It didnt work (2.8.15) Pin
aomelche10-Jun-16 8:38
Memberaomelche10-Jun-16 8:38 
GeneralRe: It didnt work (2.8.15) Pin
jazbora21-Jun-16 23:01
Memberjazbora21-Jun-16 23:01 
GeneralRe: It didnt work (2.8.15) Pin
aomelche22-Jun-16 16:49
Memberaomelche22-Jun-16 16:49 
GeneralRe: It didnt work (2.8.15) Pin
jazbora22-Jun-16 22:24
Memberjazbora22-Jun-16 22:24 
GeneralRe: It didnt work (2.8.15) Pin
aomelche23-Jun-16 18:01
Memberaomelche23-Jun-16 18:01 
GeneralDosnt seems to work with 2.8.6... Pin
Greg9718-Dec-11 21:11
MemberGreg9718-Dec-11 21:11 
GeneralRe: Dosnt seems to work with 2.8.6... Pin
Alex (Swiftify)21-Mar-12 2:30
MemberAlex (Swiftify)21-Mar-12 2:30 
GeneralReason for my vote of 5 It's really hard to find trick like... Pin
Dr.Luiji10-Sep-11 12:55
professionalDr.Luiji10-Sep-11 12:55 
GeneralRe: Thanks Dr. Luiji. :) Pin
ShilpiP11-Sep-11 2:57
MemberShilpiP11-Sep-11 2:57 
GeneralHi Indivara, Thank you so much for your feedback. I will upd... Pin
ShilpiP30-Jan-11 22:18
MemberShilpiP30-Jan-11 22:18 
GeneralFrom a complete layman's viewpoint - - You need to explain b... Pin
Indivara30-Jan-11 21:42
professionalIndivara30-Jan-11 21:42 
GeneralThanks ! Pin
Alexandre GRANVAUD19-May-11 3:57
MemberAlexandre GRANVAUD19-May-11 3:57 
GeneralRe: Thanks ! Pin
ShilpiP19-May-11 4:01
MemberShilpiP19-May-11 4:01 
GeneralRe: Thanks ! Pin
Greg9718-Dec-11 21:03
MemberGreg9718-Dec-11 21:03 
GeneralRe: Thanks ! Pin
jazbora22-Jun-16 0:36
Memberjazbora22-Jun-16 0:36 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.