65,186
社区成员




// gsoapClient.cpp: 定义应用程序的入口点。
//
#include "gsoapClient.h"
#include "soapH.h"
#include "httpget.h"
#include "stdsoap2.h"
#include "soapStub.h"
#include "WebService1Soap.nsmap"
#define WITH_IPV6
using namespace std;
const char * URL = "http://[2001:0:9d38:6ab8:28de:40c:8b3f:db68]:9995/api/values/6";
//const char * URL = "http://192.168.0.103:9994/api/values/6";
int main()
{
cout << "Hello CMake。" << endl;
struct soap *soap;
char *body;
soap = soap_new();
soap_set_omode(soap, SOAP_C_UTFSTRING);
soap->bind_inet6 = 1;
printf("ip%s\n", soap->ip);
//soap->ip = 999;
soap_register_plugin(soap, http_get); /* register plugin */
if (soap_get_connect(soap, URL, NULL)
|| soap_begin_recv(soap))
{
soap_print_fault(soap, stderr);
printf("111\n");
getchar();
return(1);
}
if (soap->http_content)
printf("HTTP Content Type: %s\n", soap->http_content);
body = soap_get_http_body(soap, NULL);
soap_end_recv(soap);
if (body)
printf("HTTP Body:\n%s\n", body);
//printf("%s\n", soap->host);
printf("%s\n", soap->path);
printf("ip%s\n", soap->ip);
//printf("%s\n", soap->body);
soap_end(soap);
soap_done(soap);
getchar();
return 0;
}