Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old May 5th, 2006, 4: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
Old May 5th, 2006, 4:31 AM   #2
Yarvin
Programmer
 
Join Date: Sep 2005
Location: Anchorage, Alaska
Posts: 37
Rep Power: 0 Yarvin is on a distinguished road
dude... use code tags.... [code ]*your code here*[/code ].... read the thread on how to post.... here
Yarvin is offline   Reply With Quote
Old May 5th, 2006, 5:04 AM   #3
ken q
Newbie
 
Join Date: May 2006
Posts: 2
Rep Power: 0 ken q is on a distinguished road
#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..";  //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("","","");

//some namespaces..
	
	//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);
}
_bstr_t soap::createUUID(){
	UUID uuid;
    UuidCreate(&uuid);
	unsigned char* pszUuid = NULL;
	UuidToString ( &uuid, &pszUuid);
	return (const char*)pszUuid;
}
ken q is offline   Reply With Quote
Old May 5th, 2006, 8:39 AM   #4
nnxion
Programming Guru
 
nnxion's Avatar
 
Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5 nnxion is on a distinguished road
It looks like that could be right. I have no idea, as I've never worked with that library.
Maybe someone will if they have, but if not then you might have a hard time getting answers. Are you sure your SOAP stuff is correct? I've had to work with it in the past and it was a pain in the neck.

[off-topic]It's a URL, not an URL.[/off-topic]
__________________
"Employ your time in improving yourself by other men's writings, so that you shall gain easily what others have labored hard for."
-- Socrates
nnxion is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 10:34 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC