Outils pour utilisateurs

Outils du site


cours:service_oriented_computing_and_web_services:2017-2018:gsoap

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
cours:service_oriented_computing_and_web_services:2017-2018:gsoap [2018/04/12 07:24]
tigli [Tutorial : Getting Start with gSOAP]
cours:service_oriented_computing_and_web_services:2017-2018:gsoap [2018/04/12 15:35]
tigli [How to publish a WSDL of a web service using gSOAP]
Ligne 55: Ligne 55:
 [[https://​www.genivia.com/​dev.html|Getting Start with gSOAP]] [[https://​www.genivia.com/​dev.html|Getting Start with gSOAP]]
  
 +
 +
 +==== Publish the WSDL of your web service using gSOAP ====
 +||
 +[[https://​www.cs.fsu.edu/​~engelen/​soapdoc2.html#​tth_sEc19.10| In HTTP GET Support ...]] find an example that  produces a WSDL file upon a HTTP GET with path ** ?wsdl **
 +
 +<​code>​
 +
 +int http_get(struct soap *soap)
 +{
 +   FILE *fd = NULL;
 +   char *s = strchr(soap->​path,​ '?'​);​
 +   if (!s || strcmp(s, "?​wsdl"​))
 +      return SOAP_GET_METHOD;​
 +   fd = fopen("​myservice.wsdl",​ "​rb"​);​ // open WSDL file to copy
 +   if (!fd)
 +      return 404; // return HTTP not found error
 +   ​soap->​http_content = "​text/​xml";​ // HTTP header with text/xml content
 +   ​soap_response(soap,​ SOAP_FILE);
 +   for (;;)
 +   {
 +      size_t r = fread(soap->​tmpbuf,​ 1, sizeof(soap->​tmpbuf),​ fd);
 +      if (!r)
 +         ​break;​
 +      if (soap_send_raw(soap,​ soap->​tmpbuf,​ r))
 +         ​break;​ // can't send, but little we can do about that
 +   }
 +   ​fclose(fd);​
 +   ​soap_end_send(soap);​
 +   ​return SOAP_OK;
 +
 +
 +</​code>​
  
 ==== Test the interoperability ​ ==== ==== Test the interoperability ​ ====
Ligne 68: Ligne 101:
 To illustrate that choose your own prefered POSIX function and test it through a Web Service gSOAP. ​ To illustrate that choose your own prefered POSIX function and test it through a Web Service gSOAP. ​
 If you don't have imagination try // getpid() //. If you don't have imagination try // getpid() //.
- 
-==== Raspbian ==== 
- 
-Raspbian is a free operating system based on Debian optimized for the Raspberry Pi hardware. An operating system is the set of basic programs and utilities that make your Raspberry Pi run. However, Raspbian provides more than a pure OS: it comes with over 35,000 packages, pre-compiled software bundled in a nice format for easy installation on your Raspberry Pi. 
- 
  
  
cours/service_oriented_computing_and_web_services/2017-2018/gsoap.txt · Dernière modification: 2018/04/12 15:35 par tigli