View Single Post
Old May 5th, 2006, 5:08 AM   #1
ken q
Newbie
 
Join Date: May 2006
Posts: 2
Rep Power: 0 ken q is on a distinguished road
connect to a ssl-webservice with soap

Hi!
I need to connect to a webservice through https with soap. I didn't have any problem at all when I tryed through a usual http server.
Is this possible?
I don't even get a response that my code is bad from the server.. shoudlen't I get that?

here is my code:
#include "soap.h"


void main()
{
CoInitialize(NULL);
soap test;
test.loginEnvelope();
}
void soap::loginEnvelope(){
ISoapSerializerPtr Serializer;
ISoapReaderPtr Reader;
ISoapConnectorPtr Connector;

Connector.CreateInstance(__uuidof(HttpConnector30));
Connector->Property ["EndPointURL"] = "an url with https.."; //URL till webservice

Connector->Property ["UseSSL"] = true;
Connector->Property ["SSLClientCertificateName"] = "a certificate"; Connector->Connect();
Connector->BeginMessage();

Serializer.CreateInstance(__uuidof(SoapSerializer30));
Serializer->Init(_variant_t((IUnknown*)Connector->InputStream));

Serializer->StartEnvelope("","","");

//Headern
Serializer->StartHeader("");
//some code..
//stänger Headern
Serializer->EndHeader();

//Bodyn
Serializer->StartBody("");
//some code..
//stänger Bodyn
Serializer->EndBody();
Serializer->EndEnvelope();

Connector->EndMessage();
Reader.CreateInstance(__uuidof(SoapReader30));
Reader->Load(_variant_t((IUnknown*)Connector->OutputStream), "");
printf("Answer: %s\n", (const char *)Reader->Dom->xml);
}
ken q is offline   Reply With Quote