axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fred Preston <>
Subject Re: Conversion fault
Date Mon, 08 May 2006 09:33:33 GMT
Hi Magnus,
        xsd__string is simply a char *.  To convert from one to the other 
do the following:-

xsd__string     pXSD_String = "Test";
std::string     sString;

// Converting from xsd__string to std::string
// Because the string class has overridden the '=' operator, you can 
simply assign an xsd__string to a string.

sString = pXSD_String;

// Converting from std::string to xsd__string.
// The c_str() method converts the contents of the string object to a 
const char *.  This can then be assigned to the xsd__string variable.

pXSD_String = (char *) sString.c_str();


Fred Preston.

"Magnus Karlsson" <> 
08/05/2006 09:35
Please respond to
"Apache AXIS C User List" <>


Conversion fault

I'm using Axis C++ 1.6b for Windows (XP Professional). I'd like to know 
how conversion is done from std::string to axiscpp::xsd__string? I want to 
use ordinary string management (std::string) but when I try to cast an 
std::string to axiscpp::xsd__string I get "error C240: 'type cast' : 
cannot convert from 'std:string' to 'axiscpp::xsd_string'. Would it be 
better to skip xsd__strings and not use them at all?
Best regards

View raw message