【问题标题】:Can anyone share me the sample code in C++ for gSOAP GET method implementation?任何人都可以与我分享用于 gSOAP GET 方法实现的 C++ 示例代码吗?
【发布时间】:2016-03-24 10:49:03
【问题描述】:

我是 gSOAP 的新手。我通过命令提示符和 SOAPUI 从服务器获取响应。但是我无法通过浏览器获得响应。在浏览器中,我收到响应“GET method not implemented”。

谁能帮我实现get方法?

请分享浏览器也得到正确响应的简单示例代码。

【问题讨论】:

    标签: http methods get gsoap


    【解决方案1】:

    这在gSOAP documentaion中有描述

    struct soap *soap = soap_new();
    soap->fget = http_get;
    ...
    soap_serve(soap);
    ...
    int http_get(struct soap *soap)
    {
       soap_response(soap, SOAP_HTML); // HTTP response header with text/html
       soap_send(soap, "<HTML>My Web server is operational.</HTML>");
       soap_end_send(soap);
       return SOAP_OK;
    } 
    

    【讨论】:

      猜你喜欢
      • 2017-03-11
      • 2011-12-02
      • 2015-10-05
      • 2023-01-15
      • 1970-01-01
      • 2010-10-31
      • 1970-01-01
      • 2020-01-19
      • 2022-08-17
      相关资源
      最近更新 更多