| Parameter | Description |
|---|---|
| "..." | client to use to access a specific webservice; clients are defined in configure in {SoapPlugin}{Clients}; see the "Configuring Clients" below |
| id="..." | stores the retrieved result under the given ID to be reused in SOAPFORMAT |
| method="..." | remote procedure to be executed on the server side; this is an identifier specific to the service; if not defined defaultMethod is used as specified in the service definition |
| format="..." header="..." footer="..." separator="..." |
these format strings are used to format non-scalar results |
| hidenull="on/off" | if switched on, the empty response or node won't be displayed, that is even head and footer content is omitted |
| raw="on/off" | if switched on, the xml response is returned as is, that is no formatting is applied |
| verbatim="on/off" | this behaves like raw="on" basically but also pretty-prints the output to ease reading the xml and then puts it into a <verbatim> environment to format it as html |
| valueof="..." | xpath expression to filter the output |
| depth="int" | the depth to which an XML response object should be traversed while rendering it using format, header, footer and separator |
| warn="on/off" | if switched off all error warnings will be suppressed (defaults to on) |
| cache="on/off" | toggles caching on or of (default is off) |
| expire="seconds/units" | indicates the time the soap response is reused from cache if available instead of fetching it from the distant endpoint; expire can either be specified numerically in seconds or using a date expression like "10 minutes". Valid units are s, second, seconds, sec, m, minute, minutes, min, h, hour, hours, d, day, days, w, week, weeks, M, month, months, y, year, and years, as well as now and never |
refresh=soap (or refresh=on) url parameter.
Any additional parameter like for example EMPLOYEEID in
%SOAP{"client-id" method="getVacationOfEmployee" EMPLOYEEID="1606"}%
will be passed over to the server and are not interpreted by the SoapPlugin
itself. This also means that any required parameter to a webservice method must
not overlap with those documented above as part of the %SOAP command.
A parameter may contain nested argument structures which are then translated to nested xml structures. For example
%SOAP{
...
STORNO="
STARTDATE=\"20101101\"
ENDDATE=\"20101107\"
"
}%
Will be translated to a call using
<STORNO> <STARTDATE>20101101</STARTDATE> <ENDDATE>20101107</ENDDATE> </STORNO>
| Parameter | Description |
|---|---|
| "..." (or id="...") | this refers to a previous %SOAP call that was stored at the given ID using the id parameter to %SOAP |
| format="..." header="..." footer="..." separator="..." |
these format strings are used to format non-scalar results |
| hidenull="on/off" | if switched on, the empty response or node won't be displayed, that is even head and footer content is omitted |
| raw="on/off" | if switched on, the xml response is returned as is, that is no formatting is applied |
| verbatim="on/off" | this behaves like raw="on" basically but also pretty-prints the output to ease reading the xml and then puts it into a <verbatim> environment to format it as html |
| valueof="..." | xpath expression to filter the output |
| depth="int" | the depth to which an XML response object should be traversed while rendering it using format, header, footer and separator |
%SOAPFORMAT are mostly the same as those for %SOAP
except method. This is not needed as SOAPFORMAT formats the response already
received by accessing the server/method of the previous %SOAP call.
If the node selected by the valueof xpath expression is not a scalar value,
e.g. addresses a node in the xml response which contains further child nodes,
then the result is rendered recursively using format, header, footer and
separator while traversing the xml output.
When visiting a node, the following variables can be used to access its
properties:
$name: (or $key): the name of the node
$value: the value of the node; this expands recursively when the value is not a final child node
$type: the type of the node according to the WSDL definition
$uri: the URI that will be used as the namespace
$prefix: the prefix used when associating the node with a specific namespace
$attr(...): the value of the named attribute
$index: the index of this node in a list of sibling nodes
$depth: the distance from the root node of the contained xml document
$valueof(...): the value of the node as specified by the enclosed xpath expression; note: in contrast to the valueof parameter of the %SOAP/SOAPFORMAT tag itself, this only returns the first matching value
$percnt, $nop, $n and $dollar.
%SOAP{"service-id" ...}%.
Example:
$Foswiki::cfg{SoapPlugin}{Clients} = [
{
id => 'portal',
uri => 'urn:company.com:xi:ess_r2',
proxy => 'http://company.com:50000/XISOAPAdapter/MessageServlet?channel=:Portal:Portal_Webservice',
xmlns => 'urn:sap-com:document:sap:rfc:functions',
user => 'soap_user',
password => 'soap_password',
defautMethod => 'EMPLOYEE_FUNCTION'
},
{
id => 'mockup',
uri => 'urn:company.com:xi:ess_r2',
proxy => 'http://127.0.0.1:8088/mockPortalBinding',
xmlns => 'urn:sap-com:document:sap:rfc:functions',
}
];
This defines two clients that are stored under the IDs portal and mockup. These are then used by a
%SOAP{"portal" method="..."}% or %SOAP{"mockup" method="..."}% statement respectively.
The following list of parameters might be used to configure a service:
| Parameter | Description |
|---|---|
| id => "..." | symbolic name to make use of the connection |
| uri => "..." proxy => "..." xmlns => "..." |
resource specification of the given endpoint definition; please look up the SOAP documentation of that service for more details |
| wsdl => "..." | url of the WSDL definition; either use uri + proxy or wsdl to specifiy a connection |
| defaultMethod => "..." | default method to be used by this client; can be overriden using the method parameter of a %SOAP call |
| user => "..." password =>" |
user name and password in case the webservice is access protected using HTTP credentials |
| namespace => [ "id" => "urn", "id" => "urn", ... ] |
list of namespaces to be defined as part of the protocol; this is a set of extra namespaces that might be used when talking to the SOAP server; most of the time specifying xmlns is enough to defined the default namespace with which methods are called |
foswiki:http//schema.foswiki.org/soap namespace. These are
| Header | Description |
|---|---|
foswiki:wikiName foswiki:loginName |
WikiName? of the user currently logged in triggering the SOAP call |
foswiki:web foswiki.topic |
web and topic from where the SOAP call was issued |
foswiki:isAdmin |
a boolean flag indicating whether the current user is a wiki admin |
configure, then you can still install manually from the command-line. See http://foswiki.org/Support/ManuallyInstallingExtensions for more help.
| Author(s): | Foswiki:Main/MichaelDaum | ||||||||||||
| Copyright: | © 2011 Michael Daum http://michaeldaumconsulting.com | ||||||||||||
| License: | GPL (Gnu General Public License) | ||||||||||||
| Release: | 2.00 | ||||||||||||
| Version: | 11723 (2011-05-18) | ||||||||||||
| Change History: | |||||||||||||
| 18 May 2011: | implemented caching; including a local version of SOAP::Lite with patches applied; removed XML::Parser::Lite from the SOAP::Lite package as it is seriously broken; new dependency on XML::Parser (the real thing) now | ||||||||||||
| 14 Jun 2010: | added warn parameter to suppress error messages; fixed perl rookie error for default values retrieved from a SOM object |
||||||||||||
| 10 May 2010: | added support for nested argument structures | ||||||||||||
| 19 Mar 2010: | rewrite of serializer; implemented $valueof() etc; fixed UTF8 handling |
||||||||||||
| 16 Mar 2010: | initial release | ||||||||||||
| Dependencies: |
|
||||||||||||
| Home page: | Foswiki:Extensions/SoapPlugin | ||||||||||||
| Support: | Foswiki:Support/SoapPlugin |
| ExtensionClassification | Development |
| ExtensionType | PluginPackage |
| DemoUrl | http://michaeldaumconsulting.com |
| SupportUrl | SoapPlugin |
| DevelopedInSVN | Yes |
| ModificationPolicy | CoordinateWithAuthor |
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| |
SoapPlugin.md5 | manage | 0.1 K | 18 May 2011 - 21:18 | MichaelDaum | |
| |
SoapPlugin.sha1 | manage | 0.2 K | 18 May 2011 - 21:18 | MichaelDaum | |
| |
SoapPlugin.tgz | manage | 102.6 K | 18 May 2011 - 21:18 | MichaelDaum | |
| |
SoapPlugin.zip | manage | 121.7 K | 18 May 2011 - 21:18 | MichaelDaum | |
| |
SoapPlugin_installer | manage | 5.1 K | 18 May 2011 - 21:18 | MichaelDaum |
