SOAP Toolkit vc++ 6.0

I am having some problems connecting to web services with soap through c++ I have looked at numerous examples and followed the help documentation from microsofts SOAP Toolkit.  I have also tried using the webreferences feature of .net.

My problem is that I have to develop in c++ and add SOAP services to an application.  I have been using the following example code from code guru.

#include <stdio.h>

#import "msxml4.dll"
using namespace MSXML2;
#import "C:\Program Files\Common Files\MSSoap\Binaries\mssoap30.dll" \
exclude("IStream", "IErrorInfo", "ISequentialStream", "_LARGE_INTEGER", \
"_ULARGE_INTEGER", "tagSTATSTG", "_FILETIME")
using namespace MSSOAPLib30;

void main()
{
CoInitialize(NULL);

ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;

// Connect to the service
Connector.CreateInstance(__uuidof(HttpConnector30));
Connector->Property["EndPointURL"] =
"http://www.allesta.net:51110/webservices/soapx4/isuseronline.php";;
Connector->Connect();

// Begin message
Connector->Property["SoapAction"] = "uri:allesta-YahooUserPing";
Connector->BeginMessage();

// Create the SoapSerializer
Serializer.CreateInstance(__uuidof(SoapSerializer30));

// Connect the serializer to the input stream of the connector
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));

// Build the SOAP Message
Serializer->StartEnvelope("","","");
Serializer->StartBody("");
Serializer->StartElement("isuseronline",
"uri:allesta-YahooUserPing",
"",
"m");
Serializer->StartElement("username","","","");
Serializer->WriteString("laghari78");
Serializer->EndElement();
Serializer->EndElement();
Serializer->EndBody();
Serializer->EndEnvelope();

// Send the message to the web service
Connector->EndMessage();

// Read the response
Reader.CreateInstance(__uuidof(SoapReader30));

// Connect the reader to the output stream of the connector
Reader->Load(_variant_t((IUnknown*)Connector->OutputStream),
"");

// Display the result
printf("Answer: %s\n", (const char *)Reader->RpcResult->text);
CoUninitialize();

}

All I get is an abnormal program termination message.

I have SOAPToolkit 3.0 installed and I have MSXML4 installed.  If anyone could point me in the right direction or give me an idea why this might be crashing it would be very appreciated.  It seems to be crashing at the EndMessage line.  I have tried numerous url's which cause earlier crashes at the Property["EndPointUrl"] line.

Thanks
Kurt
rowlandkAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Raj_KauCommented:
Hi rowlandk
this code do not have any error checking so please do first error checking. Because you did not check you code connect or not you just execute the connect command and suppose if your programme not connect so when you go to send or go to EndMessage then its give error.
So please make error checking and then run


Raj
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Raj_KauCommented:
Hi rowlandk
i think your problem solved.

Raj

0
rowlandkAuthor Commented:
I was unable to solve that specific problem, if you have an idea I would love to hear it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.