#include #include #include using namespace std; static const char* ns = "GSN"; void main(){ // starting message cout << "SOAP CLIENT by KUGS" << endl; cout << endl; // requiring ID string id; cout << "[please input ID]" << endl; while(true){ char ch = getch(); if(ch == 13) break; // 13 == RETURN else id += ch; cout << ch; } cout << endl; cout << endl; // requiring Password string password; cout << "[please input Password]" << endl; while(true){ char ch = getch(); if(ch == 13) break; // 13 == RETURN else password += ch; cout << '*'; } cout << endl; cout << endl; // loop while(true){ try{ // waiting the file update cout << "[update the request file and push any key]" << endl; getch(); // including the file InitFile ini = InitFile::valueOf("request.txt"); // server & port (endpoint) // ex. endpoint = "ローカルホスト:80" string server = ini["Server"]; string port = ini["Port"]; string endpoint = "http://"; endpoint += server; endpoint += ":"; endpoint += port; endpoint += "/"; ini.erase("Server"); ini.erase("Port"); SOAPProxy proxy(endpoint.c_str()); // str_method string str_method = ini["Method"]; ini.erase("Method"); // method SOAPMethod method(str_method.c_str(), ns); // ID & Password -> method method.AddParameter("ID") << id.c_str(); method.AddParameter("Password") << password.c_str(); for(int i=0; i> str_response; // diplay the response cout << "server >> " << str_response.Str() << endl; cout << endl; } catch(SOAPException&ex){ // exception cout << "exception [" << ex.What().Str() << "]" << endl; cout << endl; } } /* try{ // network const char*endpoint = "ローカルホスト:80"; SOAPProxy proxy(endpoint); // defining method SOAPMethod SetAzimuthmethod("SetAzimuth", ns); SetAzimuthmethod.AddParameter("id") << "unisec"; SetAzimuthmethod.AddParameter("password") << "ssdl"; SetAzimuthmethod.AddParameter("azimuth") << "100.0"; // execute "SetAzimuth" const SOAPResponse& SetAzimuthResponse=proxy.Execute(SetAzimuthmethod); // waiting the response SOAPString response; SetAzimuthResponse.GetReturnValue() >> response; // diplay the response cout << response << endl; } */ }