Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

visual C++ and MSSOAP :trying to make webservice call...

Status
Not open for further replies.

Themuppeteer

Programmer
Apr 4, 2001
449
BE
Hello,

I'm writing a sort of test program to use web-services in
visual C++.
I made a console application, and I have a server runnung that works fine. It has a service reboot() that I want to call. If that works, I'll see result immediately when the server is rebooting. The service takes no arguments.
I cant seem to get it working.

is the site I used.

The problem is I think that when I do a connect, I get 0 as result.


// console.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "iostream.h"
#import "msxml3.dll"

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


using namespace MSSOAPLib30;




int main(int argc, char* argv[])
{

CoInitialize(NULL);
ISoapSerializerPtr serializer;
ISoapReaderPtr reader;
ISoapConnectorPtr connector;

connector.CreateInstance(__uuidof(HttpConnector30));


char m[64]=" //myserver is a name in the windows 'host' file
//and stands for an ip on the lan.

cout<<m<<endl;
connector->Property[&quot;EndPointURL&quot;]=m;
cout<<&quot;result:&quot;<<connector->Connect()<<endl;


connector->BeginMessage();

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

//Connect serializer to the input stream of the connector
cin.get();

serializer->Init(_variant_t((IUnknown*)connector->InputStream));

//build the soap message

serializer->StartEnvelope(&quot;&quot;,&quot;&quot;,&quot;&quot;);
serializer->StartBody(&quot;&quot;);
serializer->StartElement(&quot;reboot&quot;,&quot;&quot;,&quot;&quot;,&quot;world&quot;);

serializer->EndElement();
serializer->EndBody();
serializer->EndEnvelope();
return 0;


Can someone help me out here please ? Greetz,
muppeteer.gif

NOSPAM_themuppeteer@hotmail.com (for mails, remove the NOSPAM_)

Don't eat yellow snow...and don't mess with your fstab!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top