Hi,
I am working on a project related to windows pocket pc 5.0 (win32).
in that i am trying client-server communicationus ing SOAP server.
but facing problem on IXMLHTTPRequest .
############### ##### CODE ############### ###########
//included files are,
#include "msxml2.h"
#import "msxml3.dll "
using namespace MSXML2;
#define CoInitialize(NU LL) CoInitializeEx( NULL, COINIT_MULTITHR EADED)
// code snippet as follows.
void ClientServerCom municationUsing XmlHttpRequest( )
{
::CoInitialize( NULL);
{
HRESULT hr;
// Url of SOAP server (Used axis toolkit).
bstr_t Url = "http://192.168.5.98:80 80/axis/WinMobileWebSer vice/WinMobileWebSer vice.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:Envelop e 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:encodingSt yle='http://schemas.xmlsoap .org/soap/encoding/' xmlns:soap='htt p://schemas.xmlsoap .org/soap/envelope/'> <soap:Body> <getKeyDataFrom Client xmlns='urn:WinM obileWebService '> <c-gensym3 xsi:type='xsd:s tring'>MY send MSG</c-gensym3> </getKeyDataFromC lient> </soap:Body> </soap:Envelope>" ;
IXMLHTTPRequest Ptr oIXMLHTTPReques t = NULL;
hr = oIXMLHTTPReques t.CreateInstanc e("Msxml2.XMLHT TP");
if(hr!=S_OK)
MessageBox(NULL ,L"Create instance failed",L"Creat eInstance",MB_O K);
hr = oIXMLHTTPReques t->open(method,Ur l,Async);
if(hr!=S_OK)
MessageBox(NULL ,L"open method failed.",L"open ",MB_OK);
hr = oIXMLHTTPReques t->setRequestHead er(L"Content_Ty pe",L"text/xml");
if(hr!=S_OK)
MessageBox(NULL ,L"setRequestHe ader method failed.",L"setR equestHeader",M B_OK);
hr=oIXMLHTTPReq uest->setRequestHead er(L"SOAPAction ",L"'urn:WinMob ileWebService/getKeyDataFromC lient'");
if(hr!=S_OK)
MessageBox(NULL ,L"setRequestHe ader method about soap failed.",L"SOAP Action",MB_OK);
hr=oIXMLHTTPReq uest->send(varBody );
if(hr!=S_OK)
MessageBox(NULL ,L"send method failed.",L"send ",MB_OK);
}
::CoUninitializ e();
}
############### #### 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.debu g 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(varBod y);
if(FAILED(_hr)) _com_issue_erro rex(_hr,this,_u uidof(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
I am working on a project related to windows pocket pc 5.0 (win32).
in that i am trying client-server communicationus ing SOAP server.
but facing problem on IXMLHTTPRequest .
############### ##### CODE ############### ###########
//included files are,
#include "msxml2.h"
#import "msxml3.dll "
using namespace MSXML2;
#define CoInitialize(NU LL) CoInitializeEx( NULL, COINIT_MULTITHR EADED)
// code snippet as follows.
void ClientServerCom municationUsing XmlHttpRequest( )
{
::CoInitialize( NULL);
{
HRESULT hr;
// Url of SOAP server (Used axis toolkit).
bstr_t Url = "http://192.168.5.98:80 80/axis/WinMobileWebSer vice/WinMobileWebSer vice.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:Envelop e 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:encodingSt yle='http://schemas.xmlsoap .org/soap/encoding/' xmlns:soap='htt p://schemas.xmlsoap .org/soap/envelope/'> <soap:Body> <getKeyDataFrom Client xmlns='urn:WinM obileWebService '> <c-gensym3 xsi:type='xsd:s tring'>MY send MSG</c-gensym3> </getKeyDataFromC lient> </soap:Body> </soap:Envelope>" ;
IXMLHTTPRequest Ptr oIXMLHTTPReques t = NULL;
hr = oIXMLHTTPReques t.CreateInstanc e("Msxml2.XMLHT TP");
if(hr!=S_OK)
MessageBox(NULL ,L"Create instance failed",L"Creat eInstance",MB_O K);
hr = oIXMLHTTPReques t->open(method,Ur l,Async);
if(hr!=S_OK)
MessageBox(NULL ,L"open method failed.",L"open ",MB_OK);
hr = oIXMLHTTPReques t->setRequestHead er(L"Content_Ty pe",L"text/xml");
if(hr!=S_OK)
MessageBox(NULL ,L"setRequestHe ader method failed.",L"setR equestHeader",M B_OK);
hr=oIXMLHTTPReq uest->setRequestHead er(L"SOAPAction ",L"'urn:WinMob ileWebService/getKeyDataFromC lient'");
if(hr!=S_OK)
MessageBox(NULL ,L"setRequestHe ader method about soap failed.",L"SOAP Action",MB_OK);
hr=oIXMLHTTPReq uest->send(varBody );
if(hr!=S_OK)
MessageBox(NULL ,L"send method failed.",L"send ",MB_OK);
}
::CoUninitializ e();
}
############### #### 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.debu g 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(varBod y);
if(FAILED(_hr)) _com_issue_erro rex(_hr,this,_u uidof(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
Comment