All Downloads are FREE. Search and download functionalities are using the official Maven repository.

templates.includes.webclient.gsoap.FaceDbSDKCore.body.vm Maven / Gradle / Ivy

There is a newer version: 3.5.0
Show newest version
#if( $source_type == "cpp" )
${BASEINDENT}        $!METHOD_PREFIX${className}(const std::string& endpoint,const soap& paramSoap):${className}(nullptr,endpoint,paramSoap){}
#end
#if( $source_type != "cpp" )
${BASEINDENT}    public:
${BASEINDENT}        ${className}(const std::shared_ptr& faceAPI) :${className}(faceAPI, std::string()) {}
#end
${BASEINDENT}        // 构造函数
${BASEINDENT}        // faceAPI和endpoint两个参数不可同时为空,否则抛出std::invalid_argument异常
${BASEINDENT}        // faceAPI FaceAPICore接口实例
${BASEINDENT}        // endpoint 服务器目标地址url, 为空时,faceAPI必须为gsoap实现,构造的对象将使用faceAPI的endpoint
${BASEINDENT}        // paramSoap soap参数对象,可通过此参数调整soap调用的工作参数,如soap.send_timeout,soap.recv_timeout,
${BASEINDENT}        // 关于soap的参数设置参见gsoap的官方文档:http://www.genivia.com/doc/soapdoc2.html
${BASEINDENT}        // endpoint为空时,使用faceAPI的paramSoap
${BASEINDENT}        $!METHOD_PREFIX${className}(const std::shared_ptr &faceAPI, const std::string& endpoint,const soap& paramSoap#if( $source_type != "cpp" )=soap()#end)#if( $source_type == "h" );
#else{
${BASEINDENT}            std::string point;
${BASEINDENT}            std::shared_ptr instance;
${BASEINDENT}            soap psoap=paramSoap;
${BASEINDENT}            throw_if_msg(nullptr==faceAPI&&endpoint.empty(),"the argument 'faceAPI' and 'endpoint' must not be empyt all")
${BASEINDENT}            if (nullptr != faceAPI) {
${BASEINDENT}                instance = faceAPI;
${BASEINDENT}                if (endpoint.empty()) {
${BASEINDENT}                    auto gsoap_instance=std::dynamic_pointer_cast(instance);
${BASEINDENT}                    // gsoap_instance为nullptr时抛出异常
${BASEINDENT}                    throw_except_if_msg(std::logic_error, nullptr == gsoap_instance, "the argument 'faceAPI' must be webservice implementation if 'endpoint' is empty ")
${BASEINDENT}                    point = gsoap_instance->getEndpoint();
${BASEINDENT}                    psoap=gsoap_instance->getParamSoap();
${BASEINDENT}                }
${BASEINDENT}                else
${BASEINDENT}                    point = endpoint;
${BASEINDENT}            }
${BASEINDENT}            else {
${BASEINDENT}                point = endpoint;
${BASEINDENT}                instance = std::make_shared(point);
${BASEINDENT}            }
${BASEINDENT}            this->faceAPI=instance;
${BASEINDENT}            this->endpoint=point;  
${BASEINDENT}            this->paramSoap=psoap;
${BASEINDENT}        }
#end




© 2015 - 2025 Weber Informatics LLC | Privacy Policy