Commit ee08fd46 authored by claes's avatar claes

XttStart requeset added

parent b81ea5c7
/*
* Proview $Id: rt_statussrv.cpp,v 1.2 2007-05-16 12:32:55 claes Exp $
* Proview $Id: rt_statussrv.cpp,v 1.3 2007-05-21 14:21:39 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -512,9 +512,42 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__Restart(struct soap *soap,
_s0__Restart *s0__Restart,
_s0__RestartResponse *s0__RestartResponse)
{
pwr_tCmd cmd = "rt_ini -r &";
if ( s0__Restart->ClientRequestHandle)
s0__RestartResponse->ClientRequestHandle =
new std::string( *s0__Restart->ClientRequestHandle);
system( cmd);
return SOAP_OK;
}
SOAP_FMAC5 int SOAP_FMAC6 __s0__XttStart(struct soap *soap,
_s0__XttStart *s0__XttStart,
_s0__XttStartResponse *s0__XttStartResponse)
{
char lang[40] = "";
pwr_tOName opplace = "";
char display[80] = "";
pwr_tCmd cmd;
if ( s0__XttStart->ClientRequestHandle)
s0__XttStartResponse->ClientRequestHandle =
new std::string( *s0__XttStart->ClientRequestHandle);
if ( s0__XttStart->Language) {
sprintf( lang, "-l %s", s0__XttStart->Language->c_str());
}
if ( s0__XttStart->OpPlace) {
strcpy( opplace, s0__XttStart->OpPlace->c_str());
}
if ( s0__XttStart->Display) {
sprintf( display, "--display %s", s0__XttStart->Display->c_str());
}
sprintf( cmd, "rt_xtt %s -q -c %s %s &", opplace, display, lang);
system( cmd);
return SOAP_OK;
}
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,7 @@
*/
#include "statussrv_H.h"
SOAP_SOURCE_STAMP("@(#) statussrv_Client.cpp ver 2.7.9d 2007-05-10 13:32:13 GMT")
SOAP_SOURCE_STAMP("@(#) statussrv_Client.cpp ver 2.7.9d 2007-05-21 09:05:52 GMT")
SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__GetStatus(struct soap *soap, const char *soap_endpoint, const char *soap_action, _s0__GetStatus *s0__GetStatus, _s0__GetStatusResponse *s0__GetStatusResponse)
......@@ -165,4 +165,56 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__Restart(struct soap *soap, const char
return soap_closesock(soap);
}
SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__XttStart(struct soap *soap, const char *soap_endpoint, const char *soap_action, _s0__XttStart *s0__XttStart, _s0__XttStartResponse *s0__XttStartResponse)
{ struct __s0__XttStart soap_tmp___s0__XttStart;
if (!soap_action)
soap_action = "s0:XttStart";
soap->encodingStyle = NULL;
soap_tmp___s0__XttStart.s0__XttStart = s0__XttStart;
soap_begin(soap);
soap_serializeheader(soap);
soap_serialize___s0__XttStart(soap, &soap_tmp___s0__XttStart);
if (soap_begin_count(soap))
return soap->error;
if (soap->mode & SOAP_IO_LENGTH)
{ if (soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| soap_put___s0__XttStart(soap, &soap_tmp___s0__XttStart, "-s0:XttStart", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap))
return soap->error;
}
if (soap_end_count(soap))
return soap->error;
if (soap_connect(soap, soap_endpoint, soap_action)
|| soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| soap_put___s0__XttStart(soap, &soap_tmp___s0__XttStart, "-s0:XttStart", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap)
|| soap_end_send(soap))
return soap_closesock(soap);
if (!s0__XttStartResponse)
return soap_closesock(soap);
s0__XttStartResponse->soap_default(soap);
if (soap_begin_recv(soap)
|| soap_envelope_begin_in(soap)
|| soap_recv_header(soap)
|| soap_body_begin_in(soap))
return soap_closesock(soap);
s0__XttStartResponse->soap_get(soap, "s0:XttStartResponse", "");
if (soap->error)
{ if (soap->error == SOAP_TAG_MISMATCH && soap->level == 2)
return soap_recv_fault(soap);
return soap_closesock(soap);
}
if (soap_body_end_in(soap)
|| soap_envelope_end_in(soap)
|| soap_end_recv(soap))
return soap_closesock(soap);
return soap_closesock(soap);
}
/* End of statussrv_Client.cpp */
This diff is collapsed.
......@@ -6,7 +6,7 @@
*/
#include "statussrv_H.h"
SOAP_SOURCE_STAMP("@(#) statussrv_Server.cpp ver 2.7.9d 2007-05-10 13:32:13 GMT")
SOAP_SOURCE_STAMP("@(#) statussrv_Server.cpp ver 2.7.9d 2007-05-21 09:05:52 GMT")
SOAP_FMAC5 int SOAP_FMAC6 soap_serve(struct soap *soap)
......@@ -77,6 +77,8 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve_request(struct soap *soap)
return soap_serve___s0__GetExtStatus(soap);
if (!soap_match_tag(soap, soap->tag, "s0:Restart"))
return soap_serve___s0__Restart(soap);
if (!soap_match_tag(soap, soap->tag, "s0:XttStart"))
return soap_serve___s0__XttStart(soap);
return soap->error = SOAP_NO_METHOD;
}
#endif
......@@ -204,4 +206,45 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve___s0__Restart(struct soap *soap)
return soap_closesock(soap);
}
SOAP_FMAC5 int SOAP_FMAC6 soap_serve___s0__XttStart(struct soap *soap)
{ struct __s0__XttStart soap_tmp___s0__XttStart;
_s0__XttStartResponse s0__XttStartResponse;
s0__XttStartResponse.soap_default(soap);
soap_default___s0__XttStart(soap, &soap_tmp___s0__XttStart);
soap->encodingStyle = NULL;
if (!soap_get___s0__XttStart(soap, &soap_tmp___s0__XttStart, "-s0:XttStart", NULL))
return soap->error;
if (soap_body_end_in(soap)
|| soap_envelope_end_in(soap)
|| soap_end_recv(soap))
return soap->error;
soap->error = __s0__XttStart(soap, soap_tmp___s0__XttStart.s0__XttStart, &s0__XttStartResponse);
if (soap->error)
return soap->error;
soap_serializeheader(soap);
s0__XttStartResponse.soap_serialize(soap);
if (soap_begin_count(soap))
return soap->error;
if (soap->mode & SOAP_IO_LENGTH)
{ if (soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| s0__XttStartResponse.soap_put(soap, "s0:XttStartResponse", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap))
return soap->error;
};
if (soap_end_count(soap)
|| soap_response(soap, SOAP_OK)
|| soap_envelope_begin_out(soap)
|| soap_putheader(soap)
|| soap_body_begin_out(soap)
|| s0__XttStartResponse.soap_put(soap, "s0:XttStartResponse", "")
|| soap_body_end_out(soap)
|| soap_envelope_end_out(soap)
|| soap_end_send(soap))
return soap->error;
return soap_closesock(soap);
}
/* End of statussrv_Server.cpp */
......@@ -47,4 +47,6 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__GetExtStatus(struct soap*, _s0__GetExtStatus *s0
SOAP_FMAC5 int SOAP_FMAC6 __s0__Restart(struct soap*, _s0__Restart *s0__Restart, _s0__RestartResponse *s0__RestartResponse);
SOAP_FMAC5 int SOAP_FMAC6 __s0__XttStart(struct soap*, _s0__XttStart *s0__XttStart, _s0__XttStartResponse *s0__XttStartResponse);
#endif
......@@ -27,5 +27,6 @@ class Service
virtual int __s0__GetStatus(_s0__GetStatus *s0__GetStatus, _s0__GetStatusResponse *s0__GetStatusResponse) { return soap ? soap_call___s0__GetStatus(soap, endpoint, NULL, s0__GetStatus, s0__GetStatusResponse) : SOAP_EOM; };
virtual int __s0__GetExtStatus(_s0__GetExtStatus *s0__GetExtStatus, _s0__GetExtStatusResponse *s0__GetExtStatusResponse) { return soap ? soap_call___s0__GetExtStatus(soap, endpoint, NULL, s0__GetExtStatus, s0__GetExtStatusResponse) : SOAP_EOM; };
virtual int __s0__Restart(_s0__Restart *s0__Restart, _s0__RestartResponse *s0__RestartResponse) { return soap ? soap_call___s0__Restart(soap, endpoint, NULL, s0__Restart, s0__RestartResponse) : SOAP_EOM; };
virtual int __s0__XttStart(_s0__XttStart *s0__XttStart, _s0__XttStartResponse *s0__XttStartResponse) { return soap ? soap_call___s0__XttStart(soap, endpoint, NULL, s0__XttStart, s0__XttStartResponse) : SOAP_EOM; };
};
#endif
......@@ -355,8 +355,53 @@ public:
};
#endif
#ifndef SOAP_TYPE__s0__XttStart
#define SOAP_TYPE__s0__XttStart (19)
/* s0:XttStart */
class SOAP_CMAC _s0__XttStart
{
public:
std::string *OpPlace; /* optional element of type xsd:string */
std::string *Language; /* optional element of type xsd:string */
std::string *Display; /* optional element of type xsd:string */
std::string *ClientRequestHandle; /* optional attribute */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 19; } /* = unique id SOAP_TYPE__s0__XttStart */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
_s0__XttStart() : OpPlace(NULL), Language(NULL), Display(NULL), ClientRequestHandle(NULL), soap(NULL) { }
virtual ~_s0__XttStart() { }
};
#endif
#ifndef SOAP_TYPE__s0__XttStartResponse
#define SOAP_TYPE__s0__XttStartResponse (20)
/* s0:XttStartResponse */
class SOAP_CMAC _s0__XttStartResponse
{
public:
std::string *ClientRequestHandle; /* optional attribute */
struct soap *soap; /* transient */
public:
virtual int soap_type() const { return 20; } /* = unique id SOAP_TYPE__s0__XttStartResponse */
virtual void soap_default(struct soap*);
virtual void soap_serialize(struct soap*) const;
virtual int soap_put(struct soap*, const char*, const char*) const;
virtual int soap_out(struct soap*, const char*, int, const char*) const;
virtual void *soap_get(struct soap*, const char*, const char*);
virtual void *soap_in(struct soap*, const char*, const char*);
_s0__XttStartResponse() : ClientRequestHandle(NULL), soap(NULL) { }
virtual ~_s0__XttStartResponse() { }
};
#endif
#ifndef SOAP_TYPE___s0__GetStatus
#define SOAP_TYPE___s0__GetStatus (24)
#define SOAP_TYPE___s0__GetStatus (26)
/* Operation wrapper: */
struct __s0__GetStatus
{
......@@ -366,7 +411,7 @@ public:
#endif
#ifndef SOAP_TYPE___s0__GetExtStatus
#define SOAP_TYPE___s0__GetExtStatus (28)
#define SOAP_TYPE___s0__GetExtStatus (30)
/* Operation wrapper: */
struct __s0__GetExtStatus
{
......@@ -376,7 +421,7 @@ public:
#endif
#ifndef SOAP_TYPE___s0__Restart
#define SOAP_TYPE___s0__Restart (32)
#define SOAP_TYPE___s0__Restart (34)
/* Operation wrapper: */
struct __s0__Restart
{
......@@ -385,8 +430,18 @@ public:
};
#endif
#ifndef SOAP_TYPE___s0__XttStart
#define SOAP_TYPE___s0__XttStart (38)
/* Operation wrapper: */
struct __s0__XttStart
{
public:
_s0__XttStart *s0__XttStart; /* optional element of type s0:XttStart */
};
#endif
#ifndef SOAP_TYPE_SOAP_ENV__Header
#define SOAP_TYPE_SOAP_ENV__Header (35)
#define SOAP_TYPE_SOAP_ENV__Header (41)
/* SOAP Header: */
struct SOAP_ENV__Header
{
......@@ -396,7 +451,7 @@ public:
#endif
#ifndef SOAP_TYPE_SOAP_ENV__Code
#define SOAP_TYPE_SOAP_ENV__Code (36)
#define SOAP_TYPE_SOAP_ENV__Code (42)
/* SOAP Fault Code: */
struct SOAP_ENV__Code
{
......@@ -407,7 +462,7 @@ public:
#endif
#ifndef SOAP_TYPE_SOAP_ENV__Detail
#define SOAP_TYPE_SOAP_ENV__Detail (38)
#define SOAP_TYPE_SOAP_ENV__Detail (44)
/* SOAP-ENV:Detail */
struct SOAP_ENV__Detail
{
......@@ -419,7 +474,7 @@ public:
#endif
#ifndef SOAP_TYPE_SOAP_ENV__Reason
#define SOAP_TYPE_SOAP_ENV__Reason (39)
#define SOAP_TYPE_SOAP_ENV__Reason (45)
/* SOAP-ENV:Reason */
struct SOAP_ENV__Reason
{
......@@ -429,7 +484,7 @@ public:
#endif
#ifndef SOAP_TYPE_SOAP_ENV__Fault
#define SOAP_TYPE_SOAP_ENV__Fault (40)
#define SOAP_TYPE_SOAP_ENV__Fault (46)
/* SOAP Fault: */
struct SOAP_ENV__Fault
{
......@@ -497,6 +552,8 @@ SOAP_FMAC5 int SOAP_FMAC6 __s0__GetExtStatus(struct soap*, _s0__GetExtStatus *s0
SOAP_FMAC5 int SOAP_FMAC6 __s0__Restart(struct soap*, _s0__Restart *s0__Restart, _s0__RestartResponse *s0__RestartResponse);
SOAP_FMAC5 int SOAP_FMAC6 __s0__XttStart(struct soap*, _s0__XttStart *s0__XttStart, _s0__XttStartResponse *s0__XttStartResponse);
/******************************************************************************\
* *
* Stubs *
......@@ -510,6 +567,8 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__GetExtStatus(struct soap *soap, const
SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__Restart(struct soap *soap, const char *soap_endpoint, const char *soap_action, _s0__Restart *s0__Restart, _s0__RestartResponse *s0__RestartResponse);
SOAP_FMAC5 int SOAP_FMAC6 soap_call___s0__XttStart(struct soap *soap, const char *soap_endpoint, const char *soap_action, _s0__XttStart *s0__XttStart, _s0__XttStartResponse *s0__XttStartResponse);
/******************************************************************************\
* *
* Skeletons *
......@@ -526,6 +585,8 @@ SOAP_FMAC5 int SOAP_FMAC6 soap_serve___s0__GetExtStatus(struct soap*);
SOAP_FMAC5 int SOAP_FMAC6 soap_serve___s0__Restart(struct soap*);
SOAP_FMAC5 int SOAP_FMAC6 soap_serve___s0__XttStart(struct soap*);
#endif
/* End of statussrv_Stub.h */
/* statussrv_msg.h
Generated by wsdl2h 1.2.9d from statussrv.wsdl and typemap.dat
2007-05-10 13:32:06 GMT
2007-05-21 09:05:43 GMT
Copyright (C) 2001-2006 Robert van Engelen, Genivia Inc. All Rights Reserved.
This part of the software is released under one of the following licenses:
GPL or Genivia's license for commercial use.
......@@ -102,6 +102,12 @@ class _s0__Restart;
// Forward declaration of class _s0__RestartResponse.
class _s0__RestartResponse;
// Forward declaration of class _s0__XttStart.
class _s0__XttStart;
// Forward declaration of class _s0__XttStartResponse.
class _s0__XttStartResponse;
/// Element "http://www.proview.se/webservices/statussrv/1.0/":GetStatus of complexType.
......@@ -450,6 +456,36 @@ class _s0__RestartResponse
struct soap *soap ;
};
/// Element "http://www.proview.se/webservices/statussrv/1.0/":XttStart of complexType.
/// "http://www.proview.se/webservices/statussrv/1.0/":XttStart is a complexType.
class _s0__XttStart
{ public:
/// Element OpPlace of type xs:string.
std::string* OpPlace 0; ///< Optional element.
/// Element Language of type xs:string.
std::string* Language 0; ///< Optional element.
/// Element Display of type xs:string.
std::string* Display 0; ///< Optional element.
/// Attribute ClientRequestHandle of type xs:string.
@std::string* ClientRequestHandle 0; ///< Optional attribute.
/// A handle to the soap struct that manages this instance (automatically set)
struct soap *soap ;
};
/// Element "http://www.proview.se/webservices/statussrv/1.0/":XttStartResponse of complexType.
/// "http://www.proview.se/webservices/statussrv/1.0/":XttStartResponse is a complexType.
class _s0__XttStartResponse
{ public:
/// Attribute ClientRequestHandle of type xs:string.
@std::string* ClientRequestHandle 0; ///< Optional attribute.
/// A handle to the soap struct that manages this instance (automatically set)
struct soap *soap ;
};
/******************************************************************************\
* *
* Services *
......@@ -477,6 +513,7 @@ class _s0__RestartResponse
- @ref __s0__GetStatus
- @ref __s0__GetExtStatus
- @ref __s0__Restart
- @ref __s0__XttStart
@section Service_ports Endpoints of Binding "Service"
......@@ -648,4 +685,57 @@ int __s0__Restart(
_s0__RestartResponse* s0__RestartResponse ///< Response parameter
);
/******************************************************************************\
* *
* __s0__XttStart *
* *
\******************************************************************************/
/// Operation "__s0__XttStart" of service binding "Service"
/**
Operation details:
- SOAP document/literal style
- SOAP action="s0:XttStart"
C stub function (defined in soapClient.c[pp] generated by soapcpp2):
@code
int soap_call___s0__XttStart(
struct soap *soap,
NULL, // char *endpoint = NULL selects default endpoint for this operation
NULL, // char *action = NULL selects default action for this operation
// request parameters:
_s0__XttStart* s0__XttStart,
// response parameters:
_s0__XttStartResponse* s0__XttStartResponse
);
@endcode
C server function (called from the service dispatcher defined in soapServer.c[pp]):
@code
int __s0__XttStart(
struct soap *soap,
// request parameters:
_s0__XttStart* s0__XttStart,
// response parameters:
_s0__XttStartResponse* s0__XttStartResponse
);
@endcode
C++ proxy class (defined in soapServiceProxy.h):
class Service;
*/
//gsoap s0 service method-style: XttStart document
//gsoap s0 service method-encoding: XttStart literal
//gsoap s0 service method-action: XttStart s0:XttStart
int __s0__XttStart(
_s0__XttStart* s0__XttStart, ///< Request parameter
_s0__XttStartResponse* s0__XttStartResponse ///< Response parameter
);
/* End of statussrv_msg.h */
......@@ -343,3 +343,68 @@ pwr_tStatus statussrv_GetExtStatus( char *nodename, statussrv_sGetExtStatus *res
return sts;
}
pwr_tStatus statussrv_Restart( char *nodename)
{
pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80];
if ( !init_done) {
soap_init( &soap);
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nodename, port);
_s0__Restart restart;
_s0__RestartResponse restart_response;
restart.ClientRequestHandle = new std::string("StatusSrv Client");
if ( soap_call___s0__Restart( &soap, endpoint, NULL, &restart, &restart_response) ==
SOAP_OK) {
}
else {
sts = PWR__SRVCONNECTION;
}
soap_destroy( &soap);
soap_end( &soap);
return sts;
}
pwr_tStatus statussrv_XttStart( char *nodename, char *opplace, char *lang, char *display)
{
pwr_tStatus sts = PWR__SUCCESS;
char endpoint[80];
if ( !init_done) {
soap_init( &soap);
init_done = 1;
}
sprintf( endpoint, "http://%s:%d", nodename, port);
_s0__XttStart xtt_start;
_s0__XttStartResponse xtt_start_response;
xtt_start.ClientRequestHandle = new std::string("StatusSrv Client");
if ( opplace && strcmp( opplace, "") != 0)
xtt_start.OpPlace = new std::string(opplace);
if ( lang && strcmp( lang, "") != 0)
xtt_start.Language = new std::string(lang);
if ( display && strcmp( display, "") != 0)
xtt_start.Display = new std::string(display);
if ( soap_call___s0__XttStart( &soap, endpoint, NULL, &xtt_start, &xtt_start_response) ==
SOAP_OK) {
}
else {
sts = PWR__SRVCONNECTION;
}
soap_destroy( &soap);
soap_end( &soap);
return sts;
}
/**
* Proview $Id: statussrv_utl.h,v 1.1 2007-05-11 14:59:19 claes Exp $
* Proview $Id: statussrv_utl.h,v 1.2 2007-05-21 14:20:04 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -53,6 +53,8 @@ typedef struct {
pwr_tStatus statussrv_GetStatus( char *nodename, statussrv_sGetStatus *result);
pwr_tStatus statussrv_GetExtStatus( char *nodename, statussrv_sGetExtStatus *result);
pwr_tStatus statussrv_Restart( char *nodename);
pwr_tStatus statussrv_XttStart( char *nodename, char *opplace, char *lang, char *display);
#ifdef __cplusplus
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment