📄 quote3.cpp
字号:
#include "soapQuoteProxy.h" // get proxy#include "Quote.nsmap" // get namespace bindingsusing namespace std;class Stock : public Quote // Quote is the name of the service (see quote3.h and Quote.wsdl){ public: char *symbol; // Stock ticker Stock() : Quote() { symbol = NULL; }; Stock(char *ticker) { symbol = ticker; }; void ticker(char *ticker) { symbol = ticker; }; float quote() { float q; ns__getQuote(symbol, q); return q; };};int main(){ Quote q; float r; // Example using the Quote proxy class directly: if (q.ns__getQuote("IBM", r) == SOAP_OK) cout << r << endl; else soap_print_fault(q.soap, stderr); // Example using the derived Stock proxy class: Stock IBM("IBM"); cout << IBM.quote() << endl; return 0;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -