⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.c

📁 linux下简单对象应用协议的开发库
💻 C
字号:
// must include envH.h first: it declares the SOAP Header and Fault structures// shared among the clients and services#include "envH.h"// include the quote and rate stubs and calc skeleton#include "quoteH.h"#include "rateH.h"#include "calcH.h"// include the XML namespace mapping tables#include "quote.nsmap"#include "rate.nsmap"#include "calc.nsmap"int main(int argc, char *argv[]){ struct soap *soap = soap_new();  if (argc <= 1)    return calc_serve(soap);  else  { float q;    if (soap_call_ns__getQuote(soap, NULL, NULL, argv[1], &q))      soap_print_fault(soap, stderr);    else    { if (argc > 2)      { float r;        if (soap_call_ns__getRate(soap, NULL, NULL, "us", argv[2], &r))          soap_print_fault(soap, stderr);        else          q *= r;      }      printf("%s: %g\n", argv[1], q);    }  }  soap_end(soap);  soap_done(soap);  free(soap);  return 0;}int ns__add(struct soap *soap, double a, double b, double *result){ *result = a + b;  return SOAP_OK;}int ns__sub(struct soap *soap, double a, double b, double *result){ *result = a - b;  return SOAP_OK;}int ns__mul(struct soap *soap, double a, double b, double *result){ *result = a * b;  return SOAP_OK;}int ns__div(struct soap *soap, double a, double b, double *result){ *result = a / b;  return SOAP_OK;}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -