I am working on a project related to windows pocket pc 5.0 (win32). in that i am trying client-server communicationusing SOAP server ,but facing problem on IXMLHTTPRequest.
#################### CODE ##########################
//included files are,
#include "msxml2.h"
#import "msxml3.dll"
using namespace MSXML2;
#define CoInitialize(NULL) CoInitializeEx(NULL, COINIT_MULTITHREADED)
// code snippet as follows.
void ClientServerCommunicationUsingXmlHttpRequest()
{
::CoInitialize(NULL);
{
HRESULT hr;
// Url of SOAP server (Used axis toolkit)
bstr_t Url = "http://192.168.1.98:8080/axis/WinMobileService/WinMobileService.jws";
bstr_t method = "GET";
_variant_t Async = VARIANT_FALSE;
//body of send method that sends xml of soap envelope.
_variant_t varBody= L"<?xml version='1.0' encoding='UTF-8'?> <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:soapenc='http://schemas.xmlsoap.org/soap/encoding/' xmlns:xsd='http://www.w3.org/2001/XMLSchema' soap:encodingStyle='http://schemas.xmlsoap.org/soap/encoding/' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'> <soap:Body> <getDataFromClient xmlns='urn:WinMobileService'> <c-gensym3 xsi:type='xsd:string'>MY send MSG</c-gensym3> </getDataFromClient> </soap:Body> </soap:Envelope>";
IXMLHTTPRequestPtr oIXMLHTTPRequest = NULL;
hr = oIXMLHTTPRequest.CreateInstance("Msxml2.XMLHTTP");
if(hr!=S_OK)
MessageBox(NULL,L"Create instance failed",L"CreateInstance",MB_OK);
hr = oIXMLHTTPRequest->open(method,Url,Async);
if(hr!=S_OK)
MessageBox(NULL,L"open method failed.",L"open",MB_OK);
hr = oIXMLHTTPRequest->setRequestHeader(L"Content_Type",L"text/xml");
if(hr!=S_OK)
MessageBox(NULL,L"setRequestHeader method failed.",L"setRequestHeader",MB_OK);
hr=oIXMLHTTPRequest->setRequestHeader(L"SOAPAction",L"'urn:WinMobileSe rvice/getDataFromClient'");
if(hr!=S_OK)
MessageBox(NULL,L"setRequestHeader method about soap failed.",L"SOAPAction",MB_OK);
hr=oIXMLHTTPRequest->send(varBody);
if(hr!=S_OK)
MessageBox(NULL,L"send method failed.",L"send",MB_OK);
}
::CoUninitialize();
}
################### END OF CODE ########################
###Related problem
1)send method gives error as "problem has occured with gwes.exe."
Plz i am stuck on this point, i want your help....plz reply this mail.......
Regards,
Bhush&Jitu