Webservice returning '&gt' and '&lt' in place of angle brackets when called using MSXML:: IXMLHttpRequest RRS feed

  • Question

  • Hi,
    I am calling a webservice method using MSXML2::IXMLHttpRequest (msxml3.dll). I am sending a post request using the send method and then getting the response using "get_responseText". But this response is having data like "&gt", "&lt" etc. whereas it should return angle brackets in place of "&gt" and "&lt". When using MS SOAP the webservice is sending correct data.
     I am very new to this MSXML parser so I am not able get reason why I am getting this result.It would be great if someone could help me on this issue.

    This is the code that I am using to call the webservice:
    header file:
    #import "msxml3.dll" named_guids                //For connecting the webservice
    using namespace MSXML2;

    cpp file:

    TCHAR*  g_lpszSOAPReq = _T(
       "<?xml version='1.0' encoding='utf-8' ?>"
       "<SOAP-ENV:Envelope xmlns:SOAP-ENV='http://schemas.xmlsoap.org/soap/envelope/'>"

    MSXML2::IXMLHTTPRequestPtr HttpRequest;
        MSXML2::IXMLDOMDocument2Ptr  pXMLDoc;

        BOOL bRetVal = FALSE;
        CString URL = some URL ;


        HRESULT hResult;      
        hResult = HttpRequest.CreateInstance("Microsoft.XMLHTTP");

        if ( FAILED(hResult) )

        HRESULT hr = HttpRequest->open(_bstr_t("POST"),_bstr_t(URL),_variant_t(false));
        if (!(hr==S_OK))


        hr = HttpRequest->send(_variant_t(g_lpszSOAPReq ));
        if (!(hr==S_OK))

        CString cstrResponse = "";
        BSTR bstr = cstrResponse.AllocSysString();
        hr = HttpRequest->get_responseText(&bstr);
        if (!(hr==S_OK))
            AfxMessageBox("response could not be retrieved",MB_OK,0);
    Thursday, March 18, 2010 4:14 AM


All replies