+// Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
#include "CreateConfigFile.h"
#include "CreateConfigFileResponse.h"
#include "GetFile.h"
#include "PutFileResponse.h"
#include "SimanSalomeServiceStub.h"
#include <Environment.h>
+#include <ServiceClient.h>
#include <iostream>
#include <fstream>
-#include <ServiceClient.h>
#include <axiom.h>
#include <axis2_util.h>
#include <axis2_client.h>
#include <axutil_uuid_gen.h>
-
-using namespace std;
using namespace org_splat_ws_server_service_salome;
using namespace wso2wsf;
char * ttest = getenv("SIMAN_WS_HOS");
if (ttest == NULL)
- cout<<"expected\n";
+ std::cout<<"expected\n";
else
- cout<<"unexpected\n";
+ std::cout<<"unexpected\n";
- string aSimanWSHost(getenv("SIMAN_WS_HOST"));
- string endpointUriTT = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
+ std::string aSimanWSHost(getenv("SIMAN_WS_HOST"));
+ std::string endpointUriTT = "http://" + aSimanWSHost + "/Siman-WS/services/SimanSalomeService";
- cout<<"enpoint uri" << endpointUriTT << "\n";
+ std::cout<<"enpoint uri" << endpointUriTT << "\n";
Environment::initialize("SimanSalomeService.log",AXIS2_LOG_LEVEL_DEBUG);
long long studyId = 1000;
long long scenarioId = 1001;
long long userId = 8;
- string newUserId = "8";
+ std::string newUserId = "8";
aRequest->setArgs0(studyId);
aRequest->setArgs1(scenarioId);
aResponse = aStub->createConfigFile(aRequest);
- cout<< "Response:: "<<aResponse->get_return()<<endl;
+ std::cout<< "Response:: "<<aResponse->get_return()<<std::endl;
//Parse the response and get the filename
std::string aResponseFilePath = aResponse->get_return();
std::string aResponseFileName = aResponseFilePath.substr(aResponseFilePath.find_last_of("/\\")+1);
- cout << aResponseFileName << "\n";
+ std::cout << aResponseFileName << "\n";
//Set options
axis2_options_set_action(axis2options, Environment::getEnv(), "urn:getFile");
std::ofstream outputStream;
std::string aClientFilePath = "/dn24/SIMAN/siman_temp/download/" + aResponseFileName;
- outputStream.open(aClientFilePath.c_str(), ofstream::binary);
+ outputStream.open(aClientFilePath.c_str(), std::ofstream::binary);
int aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
- cout<<aBufferSize<<"\n";
+ std::cout<<aBufferSize<<"\n";
int* aBufSize = new int[aBufferSize];
unsigned char* aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
//char* aCopyBuf = aCopyBuf;
outputStream.close();
//Second test
- /*string aSourceLoc = "W:\\testvideo\\Darvin.avi";
+ /*std::string aSourceLoc = "W:\\testvideo\\Darvin.avi";
aGetFileRequest->setArgs0(aSourceLoc);
aGetFileResponse = aStub->getFile(aGetFileRequest);
- outputStream.open("/dn24/SIMAN/siman_temp/download/Darvin.avi", ofstream::binary);
+ outputStream.open("/dn24/SIMAN/siman_temp/download/Darvin.avi", std::ofstream::binary);
aBufferSize = axutil_base64_binary_get_decoded_binary_len(aGetFileResponse->get_return(), Environment::getEnv());
- cout<<aBufferSize<<"\n";
+ std::cout<<aBufferSize<<"\n";
aBufSize = new int[aBufferSize];
aCopyBuffer = axutil_base64_binary_get_plain_binary(aGetFileResponse->get_return(), Environment::getEnv(), aBufSize);
outputStream.close();
*/
//End second test
- cout << "See file on path" << aClientFilePath << "\n";
+ std::cout << "See file on path" << aClientFilePath << "\n";
//Upload test
axis2_options_set_action(axis2options, Environment::getEnv(), "urn:putFile");
//char* aSourceFile = "/dn24/SIMAN/siman_temp/download/Mesh_1.med";
//get size of the input file
- ifstream infile ("/dn24/SIMAN/siman_temp/download/Mesh_1.med",ifstream::binary);
- infile.seekg(0,ifstream::end);
+ std::ifstream infile ("/dn24/SIMAN/siman_temp/download/Mesh_1.med",std::ifstream::binary);
+ infile.seekg(0,std::ifstream::end);
int aSize = infile.tellg();
- cout << "Size of the input file is: " << aSize << "\n";
+ std::cout << "Size of the input file is: " << aSize << "\n";
infile.seekg(0);
char * inBuffer;
aPutFileRequest->setArgs1("Mesh_1.med");
aPutFileRequest->setArgs2(userId);
- cout << "test" <<"\n";
+ std::cout << "test" <<"\n";
PutFileResponse* aPutFileResponse = new PutFileResponse();
aPutFileResponse = aStub->putFile(aPutFileRequest);
- cout<< "Response:: "<<aPutFileResponse->get_return()<<endl;
+ std::cout<< "Response:: "<<aPutFileResponse->get_return()<<std::endl;
delete aResponse;
delete aRequest;
delete aPutFileResponse;
delete aPutFileRequest;
delete aStub;
-}
\ No newline at end of file
+}