Hi,
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.5.98:8080/axis/WinMobileWebService/WinMobileWebService.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> <getKeyDataFromClient xmlns='urn:WinMobileWebService'> <c-gensym3 xsi:type='xsd:string'>MY send MSG</c-gensym3> </getKeyDataFromClient> </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:WinMobileWe bService/getKeyDataFromClient'");
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."
when i put a breakpoint on send method(i.e.debug it) call passes to msxml.tli file in that,
//code of msxml.tli file of send method as,
inline HRESULT IXMLHTTPRequest :: send(const _variant_t &varBody)
{
HRESULT _hr = raw_send(varBody);
if(FAILED(_hr)) _com_issue_errorex(_hr,this,_uuidof(this));
//from here control passes to disassembly after the line (03FB2130 blt 03FB21C8) it losses the control.
return _hr;
}
Plz i am stuck on this point, i want your help....plz reply this mail.......
Regards,
Bhushan&Jitu