#include <WsdlInvoker.h>
Public Member Functions | |
void | setLocation (const std::string &url) |
void | setCredentials (const std::string &user, const std::string &pass) |
void | setAuth (const std::string &user, const std::string &pass) |
std::string | getSoapMessage () |
std::string | getXMLResponse () |
void | setProxy (const std::string &host, int port=80) |
void | setVerbose (bool f) |
void | printTypeNames (bool f) |
std::string | errors () |
bool | status () const |
std::string | getFaultCode () const |
std::string | getFaultSubCode () const |
std::string | getFaultString () const |
std::string | getFaultActor () const |
void | setProcessEnvAndBody (bool p_processEnvAndBody) |
bool | getProcessEnvAndBody (void) const |
void | setLazyRelativeMatch (bool p_lazyRelativeMatch) |
bool | getLazyRelativeMatch (void) const |
void | setBuildXmlTree (bool p_buildXmlTree) |
bool | getBuildXmlTree (void) const |
void | buildXmlTree (XmlPullParser &p_xmlPullParser, XmlNode_t &p_xmlNode, bool p_notScannedEventAvail=false) |
Constructors and Destructors | |
WsdlInvoker (const std::string &url, const std::string &schemaPath="") | |
WsdlInvoker (std::istream &input, const std::string &schemaPath="") | |
WsdlInvoker () | |
~WsdlInvoker () | |
WSDL Inspection | |
bool | setWSDLUri (const std::string &url, const std::string &schemaPath="") |
int | getOperations (std::vector< std::string > &operations) |
return names of operations (only for the SOAP binding portType) | |
std::string | getOpDocumentation (const std::string &n) |
std::string | getDocumentation () |
bool | setOperation (const std::string &operation, WsdlPull::MessageType mType=WsdlPull::Input) |
set the operation to invoke | |
std::string | getServiceEndPoint (const std::string &opname) |
Simple Invocation usage | |
bool | setValue (const std::string ¶m, void *val) |
sets the param value for an operation by name of the parameter | |
bool | setValue (const std::string ¶m, void **values, unsigned int occur) |
sets the param value for an operation by name of the parameter | |
bool | setValue (const std::string ¶m, std::string val) |
sets the param value for an operation by name of the parameter | |
bool | setValue (const std::string ¶m, std::vector< std::string > values) |
sets the param value for an operation by name of the parameter | |
bool | setValue (const std::vector< std::string > &parents, void *val) |
sets the param value for an operation by name of the parameter | |
bool | invoke (long timeout=0, bool processResponse=true) |
void * | getValue (const std::string ¶m, Schema::Type &t) |
template<typename T > | |
T | getValue (const std::string &xpath, size_t p_index=1) |
template<typename T > | |
std::vector< T > | getValues (const std::string &xpath) |
sets the param value for an operation by name of the parameter | |
A more complex but powerful usage | |
int | getNextInput (std::string ¶m, Schema::Type &type, int &minimum, int &maximum) |
int | getNextInput (std::string ¶m, Schema::Type &type, int &minimum, int &maximum, std::vector< std::string > &parents) |
int | getNextHeaderInput (std::string ¶m, Schema::Type &type, int &minimum, int &maximum) |
int | getNextHeaderInput (std::string ¶m, Schema::Type &type, int &minimum, int &maximum, std::vector< std::string > &parents) |
int | nInputHeaders () const |
bool | setInputValue (const int param, void *val) |
bool | setInputValue (const int id, void **values, unsigned int occur) |
bool | setInputValue (const int param, std::string val) |
bool | setInputValue (const int param, std::vector< std::string > values) |
bool | getNextOutput (std::string &name, TypeContainer *&tc) |
TypeContainer * | getOutput (const std::string &name) |
bool | getNextHeaderOutput (std::string &name, TypeContainer *&tc) |
Definition at line 50 of file WsdlInvoker.h.
WsdlPull::WsdlInvoker::WsdlInvoker | ( | const std::string & | url, | |
const std::string & | schemaPath = "" | |||
) |
The default constructor for WsdlInvoker
wsdl | url | |
stream | for logging errors |
Definition at line 121 of file WsdlInvoker.cpp.
WsdlPull::WsdlInvoker::WsdlInvoker | ( | std::istream & | input, | |
const std::string & | schemaPath = "" | |||
) |
The default constructor for WsdlInvoker
wsdl | url | |
stream | for logging errors |
Definition at line 64 of file WsdlInvoker.cpp.
References XmlPullParserException::col, Schema::SchemaParserException::col, WsdlPull::WsdlException::col, XmlPullParserException::description, Schema::SchemaParserException::description, WsdlPull::WsdlException::description, WsdlPull::WsdlParser::END, WsdlPull::WsdlParser::getNextElement(), XmlPullParserException::line, Schema::SchemaParserException::line, WsdlPull::WsdlException::line, and WsdlPull::WsdlParser::status().
WsdlPull::WsdlInvoker::WsdlInvoker | ( | ) |
The default constructor for WsdlInvoker
wsdl | url | |
stream | for logging errors |
Definition at line 40 of file WsdlInvoker.cpp.
WsdlPull::WsdlInvoker::~WsdlInvoker | ( | ) |
The default constructor for WsdlInvoker
wsdl | url | |
stream | for logging errors |
Definition at line 1251 of file WsdlInvoker.cpp.
bool WsdlPull::WsdlInvoker::setWSDLUri | ( | const std::string & | url, | |
const std::string & | schemaPath = "" | |||
) | [inline] |
setWSDLUri set the url of the wsdl file to be processed
url | for the wsdl file | |
optional | path to schema files required to parse wsdl extensions (soap,http) |
Definition at line 383 of file WsdlInvoker.h.
Referenced by main().
int WsdlPull::WsdlInvoker::getOperations | ( | std::vector< std::string > & | operations | ) |
return names of operations (only for the SOAP binding portType)
getOperations
reference | to vector<string> |
Definition at line 245 of file WsdlInvoker.cpp.
Referenced by main().
std::string WsdlPull::WsdlInvoker::getOpDocumentation | ( | const std::string & | n | ) |
setWSDLUri set the url of the wsdl file to be processed
url | for the wsdl file | |
optional | path to schema files required to parse wsdl extensions (soap,http) |
Definition at line 268 of file WsdlInvoker.cpp.
Referenced by main().
std::string WsdlPull::WsdlInvoker::getDocumentation | ( | ) |
setWSDLUri set the url of the wsdl file to be processed
url | for the wsdl file | |
optional | path to schema files required to parse wsdl extensions (soap,http) |
Definition at line 260 of file WsdlInvoker.cpp.
References WsdlPull::WsdlParser::getDocumentation().
bool WsdlPull::WsdlInvoker::setOperation | ( | const std::string & | operation, | |
WsdlPull::MessageType | mType = WsdlPull::Input | |||
) |
set the operation to invoke
setOperation
operation | name to invoke |
Definition at line 282 of file WsdlInvoker.cpp.
Referenced by main().
std::string WsdlPull::WsdlInvoker::getServiceEndPoint | ( | const std::string & | opname | ) |
getServiceEndPoint returns the url to be invoked for the operation
Definition at line 311 of file WsdlInvoker.cpp.
bool WsdlPull::WsdlInvoker::setValue | ( | const std::string & | param, | |
void * | val | |||
) |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
Definition at line 921 of file WsdlInvoker.cpp.
References setInputValue().
bool WsdlPull::WsdlInvoker::setValue | ( | const std::string & | param, | |
void ** | values, | |||
unsigned int | occur | |||
) |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
Definition at line 932 of file WsdlInvoker.cpp.
References setInputValue().
bool WsdlPull::WsdlInvoker::setValue | ( | const std::string & | param, | |
std::string | val | |||
) |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
Definition at line 944 of file WsdlInvoker.cpp.
References setInputValue().
bool WsdlPull::WsdlInvoker::setValue | ( | const std::string & | param, | |
std::vector< std::string > | values | |||
) |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
Definition at line 955 of file WsdlInvoker.cpp.
References setInputValue().
bool WsdlPull::WsdlInvoker::setValue | ( | const std::vector< std::string > & | parents, | |
void * | val | |||
) |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
bool WsdlPull::WsdlInvoker::invoke | ( | long | timeout = 0 , |
|
bool | processResponse = true | |||
) |
invoke invoke the web service operation
timeout | set the timeout for the request in seconds |
Definition at line 983 of file WsdlInvoker.cpp.
References XmlSerializer::attribute(), buildXmlTree(), XmlDoc_t::clear(), XmlPullParserException::col, Schema::SchemaParserException::col, WsdlPull::WsdlException::col, XmlPullParserException::description, Schema::SchemaParserException::description, WsdlPull::WsdlException::description, XmlSerializer::endTag(), FEATURE_PROCESS_NAMESPACES, XmlSerializer::flush(), WsdlPull::Soap::getEncodingUri(), WsdlPull::Soap::getEnvelopeUri(), WsdlPull::Operation::getMessage(), WsdlPull::WsdlElement::getName(), XmlDoc_t::getRootNode(), XmlPullParserException::line, Schema::SchemaParserException::line, WsdlPull::WsdlException::line, WsdlPull::Output, XmlPullParser::require(), WsdlPull::Soap::RPC, Schema::SchemaInstaceUri, Schema::SchemaUri, XmlPullParser::setFeature(), XmlSerializer::setPrefix(), XmlPullParser::START_DOCUMENT, XmlSerializer::startDocument(), and XmlSerializer::startTag().
Referenced by getSoapMessage(), and main().
void * WsdlPull::WsdlInvoker::getValue | ( | const std::string & | param, | |
Schema::Type & | t | |||
) |
getValue return the value of the output whose name is 'param'
type | is set by reference to enable type casting in client code |
Definition at line 1332 of file WsdlInvoker.cpp.
T WsdlPull::WsdlInvoker::getValue | ( | const std::string & | xpath, | |
size_t | p_index = 1 | |||
) | [inline] |
getValue return the value based on an xpath like expression
xpath | - the xpath expression or an element name which leads to a simple type element or attribute if it points to a simple type element,the element's text is returned, if it points to the attribute the attribute is returned |
/login/result/header/errorCode -> will do an absolute from the root node result/header/errorCode -> will do a relative match starting with "result" result//errorCode -> will return all "errorCode" under "result" //errorCode will return all "errorCode" from the root node result/ -> will return attribute value of type for element result
p_index | - default value "1". Return the conten stored in the "Nth" node when several nodes that would match the xpath expression are found. It starts at "1" to comply with W3C Xpath standards A value of "0" would return the content of ll matching nodes, but this function does only return one "content" |
Definition at line 448 of file WsdlInvoker.h.
std::vector< T > WsdlPull::WsdlInvoker::getValues | ( | const std::string & | xpath | ) | [inline] |
sets the param value for an operation by name of the parameter
setValue
name | of the operation's parameter | |
string/void* | representation of the parameter |
Definition at line 469 of file WsdlInvoker.h.
Referenced by main().
int WsdlPull::WsdlInvoker::getNextInput | ( | std::string & | param, | |
Schema::Type & | type, | |||
int & | minimum, | |||
int & | maximum | |||
) |
getNextInput Calling this method repeatedly informs the caller of the input types the web service operation expects. Each call returns a unique id which must be used while setting the value using setInputValue.This method exposes only atomic types.Even if a web service needs a complex type,the api exposes only the constituent particles.The only exception is when a complex content model needs multiple occurrences which is still a TODO
ref:param | name Name of the param | |
ref:Schema::Type,the | schema type | |
ref,: | minimum and maximum (occurrences) | |
ref:parents,parent | list of type hierarchy for this parameter. |
Definition at line 1119 of file WsdlInvoker.cpp.
Referenced by main().
int WsdlPull::WsdlInvoker::getNextInput | ( | std::string & | param, | |
Schema::Type & | type, | |||
int & | minimum, | |||
int & | maximum, | |||
std::vector< std::string > & | parents | |||
) |
getNextInput Calling this method repeatedly informs the caller of the input types the web service operation expects. Each call returns a unique id which must be used while setting the value using setInputValue.This method exposes only atomic types.Even if a web service needs a complex type,the api exposes only the constituent particles.The only exception is when a complex content model needs multiple occurrences which is still a TODO
ref:param | name Name of the param | |
ref:Schema::Type,the | schema type | |
ref,: | minimum and maximum (occurrences) | |
ref:parents,parent | list of type hierarchy for this parameter. |
Definition at line 1126 of file WsdlInvoker.cpp.
int WsdlPull::WsdlInvoker::getNextHeaderInput | ( | std::string & | param, | |
Schema::Type & | type, | |||
int & | minimum, | |||
int & | maximum | |||
) |
getNextHeaderInput Similar to the previous method except that it gets the SOAP headers if any Set methods are same as for regular inputs
Definition at line 1144 of file WsdlInvoker.cpp.
Referenced by main().
int WsdlPull::WsdlInvoker::getNextHeaderInput | ( | std::string & | param, | |
Schema::Type & | type, | |||
int & | minimum, | |||
int & | maximum, | |||
std::vector< std::string > & | parents | |||
) |
getNextInput Calling this method repeatedly informs the caller of the input types the web service operation expects. Each call returns a unique id which must be used while setting the value using setInputValue.This method exposes only atomic types.Even if a web service needs a complex type,the api exposes only the constituent particles.The only exception is when a complex content model needs multiple occurrences which is still a TODO
ref:param | name Name of the param | |
ref:Schema::Type,the | schema type | |
ref,: | minimum and maximum (occurrences) | |
ref:parents,parent | list of type hierarchy for this parameter. |
Definition at line 1153 of file WsdlInvoker.cpp.
int WsdlPull::WsdlInvoker::nInputHeaders | ( | ) | const [inline] |
returns the number of input headers you may need to set
Definition at line 412 of file WsdlInvoker.h.
Referenced by main().
bool WsdlPull::WsdlInvoker::setInputValue | ( | const int | param, | |
void * | val | |||
) |
setInputValue sets the param value for an operation only simple types can be set.
id | return by getNextInput() | |
void | ** pointer to array of pointers to the the values |
Definition at line 887 of file WsdlInvoker.cpp.
References Schema::XSDType::getContentModel(), Schema::ComplexType::getContentType(), Schema::SchemaParser::getType(), Schema::XSDType::isSimple(), Schema::TypeContainer::isValueValid(), Schema::TypeContainer::print(), Schema::Simple, and Schema::SchemaValidator::validate().
Referenced by main(), and setValue().
bool WsdlPull::WsdlInvoker::setInputValue | ( | const int | id, | |
void ** | values, | |||
unsigned int | occur | |||
) |
getNextInput Calling this method repeatedly informs the caller of the input types the web service operation expects. Each call returns a unique id which must be used while setting the value using setInputValue.This method exposes only atomic types.Even if a web service needs a complex type,the api exposes only the constituent particles.The only exception is when a complex content model needs multiple occurrences which is still a TODO
ref:param | name Name of the param | |
ref:Schema::Type,the | schema type | |
ref,: | minimum and maximum (occurrences) | |
ref:parents,parent | list of type hierarchy for this parameter. |
Definition at line 794 of file WsdlInvoker.cpp.
References Schema::TypeContainer::isValueValid(), Schema::TypeContainer::print(), and Schema::SchemaValidator::validate().
bool WsdlPull::WsdlInvoker::setInputValue | ( | const int | param, | |
std::string | val | |||
) |
setInputValue sets the param value for an operation only simple types can be set.
id | return by getNextInput() | |
string | representation of the parameter |
Definition at line 850 of file WsdlInvoker.cpp.
References Schema::XSDType::getContentModel(), Schema::ComplexType::getContentType(), Schema::SchemaParser::getType(), Schema::XSDType::isSimple(), Schema::TypeContainer::isValueValid(), Schema::Simple, and Schema::SchemaValidator::validate().
bool WsdlPull::WsdlInvoker::setInputValue | ( | const int | param, | |
std::vector< std::string > | values | |||
) |
getNextInput Calling this method repeatedly informs the caller of the input types the web service operation expects. Each call returns a unique id which must be used while setting the value using setInputValue.This method exposes only atomic types.Even if a web service needs a complex type,the api exposes only the constituent particles.The only exception is when a complex content model needs multiple occurrences which is still a TODO
ref:param | name Name of the param | |
ref:Schema::Type,the | schema type | |
ref,: | minimum and maximum (occurrences) | |
ref:parents,parent | list of type hierarchy for this parameter. |
Definition at line 822 of file WsdlInvoker.cpp.
References Schema::TypeContainer::isValueValid(), and Schema::SchemaValidator::validate().
bool WsdlPull::WsdlInvoker::getNextOutput | ( | std::string & | name, | |
TypeContainer *& | tc | |||
) |
getNextOutput get the part/elem name and type container
Definition at line 1290 of file WsdlInvoker.cpp.
Referenced by main().
TypeContainer * WsdlPull::WsdlInvoker::getOutput | ( | const std::string & | name | ) |
getOutput return the type container which stores the output for the output part/elem name
Definition at line 1305 of file WsdlInvoker.cpp.
bool WsdlPull::WsdlInvoker::getNextHeaderOutput | ( | std::string & | name, | |
TypeContainer *& | tc | |||
) |
getNextHeaderOutput get the type container which stores the SOAP header
Definition at line 1316 of file WsdlInvoker.cpp.
Referenced by main().
void WsdlPull::WsdlInvoker::setLocation | ( | const std::string & | url | ) | [inline] |
Definition at line 398 of file WsdlInvoker.h.
void WsdlPull::WsdlInvoker::setCredentials | ( | const std::string & | user, | |
const std::string & | pass | |||
) |
Definition at line 1970 of file WsdlInvoker.cpp.
References setProxy(), XmlUtils::setProxyPass(), and XmlUtils::setProxyUser().
void WsdlPull::WsdlInvoker::setAuth | ( | const std::string & | user, | |
const std::string & | pass | |||
) |
Definition at line 2017 of file WsdlInvoker.cpp.
std::string WsdlPull::WsdlInvoker::getSoapMessage | ( | ) |
std::string WsdlPull::WsdlInvoker::getXMLResponse | ( | ) |
Definition at line 976 of file WsdlInvoker.cpp.
void WsdlPull::WsdlInvoker::setProxy | ( | const std::string & | host, | |
int | port = 80 | |||
) |
Definition at line 2025 of file WsdlInvoker.cpp.
References XmlUtils::setProxyHost().
Referenced by setCredentials().
void WsdlPull::WsdlInvoker::setVerbose | ( | bool | f | ) | [inline] |
Definition at line 405 of file WsdlInvoker.h.
Referenced by main().
void WsdlPull::WsdlInvoker::printTypeNames | ( | bool | f | ) |
Definition at line 1676 of file WsdlInvoker.cpp.
Referenced by main().
std::string WsdlPull::WsdlInvoker::errors | ( | ) | [inline] |
Definition at line 376 of file WsdlInvoker.h.
Referenced by main().
bool WsdlPull::WsdlInvoker::status | ( | ) | const [inline] |
Definition at line 391 of file WsdlInvoker.h.
Referenced by main().
std::string WsdlPull::WsdlInvoker::getFaultCode | ( | ) | const [inline] |
Definition at line 419 of file WsdlInvoker.h.
std::string WsdlPull::WsdlInvoker::getFaultSubCode | ( | ) | const [inline] |
Definition at line 426 of file WsdlInvoker.h.
std::string WsdlPull::WsdlInvoker::getFaultString | ( | ) | const [inline] |
Definition at line 433 of file WsdlInvoker.h.
std::string WsdlPull::WsdlInvoker::getFaultActor | ( | ) | const [inline] |
Definition at line 440 of file WsdlInvoker.h.
void WsdlPull::WsdlInvoker::setProcessEnvAndBody | ( | bool | p_processEnvAndBody | ) |
Definition at line 1992 of file WsdlInvoker.cpp.
References XmlDoc_t::setProcessEnvAndBody().
bool WsdlPull::WsdlInvoker::getProcessEnvAndBody | ( | void | ) | const |
Definition at line 1998 of file WsdlInvoker.cpp.
References XmlDoc_t::getProcessEnvAndBody().
void WsdlPull::WsdlInvoker::setLazyRelativeMatch | ( | bool | p_lazyRelativeMatch | ) |
Definition at line 2004 of file WsdlInvoker.cpp.
References XmlDoc_t::setLazyRelativeMatch().
bool WsdlPull::WsdlInvoker::getLazyRelativeMatch | ( | void | ) | const |
Definition at line 2010 of file WsdlInvoker.cpp.
References XmlDoc_t::getLazyRelativeMatch().
void WsdlPull::WsdlInvoker::setBuildXmlTree | ( | bool | p_buildXmlTree | ) |
Definition at line 1980 of file WsdlInvoker.cpp.
bool WsdlPull::WsdlInvoker::getBuildXmlTree | ( | void | ) | const |
Definition at line 1986 of file WsdlInvoker.cpp.
void WsdlPull::WsdlInvoker::buildXmlTree | ( | XmlPullParser & | p_xmlPullParser, | |
XmlNode_t & | p_xmlNode, | |||
bool | p_notScannedEventAvail = false | |||
) |
Definition at line 1683 of file WsdlInvoker.cpp.
References XmlNode_t::addAttribute(), XmlNode_t::addNode(), XmlNode_t::empty(), XmlNode_t::EMPTY_NODE, XmlPullParser::END_DOCUMENT, XmlPullParser::END_TAG, XmlPullParser::ENTITY_REF, XmlPullParser::getAttributeCount(), XmlPullParser::getAttributeName(), XmlPullParser::getAttributeValue(), XmlPullParser::getEventType(), XmlPullParser::getName(), XmlPullParser::getText(), XmlPullParser::nextToken(), XmlNode_t::NON_EMPTY_NODE, XmlNode_t::setName(), XmlNode_t::setText(), XmlPullParser::START_TAG, and XmlPullParser::TEXT.
Referenced by invoke().