c++ - gsoap returns error 12 and "No user identifier provided" stream error -
i trying build simple gsoap client stuck. code, wrote.
currencyratessoapproxy currproxy; std::string login = "kav120@aubg.bg"; std::string password = "mypass"; std::string = "usd"; std::string = "eur"; _ns1__getlatestrate* getrate = new _ns1__getlatestrate; getrate->singlecurrencyfrom = &from; getrate->singlecurrencyto = &to; getrate->password = &password; getrate->userid = &login; _ns1__getlatestrateresponse* resp = new _ns1__getlatestrateresponse; if (currproxy.getlatestrate(getrate, resp) == soap_ok) std::cout << "works"; else { currproxy.soap_stream_fault(std::cout); std::cout << currproxy.error; }
currencyratesoapproxy:
class soap_cmac currencyratessoapproxy : public soap { public: /// endpoint url of service 'currencyratessoapproxy' (change needed) const char *soap_endpoint; /// constructor currencyratessoapproxy(); /// construct engine state currencyratessoapproxy(const struct soap&); /// constructor endpoint url currencyratessoapproxy(const char *url); /// constructor engine input+output mode control currencyratessoapproxy(soap_mode iomode); /// constructor url , input+output mode control currencyratessoapproxy(const char *url, soap_mode iomode); /// constructor engine input , output mode control currencyratessoapproxy(soap_mode imode, soap_mode omode); /// destructor frees deserialized data virtual ~currencyratessoapproxy(); /// initializer used constructors virtual void currencyratessoapproxy_init(soap_mode imode, soap_mode omode); /// delete deserialized data (with soap_destroy , soap_end) virtual void destroy(); /// delete deserialized data , reset default virtual void reset(); /// disables , removes soap header message virtual void soap_noheader(); /// soap header structure (null when absent) virtual const soap_env__header *soap_header(); /// soap fault structure (null when absent) virtual const soap_env__fault *soap_fault(); /// soap fault string (null when absent) virtual const char *soap_fault_string(); /// soap fault detail string (null when absent) virtual const char *soap_fault_detail(); /// close connection (normally automatic, except send_x ops) virtual int soap_close_socket(); /// force close connection (can kill thread blocked on io) virtual int soap_force_close_socket(); /// print fault virtual void soap_print_fault(file*); #ifndef with_lean /// print fault stream #ifndef with_compat virtual void soap_stream_fault(std::ostream&); #endif /// put fault buffer virtual char *soap_sprint_fault(char *buf, size_t len); #endif /// web service operation 'getlatestrate' (returns error code or soap_ok) virtual int getlatestrate(_ns1__getlatestrate *ns1__getlatestrate, _ns1__getlatestrateresponse *ns1__getlatestrateresponse) { return this->getlatestrate(null, null, ns1__getlatestrate, ns1__getlatestrateresponse); } virtual int getlatestrate(const char *endpoint, const char *soap_action, _ns1__getlatestrate *ns1__getlatestrate, _ns1__getlatestrateresponse *ns1__getlatestrateresponse); }
and ns1_getlatestrateresponse:
class soap_cmac _ns1__getlatestrate { public: std::string *unregistereduseremail; /* optional element of type xsd:string */ std::string *userid; /* optional element of type xsd:string */ std::string *password; /* optional element of type xsd:string */ std::string *singlecurrencyfrom; /* optional element of type xsd:string */ std::string *singlecurrencyto; /* optional element of type xsd:string */ struct soap *soap; /* transient */ public: virtual int soap_type() const { return 35; } /* = unique id soap_type__ns1__getlatestrate */ 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__getlatestrate() { _ns1__getlatestrate::soap_default(null); } virtual ~_ns1__getlatestrate() { } };
i have no idea, doing wrong error 12 , "no user identifier provided" stream error. smth this:
soap 1.1 fault: soap-env:client[no subcode] "no user identifier provided" detail: [no detail]
i dont think ""no user identifier provided" license info of service, because provided username , password. doing wrong? in advance
Comments
Post a Comment