axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magnus Karlsson" <>
Subject Re: Re: Re: Conversion fault
Date Tue, 09 May 2006 12:40:25 GMT
<html><head><style type="text/css">body{font:12px Arial;margin:3px;overflow-y:auto;overflow-x:auto}p{margin:0px;}blockquote,
ol, ul{margin-top:0px;margin-bottom:0px;}</style></head>

<body><div style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial"><P>More
problems (same issue):</P>
<P>I've tried conversion with c_str() but something won't work here. </P>
<P>Example below gives a null-string as a result:</P>
<P>&nbsp;</P><FONT size=2>
<P>xsd__string Test::getData()</P>
<P><FONT size=2>std::string sString;</FONT></P>
<P><FONT size=2>sString = "Test";</FONT></P>
<P><FONT size=2>return (char *) sString.cStr();</FONT><BR>}<BR></P>
<P>How come?</P>
<P>Best regards</P>
<HR color=#dee7ee>
<P>&gt; <B>Från:</B> "Magnus Karlsson" &lt;;<BR>&gt;
<B>Till:</B> "Apache AXIS C User List" &lt;;<BR>&gt;
<B>Rubrik:</B> Re: Re: Conversion fault<BR>&gt; <B>Datum:</B>
Mon, 8 May 2006 09:50:12 +0000 (GMT)<BR><BR></P>
<DIV style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial">
<HR color=#dee7ee>

<P>&gt; <B>Från:</B> Fred Preston &lt;;<BR>&gt;
<B>Till:</B> "Apache AXIS C User List" &lt;;<BR>&gt;
<B>Rubrik:</B> Re: Conversion fault<BR>&gt; <B>Datum:</B>
Mon, 8 May 2006 10:33:33 +0100<BR><BR></P>
<DIV><BR><FONT face=sans-serif size=2>Hi Magnus,</FONT> <BR><FONT
face=sans-serif size=2>&nbsp; &nbsp; &nbsp; &nbsp; xsd__string is simply
a char *. &nbsp;To convert from one to the other do the following:-</FONT> <BR><BR><FONT
face=sans-serif size=2>xsd__string &nbsp; &nbsp; &nbsp; &nbsp;pXSD_String
= "Test";</FONT> <BR><FONT face=sans-serif size=2>std::string &nbsp;
&nbsp; &nbsp; &nbsp;sString;</FONT> <BR><BR><FONT face=sans-serif
size=2>// Converting from xsd__string to std::string</FONT> <BR><FONT face=sans-serif
size=2>// Because the string class has overridden the '=' operator, you can simply assign
an xsd__string to a string.</FONT> <BR><BR><FONT face=sans-serif size=2>sString
= pXSD_String;</FONT> <BR><BR><FONT face=sans-serif size=2>// Converting
from std::string to xsd__string.</FONT> <BR><FONT face=sans-serif size=2>//
The c_str() method converts the contents of the string object to a const char *. &nbsp;This
can then be assigned to the xsd__string variable.</FONT>
  <BR><BR><FONT face=sans-serif size=2>pXSD_String = (char *) sString.c_str();</FONT>
<BR><BR><FONT face=sans-serif size=2>Regards,<BR><BR>Fred Preston.<BR></FONT><BR><BR><BR>
<TABLE width="100%">
<TR vAlign=top>
<TD width="40%"><FONT face=sans-serif size=1><B>"Magnus Karlsson" &lt;;</B>
<P><FONT face=sans-serif size=1>08/05/2006 09:35</FONT> 
<TABLE border=1>
<TR vAlign=top>
<TD bgColor=white>
<DIV align=center><FONT face=sans-serif size=1>Please respond to<BR>"Apache
AXIS C User List" &lt;;</FONT></DIV></TD></TR></TBODY></TABLE><BR></P>
<TD width="59%">
<TABLE width="100%">
<TR vAlign=top>
<DIV align=right><FONT face=sans-serif size=1>To</FONT></DIV>
<TD><FONT face=sans-serif size=1></FONT> 
<TR vAlign=top>
<DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV>
<TR vAlign=top>
<DIV align=right><FONT face=sans-serif size=1>Subject</FONT></DIV>
<TD><FONT face=sans-serif size=1>Conversion fault</FONT></TD></TR></TBODY></TABLE><BR>
<TR vAlign=top>
face=Arial size=1>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?</FONT> <BR><FONT
face=Arial size=1>&nbsp;</FONT> <BR><FONT face=Arial size=1>Best
regards</FONT> <BR><FONT face=Arial size=1>Magnus</FONT> <BR></DIV><BR></DIV></DIV></br></div></body></html>
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message