c++ builder 使用indy http调用webservice方法
生活随笔
收集整理的這篇文章主要介紹了
c++ builder 使用indy http调用webservice方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
TIdHTTP *http = new TIdHTTP(NULL);TStringList *formData = new TStringList();try{IdAntiFreeze1->OnlyWhenIdle = false;
formData->Add("<?xml version=\"1.0\" encoding=\"utf-8\"?>\<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\<soap:Body>\<get_print_templates xmlns=\"http://tempuri.org/\">\<ai_id>6598</ai_id>\</get_print_templates>\</soap:Body>\</soap:Envelope>");http->Request->CharSet="utf-8";http->Request->ContentType = "text/xml";http->Request->CustomHeaders = new TIdHeaderList();http->Request->CustomHeaders->AddValue("SOAPAction", "http://tempuri.org/get_print_templates");UnicodeString url = serverRootUrl + "inlineadminsite/common/print/PrintWordWin.asmx";UnicodeString result = http->Post(url, formData);return result;}__finally{delete formData;delete http;}
formData->Add("<?xml version=\"1.0\" encoding=\"utf-8\"?>\<soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\<soap:Body>\<get_print_templates xmlns=\"http://tempuri.org/\">\<ai_id>6598</ai_id>\</get_print_templates>\</soap:Body>\</soap:Envelope>");http->Request->CharSet="utf-8";http->Request->ContentType = "text/xml";http->Request->CustomHeaders = new TIdHeaderList();http->Request->CustomHeaders->AddValue("SOAPAction", "http://tempuri.org/get_print_templates");UnicodeString url = serverRootUrl + "inlineadminsite/common/print/PrintWordWin.asmx";UnicodeString result = http->Post(url, formData);return result;}__finally{delete formData;delete http;}
總結
以上是生活随笔為你收集整理的c++ builder 使用indy http调用webservice方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 将SATA硬盘驱动嵌入Windows X
- 下一篇: DEDE模板教程【Mytag 标记】