Skip to content
Snippets Groups Projects
Commit 40d94413 authored by Ren, Shelly's avatar Ren, Shelly
Browse files

Refs #3968 -- fixed the bug which caused failure of icat unit test in Windows

parent 291d4f5c
No related branches found
No related tags found
No related merge requests found
...@@ -10,9 +10,8 @@ ...@@ -10,9 +10,8 @@
#include "MantidICat/GSoapGenerated/soapH.h" #include "MantidICat/GSoapGenerated/soapH.h"
class SOAP_CMAC ICATPortBindingProxy : public soap class SOAP_CMAC ICATPortBindingProxy : public soap
{ public: {
/// Endpoint URL of service 'ICATPortBindingProxy' (change as needed) public:
const char *soap_endpoint;
/// Constructor /// Constructor
ICATPortBindingProxy(); ICATPortBindingProxy();
/// Constructor with copy of another engine state /// Constructor with copy of another engine state
...@@ -39,6 +38,7 @@ class SOAP_CMAC ICATPortBindingProxy : public soap ...@@ -39,6 +38,7 @@ class SOAP_CMAC ICATPortBindingProxy : public soap
virtual int soap_close_socket(); virtual int soap_close_socket();
/// Print fault /// Print fault
virtual void soap_print_fault(FILE*); virtual void soap_print_fault(FILE*);
#ifndef WITH_LEAN #ifndef WITH_LEAN
/// Print fault to stream /// Print fault to stream
virtual void soap_stream_fault(std::ostream&); virtual void soap_stream_fault(std::ostream&);
...@@ -363,5 +363,9 @@ class SOAP_CMAC ICATPortBindingProxy : public soap ...@@ -363,5 +363,9 @@ class SOAP_CMAC ICATPortBindingProxy : public soap
/// Web service operation 'searchDatafilesByParameterComparators' (returns error code or SOAP_OK) /// Web service operation 'searchDatafilesByParameterComparators' (returns error code or SOAP_OK)
virtual int searchDatafilesByParameterComparators(ns1__searchDatafilesByParameterComparators *ns1__searchDatafilesByParameterComparators_, ns1__searchDatafilesByParameterComparatorsResponse *ns1__searchDatafilesByParameterComparatorsResponse_); virtual int searchDatafilesByParameterComparators(ns1__searchDatafilesByParameterComparators *ns1__searchDatafilesByParameterComparators_, ns1__searchDatafilesByParameterComparatorsResponse *ns1__searchDatafilesByParameterComparatorsResponse_);
private:
/// Endpoint URL of service 'ICATPortBindingProxy' (change as needed)
char *soap_endpoint;
}; };
#endif #endif
...@@ -69,6 +69,8 @@ public: ...@@ -69,6 +69,8 @@ public:
const std::vector<std::string> extensions()const{return m_extensions;} const std::vector<std::string> extensions()const{return m_extensions;}
/// Returns the preferred file extension /// Returns the preferred file extension
const std::string preferredExtension()const{return m_extensions.front();} const std::string preferredExtension()const{return m_extensions.front();}
/// Return the soap endpoint name
const std::string& getSoapEndPoint() const{return m_soapEndPoint;}
/// Return the archive search interface names /// Return the archive search interface names
const std::set<std::string>& archiveSearch()const{return m_archiveSearch;} const std::set<std::string>& archiveSearch()const{return m_archiveSearch;}
/// Returns a list of instruments of this facility /// Returns a list of instruments of this facility
...@@ -91,6 +93,7 @@ private: ...@@ -91,6 +93,7 @@ private:
std::string m_delimiter; /// default delimiter between instrument name and run number std::string m_delimiter; /// default delimiter between instrument name and run number
std::vector<std::string> m_extensions; ///< file extensions in order of preference std::vector<std::string> m_extensions; ///< file extensions in order of preference
std::set<std::string> m_archiveSearch; ///< names of the archive search interface std::set<std::string> m_archiveSearch; ///< names of the archive search interface
std::string m_soapEndPoint; ///< names of the soap end point
std::vector<InstrumentInfo> m_instruments; ///< list of instruments of this facility std::vector<InstrumentInfo> m_instruments; ///< list of instruments of this facility
std::string m_catalogName; ///< name of the catalog system of this facilty std::string m_catalogName; ///< name of the catalog system of this facilty
static Logger& g_log; ///< logger static Logger& g_log; ///< logger
......
...@@ -25,7 +25,7 @@ Logger& FacilityInfo::g_log(Logger::get("FacilityInfo")); ...@@ -25,7 +25,7 @@ Logger& FacilityInfo::g_log(Logger::get("FacilityInfo"));
* @throw std::runtime_error if name or file extensions are not defined * @throw std::runtime_error if name or file extensions are not defined
*/ */
FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) : FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) :
m_name(elem->getAttribute("name")), m_zeroPadding(0), m_extensions(), m_archiveSearch(), m_name(elem->getAttribute("name")), m_zeroPadding(0), m_extensions(), m_soapEndPoint(""), m_archiveSearch(),
m_instruments() m_instruments()
{ {
if (m_name.empty()) if (m_name.empty())
...@@ -55,6 +55,26 @@ FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) : ...@@ -55,6 +55,26 @@ FacilityInfo::FacilityInfo(const Poco::XML::Element* elem) :
addExtension(*it); addExtension(*it);
} }
Poco::XML::NodeList* pNL_soapEndPoint = elem->getElementsByTagName("soapEndPoint");
if(!pNL_soapEndPoint)
{
throw std::runtime_error("Facilities.xml file must have soapEndPoint information");
}
if (pNL_soapEndPoint->length() > 1)
{
g_log.error("Facility must have only one soapEndPoint tag");
throw std::runtime_error("Facility must have only one csoapEndPoint tag");
}
else if (pNL_soapEndPoint->length() == 1)
{
Poco::XML::Element* elem = dynamic_cast<Poco::XML::Element*>(pNL_soapEndPoint->item(0));
if(!elem->getAttribute("url").empty())
{
m_soapEndPoint= elem->getAttribute("url");
}
}
pNL_soapEndPoint->release();
Poco::XML::NodeList* pNL_archives = elem->getElementsByTagName("archive"); Poco::XML::NodeList* pNL_archives = elem->getElementsByTagName("archive");
if (pNL_archives->length() > 1) if (pNL_archives->length() > 1)
{ {
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
<catalog name="ICat3Catalog"> <catalog name="ICat3Catalog">
</catalog> </catalog>
<soapEndPoint url="https://facilities01.esc.rl.ac.uk:443/ICATService/ICAT">
</soapEndPoint>
<instrument name="ALF"> <instrument name="ALF">
<technique>Single Crystal Diffraction</technique> <technique>Single Crystal Diffraction</technique>
</instrument> </instrument>
...@@ -205,9 +208,12 @@ ...@@ -205,9 +208,12 @@
<archiveSearch plugin="OrbiterDataSearch" /> <archiveSearch plugin="OrbiterDataSearch" />
</archive> </archive>
<catalog name="VFSCatalog"> <catalog name="ICat3Catalog">
</catalog> </catalog>
<soapEndPoint url="https://orion.sns.gov:8181/ICATService/ICAT">
</soapEndPoint>
<instrument name="DAS"> <instrument name="DAS">
<technique>technique</technique> <technique>technique</technique>
</instrument> </instrument>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment