| 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 |
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.
| 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: | © 2010 Michael Daum http://michaeldaumconsulting.com | ||||||||||||
| License: | GPL (Gnu General Public License) | ||||||||||||
| Release: | 0.5 | ||||||||||||
| Version: | 6790 (2010-03-19) | ||||||||||||
| Change History: | |||||||||||||
| 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 |
| I | Attachment | Action | Size | Date | Who | Comment |
|---|---|---|---|---|---|---|
| |
SoapPlugin.md5 | manage | 0.1 K | 19 Mar 2010 - 20:26 | MichaelDaum | |
| |
SoapPlugin.sha1 | manage | 0.2 K | 19 Mar 2010 - 20:26 | MichaelDaum | |
| |
SoapPlugin.tgz | manage | 9.2 K | 19 Mar 2010 - 20:26 | MichaelDaum | |
| |
SoapPlugin.zip | manage | 13.1 K | 19 Mar 2010 - 20:26 | MichaelDaum | |
| |
SoapPlugin_installer | manage | 4.3 K | 19 Mar 2010 - 20:26 | MichaelDaum |
