【发布时间】:2016-03-24 10:49:03
【问题描述】:
我是 gSOAP 的新手。我通过命令提示符和 SOAPUI 从服务器获取响应。但是我无法通过浏览器获得响应。在浏览器中,我收到响应“GET method not implemented”。
谁能帮我实现get方法?
请分享浏览器也得到正确响应的简单示例代码。
【问题讨论】:
我是 gSOAP 的新手。我通过命令提示符和 SOAPUI 从服务器获取响应。但是我无法通过浏览器获得响应。在浏览器中,我收到响应“GET method not implemented”。
谁能帮我实现get方法?
请分享浏览器也得到正确响应的简单示例代码。
【问题讨论】:
这在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;
}
【讨论】: