axis-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cervi, Anthony (PCLN-NW)" <>
Subject RE: Visual Studio Axis Client
Date Thu, 22 Jul 2004 15:28:30 GMT
in order to see the contents of a bstr* you have to dereference the pointer.
you can also use _bstr_t to convert to a "regular" string.
hope this helps.
void GettaBSTR(BSTR* bstr) {
    *bstr = SysAllocString("some string");
    printf("this is the string: %S", *bstr);
BSTR bs;
_bstr_t bst = bs;
printf("this is the string: %s", (const char*) bst);
std::string s = (const char*) bst;
printf("this is the string: %s",;

-----Original Message-----
From: []
Sent: Thursday, July 22, 2004 11:20 AM
Subject: Re: Visual Studio Axis Client

Does Anybody know how I can convert a BSTR* to a type that will output the contents of the
String to the screen?
I am currently getting only what seems to be the address of the BSTR at the screen.
In a message dated 7/21/2004 5:43:55 PM Eastern Standard Time, writes:

Are you using the MS SOAP toolkit or .NET?  Also, are you using Visual 
Studio 6 or 7 (.NET)?

Jim wrote:

> Hello,
> I am creating a client for my axis web service in Visual Studio. By 
> using Visual Studio to add a web reference, the program creates several 
> data objects of type BSTR.
> I am wondering if anybody could give me a quick explanation why my 
> Strings are getting placed as BSTR's, and one is being placed as a 
> BSTR*. Now the BSTR* is becoming a complete obstacle because I don't 
> even know how to get it initialized and I can't find anything on it.
> If somebody could give me a quick rundown of what I have to do to these 
> BSTR's to get them initialized with the String values and how they'll 
> run through axis, that'd be great.
> Thanks in advance.
> James Crosson


View raw message