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

哪些网站可以做详情页百度电脑版

哪些网站可以做详情页,百度电脑版,做幼儿园设计方案的网站,纯净系统基地&#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.yidumall.com/news/54934.html

相关文章:

  • 可以做动画的网站都有哪些内容地推app接任务平台
  • 建设工程信息网重庆seo是啥意思
  • 设计企业网站机营销型网站建设
  • 怎么把网站做10万ip市场推广方案怎么做
  • 国内大的网站建设公司排名免费网站统计代码
  • 网站建设下什么费用建网站的详细步骤
  • 做宣传单赚钱的网站网站如何优化推广
  • wordpress 禁用谷歌字体 地图郑州专业seo推荐
  • 自己做网站模版电商培训机构哪家好
  • vue 做的网站郑州seo服务
  • 做建网站大型网站制作
  • 微信怎么做网站百度搜索排行榜前十名
  • 网站如何做视频的软件seo企业优化顾问
  • 电子商务网站策划排名优化百度
  • 做网站用什么格式做好中国经济网人事
  • 商务网站建设ppt模板web制作网站的模板
  • 成都网站制作工作室广州网站推广软件
  • 河南省网站集约化建设优化技术
  • 路由器上建网站广州竞价外包
  • 做网站一定要公司备案吗2023年时政热点事件
  • 域名解析其他网站百度100%秒收录
  • 做微网站需要什么上海百网优seo优化公司
  • 什么做网站的公司好电话营销话术
  • 如何做网站展示商品百度网盘账号登录入口
  • 用网站源码做网站网站优化包括对什么优化
  • 旅游网站模板下载百度seo关键词排名价格
  • wordpress网页无法运作太原seo快速排名
  • 做文交所的都有哪些网站百度云服务器
  • 网站后台选择2022拉新推广赚钱的app
  • 工信部网站备案查通知店铺推广怎么做