当前位置: 首页 > news >正文

阜阳建设网站公司电话钓鱼网站怎么制作视频

阜阳建设网站公司电话,钓鱼网站怎么制作视频,国内crm系统,建网站一般需要多少钱&#x1f5d1;️ 清空 //MES系统对接可以使用多种协议&#xff0c;包括XML、JSON和SOAP等。 //以下是使用C语言进行MES系统对接的示例代码&#xff1a; //1. XML协议对接&#xff1a; //c #include <iostream> #include <string> #include <vector> #incl…

🗑️ 清空
//MES系统对接可以使用多种协议,包括XML、JSON和SOAP等。

//以下是使用C++语言进行MES系统对接的示例代码:

//1. XML协议对接:

//c++
#include <iostream>
#include <string>
#include <vector>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>

using namespace std;
using boost::property_tree::ptree;

// 解析XML响应数据
vector<string> parse_xml_response(const string& xml_response)
 {
    vector<string> result;
    ptree pt;
    stringstream ss(xml_response);
    read_xml(ss, pt);
    for (auto& item : pt.get_child("response"))
   {
        result.push_back(item.second.data());
    }
    return result;
}

// 生成XML请求数据
string generate_xml_request(const string& operation, const vector<string>& params) 
{
    ptree pt;
    pt.put("request.operation", operation);
    for (int i = 0; i < params.size(); ++i) 
    {
        pt.put("request.param" + to_string(i + 1), params[i]);
    }
    stringstream ss;
    write_xml(ss, pt);
    return ss.str();
}

int main() 
{
    // 发送XML请求
    string xml_request = generate_xml_request("get_data", {"param1", "param2"});
    string xml_response = send_xml_request(xml_request);

    // 解析XML响应
    vector<string> result = parse_xml_response(xml_response);
    for (const auto& item : result) 
    {
        cout << item << endl;
    }
    return 0;
}
//

//2. JSON协议对接:

//c++
#include <iostream>
#include <string>
#include <vector>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>

using namespace std;
using boost::property_tree::ptree;

// 解析JSON响应数据
vector<string> parse_json_response(const string& json_response) 
{
    vector<string> result;
    ptree pt;
    stringstream ss(json_response);
    read_json(ss, pt);
    for (auto& item : pt.get_child("response")) 
   {
        result.push_back(item.second.data());
   }
    return result;
}

// 生成JSON请求数据
string generate_json_request(const string& operation, const vector<string>& params) 
{
    ptree pt;
    pt.put("request.operation", operation);
    for (int i = 0; i < params.size(); ++i) 
    {
        pt.put("request.param" + to_string(i + 1), params[i]);
    }
    stringstream ss;
    write_json(ss, pt);
    return ss.str();
}

int main() 
{
    // 发送JSON请求
    string json_request = generate_json_request("get_data", {"param1", "param2"});
    string json_response = send_json_request(json_request);

    // 解析JSON响应
    vector<string> result = parse_json_response(json_response);
    for (const auto& item : result) 
    {
        cout << item << endl;
    }
    return 0;
}
//

//3. SOAP协议对接:

//c++
#include <iostream>
#include <string>
#include <vector>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/xml_parser.hpp>

using namespace std;
using boost::property_tree::ptree;

// 解析SOAP响应数据
vector<string> parse_soap_response(const string& soap_response) 
{
    vector<string> result;
    ptree pt;
    stringstream ss(soap_response);
    read_xml(ss, pt);
    for (auto& item : pt.get_child("soap:Envelope.soap:Body.response")) 
   {
        result.push_back(item.second.data());
    }
    return result;
}

// 生成SOAP请求数据
string generate_soap_request(const string& operation, const vector<string>& params) 
{
    ptree pt;
    pt.put("soap:Envelope.soap:Body.request.operation", operation);
    for (int i = 0; i < params.size(); ++i) 
    {
        pt.put("soap:Envelope.soap:Body.request.param" + to_string(i + 1), params[i]);
    }
    stringstream ss;
    write_xml(ss, pt);
    return ss.str();
}

int main() 
{
    // 发送SOAP请求
    string soap_request = generate_soap_request("get_data", {"param1", "param2"});
    string soap_response = send_soap_request(soap_request);

    // 解析SOAP响应
    vector<string> result = parse_soap_response(soap_response);
    for (const auto& item : result) 
   {
        cout << item << endl;
    }
    return 0;
}
//

//以上代码仅为示例,具体实现需要根据实际情况进行调整。

http://www.yayakq.cn/news/653606/

相关文章:

  • 做58同城网站花了多少钱集团公司做网站
  • 光谷网站制作正规的报价单格式
  • 辽宁专业模板网站建设公司品牌网站设计制作哪家正规
  • 西安网站优化服务项目改造方案
  • 临沂专业网站建设公司电话网站开发常用图标 图像
  • 定制网站系统影视网站的设计与实现
  • 哪里有做网站的公司公司网站开发步骤
  • 网站友情链接模块expression wordpress主题
  • 外管局网站做延期收款报告网站建设-应酷
  • 网站建设简介电话做网站编程要学什么
  • 网站描述 修改泉州最专业微信网站建设公司
  • 大型淘宝客返利网站建设jquery 网站后台模板
  • 广州网站建设(信科分公司)什么是网站源码
  • 赣州网站开发太原网站建设公司5858
  • 高大上企业网站广州市研发网站建设平台
  • 做微商自己建网站合适吗编程网课哪家好
  • 电力建设期刊网站投稿建设网站简单教程
  • 020网站开发多少钱墨刀做网站上下滑动的交互
  • 铜川网站建设报价公路建设查询网站
  • 做阀门销售在哪个网站上做好有没有可以做游戏的网站吗
  • 如何用文档做网站计算机应用技术专业网站开发方向
  • 零食网站页面模板公司申请网站建设申请理由
  • 慕课网网站开发背景电子商务网页设计模板
  • 华强北网站建设公司2019网站怎么做
  • 昆明网站制作代理如何建开发手机网站首页
  • 台州市建设招标投标网站软件开发专业是做什么的
  • 网络推广SEO优化网站建设站长之家是干什么的
  • 常州网站制作建设南宁坐地铁用什么小程序
  • 专门做瓷砖的网站wordpress做分类网站
  • php网站开发优势淘宝店做网站建设不能开直通车