一 、参考
https://blog.csdn.net/Ikaros_521/article/details/103232677
二、hello.h
h__hello(char*&);
三、
//helloclient.cpp #include "soapH.h" #include "h.nsmap" int main() { char *s; struct soap *soap = soap_new(); soap_call_h__hello(soap, "http://localhost:8080", "", s); printf("%s\n", s); soap_destroy(soap); soap_end(soap); soap_free(soap); return 0; }
四
//helloserver.cpp #include "soapH.h" #include "h.nsmap" int main() { struct soap *soap = soap_new(); SOAP_SOCKET m = soap_bind(soap, NULL, 8080, 1); if (soap_valid_socket(m)) { while (true) { SOAP_SOCKET s = soap_accept(soap); if (!soap_valid_socket(s)) break; soap_serve(soap); soap_destroy(soap); soap_end(soap); } } soap_print_fault(soap, stderr); soap_free(soap); } int h__hello(struct soap *soap, char* &s) { printf("soap start\n"); s = soap_strdup(soap, "Hello World!"); return SOAP_OK; }
五
c++ -o helloserver helloserver.cpp soapC.cpp soapserver.cpp stdsoap2.cpp -lws2_32
六
c++ -o helloclient helloclient.cpp soapC.cpp soapclient.cpp stdsoap2.cpp -lws2_32
标签:__,webservice,参考,int,hello,sample,cpp,include,soap From: https://www.cnblogs.com/luoxh-whn/p/18337114