【急】soap 类 如何 定义

youxin2012 youxin2012 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
开始学webserver 遇到个问题,想请教大侠

主函数如下
int main(void)
{
printf("very good!/n");
_ns1__getWeatherbyCityName city; //这样的对象将生成怎样的对象啊?
_ns1__getWeatherbyCityNameResponse cityResponse;

WeatherWebServiceSoapProxy service;

if(service.getWeatherbyCityName(city,cityResponse) == SOAP_OK)
{
//如何返回天气的值
}
return 0;
}


其中_ns1__getWeatherbyCityName的类定义如下
class SOAP_CMAC _ns1__getWeatherbyCityName
{
public:
std::string *theCityName; /* optional element of type xsd:string */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 16; } /* = unique id SOAP_TYPE__ns1__getWeatherbyCityName */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
_ns1__getWeatherbyCityName() { _ns1__getWeatherbyCityName::soap_default(NULL); }
virtual ~_ns1__getWeatherbyCityName() { }
};

class SOAP_CMAC _ns1__getWeatherbyCityNameResponse
{
public:
ns1__ArrayOfString *getWeatherbyCityNameResult; /* SOAP 1.2 RPC return element (when namespace qualified) */ /* optional element of type ns1:ArrayOfString */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 17; } /* = unique id SOAP_TYPE__ns1__getWeatherbyCityNameResponse */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
_ns1__getWeatherbyCityNameResponse() { _ns1__getWeatherbyCityNameResponse::soap_default(NULL); }
virtual ~_ns1__getWeatherbyCityNameResponse() { }
};


另外 函数原型 为
virtual	int getWeatherbyCityName(_ns1__getWeatherbyCityName *ns1__getWeatherbyCityName, _ns1__getWeatherbyCityNameResponse *ns1__getWeatherbyCityNameResponse) { return this->getWeatherbyCityName(NULL, NULL, ns1__getWeatherbyCityName, ns1__getWeatherbyCityNameResponse); }
virtual int getWeatherbyCityName(const char *endpoint, const char *soap_action, _ns1__getWeatherbyCityName *ns1__getWeatherbyCityName, _ns1__getWeatherbyCityNameResponse *ns1__getWeatherbyCityNameResponse);


我想问下,这样的参数如何定义,不会初始化 soap 变量啊? 怎样才能显示返回值呢??谢谢大家


...全文

相关推荐

评论 4
收藏 已收藏
分享
返回顶部
youxin2012
Web Services 12,164 成员 16,322 内容