42 const string& NS_queue,
43 const string& client_name,
44 const string& NC_registry_section
46 :
TBaseClient(NS_service, NS_queue, client_name, NC_registry_section)
51 const string& NC_registry_section
53 :
TBaseClient(NS_registry_section, NC_registry_section)
58 : m_Http_svc(http_svc.service),
94 ERR_POST(
Trace <<
"encoded request " << mem_str.tellp() <<
" bytes");
103 const CTimeout timeout{ 20, 400000 };
107 ERR_POST(
Trace <<
"encoded request " << reqdata.size() <<
" bytes");
109 const auto response = m_Http_session->Post(m_Http_svc, reqdata, content_type, timeout);
110 if (!response.CanGetContentStream()) {
116 ERR_POST(response.GetStatusText() <<
" -- " << err);
119 ERR_POST(
Trace <<
"status_code: " << response.GetStatusCode());
133 if (m_Http_session.NotNull()) {
134 return x_HttpFetch(request);
137 TBaseClient::Ask(request, reply.
GetObject());
static unique_ptr< CObjectOStream > GetOStream(CNcbiOstream &ostr, SStreamProp stream_prop=SStreamProp(CCompressStream::eZip))
Return an object output stream (CObjectOStream)
static unique_ptr< CObjectIStream > GetIStream(CNcbiIstream &istr)
Return an object input stream (CObjectIStream)
In-memory stream (a la strstream or stringstream)
CGridRPCBaseClient<typename TConnectTraits>
pair< CNetScheduleJob, bool > AskStream(CNcbiIstream &request, CNcbiOstream &reply) const
Sends an ASN.1 request, waiting specified time.
TReplyRef Fetch(const TRequest &request) const
CTMS_DisplayTrack_Client(const string &NS_service, const string &NS_queue, const string &client_name, const string &NC_registry_section)
TReplyRef x_HttpFetch(const TRequest &request) const
objects::CTMgr_DisplayTrackReply TReply
static CTMS_DisplayTrack_Client CreateServiceClient(const string &http_svc="TMS_DisplayTracks")
objects::CTMgr_DisplayTrackRequest TRequest
CRef< CHttpSession > m_Http_session
bool FetchRawStream(CNcbiIstream &requeststr, CNcbiOstream &replystr) const
CTimeout – Timeout interval.
string RequestToString(const CTMS_DisplayTrack_Client::TRequest &request)
void ToString(string *)
The CConnMemoryStream::To* methods allow to obtain unread portion of the stream into a single contain...
void Post(CRequestStatus::ECode status, CTempString status_msg=CTempString())
Write the collected resource info and timing to the log.
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
void Trace(CExceptionArgs_Base &args)
#define NCBI_REPORT_EXCEPTION(title, ex)
Generate a report on the exception.
bool NotNull(void) const THROWS_NONE
Check if pointer is not null – same effect as NotEmpty().
CRef< C > Ref(C *object)
Helper functions to get CRef<> and CConstRef<> objects.
void Reset(void)
Reset reference object.
TObjectType & GetObject(void)
Get object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
IO_PREFIX::istream CNcbiIstream
Portable alias for istream.
bool NcbiStreamCopy(CNcbiOstream &os, CNcbiIstream &is)
Copy the entire contents of stream "is" to stream "os".