axis-c-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magnus Karlsson" <magnus.karlsson.linkop...@home.se>
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>&nbsp;</P>
<P>I've tried conversion with c_str() but something won't work here. </P>
<P>&nbsp;</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>{&nbsp;</P></FONT>
<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>&nbsp;</P>
<P>Best regards</P>
<P>Magnus<BR><BR></P>
<P>
<HR color=#dee7ee>
</P>
<P>&gt; <B>Från:</B> "Magnus Karlsson" &lt;magnus.karlsson.linkoping@home.se&gt;<BR>&gt;
<B>Till:</B> "Apache AXIS C User List" &lt;axis-c-user@ws.apache.org&gt;<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>
<DIV style="DISPLAY: block; FONT-SIZE: 12px; FONT-FAMILY: Arial">
<P>Thanks!</P>
<P>&nbsp;</P>
<P>/Magnus<BR><BR>
<HR color=#dee7ee>

<P></P>
<P>&gt; <B>Från:</B> Fred Preston &lt;PRESTONF@uk.ibm.com&gt;<BR>&gt;
<B>Till:</B> "Apache AXIS C User List" &lt;axis-c-user@ws.apache.org&gt;<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%">
<TBODY>
<TR vAlign=top>
<TD width="40%"><FONT face=sans-serif size=1><B>"Magnus Karlsson" &lt;magnus.karlsson.linkoping@home.se&gt;</B>
</FONT>
<P><FONT face=sans-serif size=1>08/05/2006 09:35</FONT> 
<TABLE border=1>
<TBODY>
<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;axis-c-user@ws.apache.org&gt;</FONT></DIV></TD></TR></TBODY></TABLE><BR></P>
<TD width="59%">
<TABLE width="100%">
<TBODY>
<TR vAlign=top>
<TD>
<DIV align=right><FONT face=sans-serif size=1>To</FONT></DIV>
<TD><FONT face=sans-serif size=1>axis-c-user@ws.apache.org</FONT> 
<TR vAlign=top>
<TD>
<DIV align=right><FONT face=sans-serif size=1>cc</FONT></DIV>
<TD>
<TR vAlign=top>
<TD>
<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>
<TABLE>
<TBODY>
<TR vAlign=top>
<TD>
<TD></TD></TR></TBODY></TABLE><BR></TD></TR></TBODY></TABLE><BR><BR><BR><FONT
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>
Mime
  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message