calling webservices?
Windows API
1
Posts
1
Posters
0
Views
1
Watching
-
Hello friends, I've a IE toolbar in which I call the webservices written in C#. There is one webservice for uploading a file. Everything works fine in XP but in Vista after uploading 1 file successfully I am not able to upload any other files and the responseText for all the remaining file is empty?Can anybody help me out.
MSXML::IXMLHttpRequestPtr httpReq( _uuidof(XMLHTTPRequest));
\_bstr\_t HTTPMethod; \_variant\_t noAsync = \_variant\_t((bool)false); HTTPMethod = \_bstr\_t("POST"); httpReq->open(HTTPMethod ,"https://localhost/common/qptwebservicedownload.asmx",noAsync,vtMissing,vtMissing); httpReq->setRequestHeader("Content-Type","application/soap+xml"); data = NULL; strBase64.Empty(); CString defaultJpgAlertCasheFilename=ob.FilePath; unsigned \_\_int64 AttachmentSize=SubGetFileSize(defaultJpgAlertCasheFilename); CFile sourceFile; sourceFile.Open(defaultJpgAlertCasheFilename,CFile::modeRead); data = new BYTE \[AttachmentSize\]; sourceFile.Read(data, AttachmentSize); sourceFile.Close(); CBase64 ob1; ob1.Encode(data,AttachmentSize); ob1.m\_pEBuffer; strBase64=CString(ob1.m\_pEBuffer); Part1="<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?> \\ <soap12:Envelope xmlns:xsi=\\"http://www.w3.org/2001/XMLSchema-instance\\" xmlns:xsd=\\"http://www.w3.org/2001/XMLSchema\\" xmlns:soap12=\\"http://www.w3.org/2003/05/soap-envelope\\"> \\ <soap12:Body>\\ <UploadFile xmlns=\\"http://rigelnetworks.net/\\">"; Part2="<ByteArr>"; Part2+=strBase64; Part2+="</ByteArr>"; Part2+="<FormletDocletID>"; Part2+=ob.FormletId; Part2+="</FormletDocletID>"; Part2+="<IsFormlet>"; Part2+=ob.BitField; Part2+="</IsFormlet>"; Part3="</UploadFile>\\ </soap12:Body>\\ </soap12:Envelope>"; szRequest=Part1; szRequest+=Part2; szRequest+=Part3; vRequest.vt = VT\_BSTR; vRequest.bstrVal = szRequest.AllocSysString(); HRESULT hr=httpReq->send(vRequest); \_bstr\_t bsResponse = httpReq->responseText; CString response; response=bsResponse.copy(); nPos1=response.Find("<UploadFileResult>"); nPos2=response.Find("</UploadFileResult>"); nPos1+=18; szResult=response.Mid(nPos1,(nPos2-nPos1)); if(szResult.GetLength()>0) { szResult.MakeLower(); if(szResult=="true") bFlg=true; }
In Vista the _bstr_t bsResponse = httpReq->responseText; contains vali