【急】soap 类 如何 定义
开始学webserver 遇到个问题,想请教大侠
主函数如下
其中_ns1__getWeatherbyCityName的类定义如下
另外 函数原型 为
我想问下,这样的参数如何定义,不会初始化 soap 变量啊? 怎样才能显示返回值呢??谢谢大家
主函数如下
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 变量啊? 怎样才能显示返回值呢??谢谢大家
...全文
相关推荐
C++的soap通信类
它们可能包含了对微软SOAP库的封装,提供了易于使用的C++接口。开发者可以通过阅读和学习这些源码,了解如何自定义和扩展SOAP通信功能。
拼接soap,判断soap是否连接成功,返回接口的信息,解析soap报文,解析后的soap转成实体
最后,"将解析后的SOAP转成Java实体"意味着将解析出的数据映射到预先定义好的Java类实例上。
soap-build生成Soap接口请求报文
在使用“soap-build”时,你需要有SOAP服务的WSDL(Web Service Description Language)文件,这是一个XML文档,定义了服务的接口、消息格式和调用方式。
java发送SOAP报文
**创建SOAP消息**:使用`javax.xml.soap`包中的`SOAPMessage`类创建一个新的SOAP消息实例。
MFC下实现SOAP服务端和SOAP客户端
在MFC中,可以使用CInternetServer类作为基础,创建一个HTTP服务器,监听来自客户端的SOAP请求。gSoap库提供了一种将C++接口转换为SOAP服务的方法。


Web Services
