![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: May 2006
Posts: 2
Rep Power: 0
![]() |
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); } |
|
|
|
|
|
#2 |
|
Programmer
Join Date: Sep 2005
Location: Anchorage, Alaska
Posts: 37
Rep Power: 0
![]() |
dude... use code tags.... [code ]*your code here*[/code ].... read the thread on how to post.... here
|
|
|
|
|
|
#3 |
|
Newbie
Join Date: May 2006
Posts: 2
Rep Power: 0
![]() |
#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;
} |
|
|
|
|
|
#4 |
|
Programming Guru
![]() Join Date: Jun 2005
Location: elemental plane
Posts: 1,429
Rep Power: 5
![]() |
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 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|