1 soap.call
To perform a petition to a SOAP service from XSQL-Script, the function soap.call should be used. This function is independent of the language of programming of the SOAP server. Each SOAP server has its own specifications.
The tag soap.call allows to perform a petition to a SOAP server. The attributes makes reference to the service and the arguments conform the body of the petition. The arguments can be:
envelope, to specify parameters of the "envelope" of the SOAP message, for example namespce.
<envelope> <namespace prefix="con" uri="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/ConsultaLR.xsd" /> <namespace prefix="sum" uri="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroInformacion.xsd" /> </envelope>
header, to specify the elements in a possible SOAPHeader.
<header> <dom.createElement> <element name='AuthHeader'> <attributes> <attribute name='xmlns' value='http://tempuri.org/testWS/helloworld' /> </attributes> <elements> <element name='Username'> <value><username /></value> </element> <element name='Password'> <value><password /></value> </element> </elements> </element> </dom.createElement> </header>
mappings, to indicate the deserializers (converters) of types.
<mappings> <mapping namespace='http://tempuri.org/testWS/helloworld' type='HelloWorldResult' deserializer='String'> </mapping> </mappings>
parameters, to specify arguments of a call to a method.
<parameters> <parameter name='database'>demo_sports1</parameter> <parameter name='objcode'>cbal_a_sal_p_nivel</parameter> <parameter name='cond'><a_string/></parameter> </parameters>
1.1 Modo HTTPS/SSL
When calls are made by HTTPS protocol is necessary to provide from the client (who makes the call) of the public key of the server certificate where the connection is performed. An example of a simple call which performs a SELECT to the database.
<xsql-script name='soap_call'> <body> <println> <soap.call url='https://theserver.domain.com/soap/servlet/rpcrouter' uri='urn:SOAPSQLServer' method='executeQuery' user='myuser' password='mypassword' encoding='NS_URI_SOAP_ENC' > <parameters> <parameter name='dbms'>acme</parameter> <parameter name='stmt'>SELECT * FROM cdiarios WHERE codigo = 'AA'</parameter> </parameters> </soap.call> </println> </body> </xsql-script>
Otherwise, if it is not provided the certificate it will produce the following error unable to find valid certification.
msg=Error SSL connecting to theserver.domain.com:443: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target; targetException=javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
Notas
In the following document you can found more related information.
1.2 The serialization and deserialization of data
When a call is performed to a SOAP service, the parameters are serialized according to the data type which is provided. For example, if a parameter is a string, it is serialized as string in the call to the SOAP service. In the same way, when an answer is received, the data can be deserialized to the appropriated type to the XSQL-Script language.
It is called serialization to the process to convert a type of our system to a SOAP type to be transported in XML. Deserialization is called to the process of convert a SOAP type to a type of our system.
The XSQL-Script language performs automatically the appropriate conversions for the data types as shown in the attached table, both in calls (serialization) and in responses (deserialization). Some however can not be automatic and they requires that the programmer perform the appropriate operation.
XSQL | Java | SOAP | SOAP serializer | Serialization type | XSQL2SOAP (serializer) | SOAP2XSQL (deserializer) |
---|---|---|---|---|---|---|
string | String | xsd:string | builtin | auto | String | String |
boolean | Boolean | xsd:boolean | builtin | auto | Boolean | Boolean |
smallint | Short | xsd:short | builtin | auto | Short | Short |
integer | Integer | xsd:int | builtin | auto | Integer | Integer |
long | Long | xsd:long | builtin | auto | Long | Long |
float | Float | xsd:float | builtin | auto | Float | Float |
double | Double | xsd:double | builtin | auto | String | String |
decimal | BigDecimal | xsd:decimal | builtin | auto | BigDecimal | BigDecimal |
date | Date | xsd:date | builtin | auto | Date | Date |
N/A | GregorianCalendar | xsd:timeInstant | CalendarSerializer | manual | <date.toCalendar> | Date |
array | ArrayList | SOAP-ENC:Array | ArraySerializer | auto | Object[] | ArrayList |
map | HashMap | Map | MapSerializer | auto | HashMap | HashMap |
(map) | Hashtable | Map | HashtableSerializer | manual | <map.toHashtable> | HashMap |
(array) | Vector | Vector | VectorSerializer | manual | <array.toVector> | ArrayList |
(struct) | Arbitrary Javan Bean | User-defined Qname | xsql.DynamicBeanSerializer | auto | N/A | xsql.Struct |
Notas
The XSQL types between parenthesis imply that as such they do not exist in the language. The Vector type does not exist as such in XSQL however is perfectly mppeable to an array. In the same way, the Hshtable object is mapeable to a map (HashMap). And an EJB (Java Bean) is emulable with a XSQL structure.
We can deduce from the previous table that for example, a XSQL array will be automatically converted to a Object[] in a call to a SOAP service. Otherwise, a SOAP array (Object[]) received in a response will be automatically converted in a XSQL array. If it is necessary to pass a Vector to a SOAP call, it should be used the conversion tag of array to vector, <array.toVector> .
In the case of the map type (HashMap), it has a similar behavior. If a map is passed to a call, this is automatically serialized. Otherwise, if you want to send a Hashtable it will be necessary to convert our map in a Hashtable through the tag <map.toHashtable> .
1.3 The deserialization of responses (mapping)
A very important feature is to understand how the response of the SOAP service will be obtained. Usually, the responses of the SOAP servers can be divided in three categories.
1.3.1 Responses in XML without serialization
In many cases a SOAP server provides a XML response without specific type. In this cases, an object
of the type org.w3c.dom.Element is received and it can be processed as a XML object through the package dom.
The SOAP services of Axional Studio
uses this mechanism giving that a response to a query,
it does not have a form known a priori. It means, the resulting data structure is not known until the process
has been performed. In this cases, it is not necessary to indicate any mapping element.
1.3.2 Responses with simple objects of direct serialization
When a SOAP server returns an object which is serializable to a Java type, the mapping option allows to perform the convertion to the equivalent Java type. It is the case of thew responses which are convertibles to types as string, integer, double, etc.
1.3.3 Responses with complex objects of serialization through EJB
In some cases, a SOAP server has as response a structure which is not directly serializable to a Java object. In this cases, the XSQL language offers two possibilities.
Obtain the root element of the response and the XML fragment which corresponds to the return block of the response body. For this, the special deserializer RAWXML must be used.
Obtain an image of the complex object in a structure. For this, it is enough to indicate in the mapping, the resulting data type but you should not specify the deserializer for those which are complex types. The server will create a structure equivalent to the response. The members of the structure would correspond with the response tags. This mechanism emulates the dynamic creation of an EJB Java in runtime and offers the maximum flexibility for the treatment of complex responses.
1.3.4 Responses with objects SOAPSQLCABean and SOAPSQLResultSetBean
The services SOAPSQLServer
and SOAPSQCServer
returns objects type SOAPSQLCABean
and SOAPSQLResultSetBean
.
To simplify the programming, the objects SOAPSQLResultSetBean
are directly converted to ResultSet
by the TAG.
Otherwise, when an object type SOAPSQLResultSetBean
is received it will return:
- ResultSet: when the object sqlca contains a ResulSet.
- long: when the object sqlca contains a serial result of the execution.
- int: when the object sqlca contains the count of the execution.
1.4 Label soap.call
The tag soap.call allows to perform a petition to a SOAP server.
<struct
url='url'
uri='uri'
method='method'
action='action'
encoding='NS_URI_LITERAL_XML|NS_URI_SOAP_ENC'
keyStoreFile='keyStoreFile'
keyStorePassword='keyStorePassword'
user='user'
password='password'
proxyHost='proxyHost'
proxyPort='proxyPort'
proxyUserName='proxyUserName'
proxyPassword='proxyPassword'
documentLiteralSerialization='true|false'
timeout='timeout'
sendGzip='true|false'
acceptGzip='true|false'
>
<http-headers> *
<header name='name'> +
<value /> !
</header>
</http-headers>
<envelope> ?
<namespace
prefix='prefix'
uri='uri'
/> +
</envelope>
<header /> *
<mappings> *
<mapping
encoding='encoding'
namespace='namespace'
type='type'
deserializer='deserializer'
/> +
</mappings>
<parameters> *
<parameter name='name'> *
<value /> !
</parameter>
</parameters>
</struct>
Attributes | |||||
---|---|---|---|---|---|
Name | Type | Required | Default | Description | |
Aurl | String | Internet address of the SOAP server. | |||
Auri | String | Identifier of the web server. | |||
Amethod | String | Name of the function to execute. | |||
Aaction | String | Indicate the value for the attribute of header SOAPAction. | |||
Aencoding | String | NS_URI_LITERAL_XML | Indicate the method of encoding for the XML document. | ||
AkeyStoreFile | String | URI access to a KJS keystore whose first certificate will be used to try to perform login by certificate in the SOAP server. | |||
AkeyStorePassword | String | Password to use to open the keystore defined in the keyStoreFile parameter. | |||
Auser | String | Username valid to initiate session. | |||
Apassword | String | Password associated. | |||
AproxyHost | String | Name of the proxy local server. | |||
AproxyPort | String | Port number of the proxy local server. | |||
AproxyUserName | String | Username of the proxy local server. | |||
AproxyPassword | String | User password of the proxy local server. | |||
AdocumentLiteralSerialization | Boolean | false | Fix if the styles in the document and the literals are used in the serialization. In the case of true, remove the attributes xsi:type and SOAP-ENV:encodingStyle. | ||
Atimeout | Integer | Maximum waiting time to have a response in milliseconds. | |||
AsendGzip | Boolean | true | Indicate if the petition is sent compressed (by default yes). | ||
AacceptGzip | Boolean | true | Indicate if the response is accepted compressed by the client (by default is indicated yes). |
Arguments | |||||
---|---|---|---|---|---|
Name | Type | Required | Unique | Nullable | Description |
Ehttp-headers | One or more parameters which are added to the HTTP header. | ||||
Eheader | A parameter. | ||||
Aname | String | Name of the parameter. | |||
Evalue | |||||
Eenvelope | Parameters of definition of the feature "Envelope" of the SOAP message. | ||||
Enamespace | Definition of name space for the "Envelope". | ||||
Aprefix | String | Prefix of the name space. | |||
Auri | String | URI of the name space. | |||
Eheader | One or more org.w3c.dom.Element which specifies the tree of header. | ||||
Emappings | |||||
Emapping | |||||
Aencoding | String | Type of encoding to use as for example 'http://schemas.xmlsoap.org/soap/encoding/'. | |||
Anamespace | String | Namespace, for example 'http://tempuri.org/testWS/helloworld'. | |||
Atype | String | For example 'HelloWorldResult'. | |||
Adeserializer | String |
The types mark with (*) are not admitted. |
|||
Eparameters | One or more parameters. | ||||
Eparameter | A parameter. | ||||
Aname | String | Name of the parameter. | |||
Evalue |
Returns | |
---|---|
Type | Description |
file | The response to a SOAP petition consist in a XML document. |
Authentication compatibility
In Tomcat servers should be used the modifier "password-digest-disabled='true'" in SOAP executions against servers which does not implement the algorithm DIGEST itself. In this way, with this modifier will be possible the interaction with Jetty servers which runs the SOAP service with BASIC athentication exclusively.
Exceptions
null data not valid for soap call argument
attribute 'url' required
The address of the SOAP server has not been specified.
attribute 'uri' required
The identifier of the web service has not been indicated.
attribute 'method' required
The operation to execute has not been informed.
Remarks
Exist tecnologies which allows the development of distributed information systems, as CORBA (Common Object Request Broker Arquitecture) of OMG (Object ManagementGroup) or COM (Common Object Model) of Microsoft. Each one provides a framework for the remote petition of objects, the interoperability between the two is complex. CORBA is a specification which has been implemented by various manufacturers, as SUN Microsystems ans its Java RMI (Remote Method Invocation), while COM is very attached to operative systems and programming languagues of Microsoft. At this point is where it arises the need to develop a standard protocol which allows to use objects remotly and it must be independent of the programming language.
DEISTER SOFTWAREdispose of two SOAP services: SOAPSQLServer which allows to execute SQL sentences, and SOAPOBJServer which offers the possibility of execute SQL objects. To obtain more information about this services you can consult the documentation of the section SOAP Programming.
See also
Common Object Request Broker Arquitecture www.corba.org
Java Remote Method Invocation java.sun.com/products/jdk/rmi
Call to the National Digital Forecast Database XML/SOAP Service - NOAA's.
<xsql-script> <body> <println> <soap.call url='http://graphical.weather.gov/xml/SOAP_server/ndfdXMLserver.php' uri='NDFDgenByDay' soapAction="http://graphical.weather.gov/xml/DWMLgen/wsdl/ndfdXML.wsdl#NDFDgenByDay" method='NDFDgenByDay' sendGzip='false' acceptGzip='false' > <parameters> <parameter name='latitude'>38.99</parameter> <parameter name='longitude'>-77.99</parameter> <parameter name='startTime' type='xsd:dateTime'>2015-02-24T09:00:00</parameter> <parameter name='numDays'>7</parameter> <parameter name='unit'>0</parameter> <parameter name='format'>24 hourly</parameter> </parameters> </soap.call> </println> </body> </xsql-script> Executing the request, you will obatin a response similar to: <?xml version='1.0' ?> <dwml version='1.0' xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.nws.noaa.gov/forecasts/xml/DWMLgen/schema/DWML.xsd"> <head> <product concise-name="dwmlByDay" operational-mode="developmental"> <title>NOAAs National Weather Service Forecast by 24 Hour period</title> <field>meteorological</field> <category>forecast</category> <creation-date refresh-frequency='PT1H'>2006-07-05T08:32:54Z</creation-date> </product> <source> <more-information>http://www.nws.noaa.gov/forecasts/xml/</more-information> <production-center>Meteorological Development Laboratory <sub-center>Product Generation Branch</sub-center></production-center> <disclaimer>http://www.nws.noaa.gov/disclaimer.html</disclaimer> <credit>http://www.weather.gov/</credit> <credit-logo>http://www.weather.gov/images/xml_logo.gif</credit-logo> <feedback>http://www.weather.gov/survey/nws-survey.php?code=xmlsoap</feedback> </source> </head> <data> <location> <location-key>point1</location-key> <point latitude="38.99" longitude="-77.99" /> </location> <time-layout time-coordinate="local" summarization="24hourly"> <layout-key>k-p24h-n7-1</layout-key> <start-valid-time>2006-07-05T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-06T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-06T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-07T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-07T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-08T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-08T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-09T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-09T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-10T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-10T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-11T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-11T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-12T06:00:00-04:00</end-valid-time> </time-layout> <time-layout time-coordinate="local" summarization="12hourly"> <layout-key>k-p12h-n14-2</layout-key> <start-valid-time>2006-07-04T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-05T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-05T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-05T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-05T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-06T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-06T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-06T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-06T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-07T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-07T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-07T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-07T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-08T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-08T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-08T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-08T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-09T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-09T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-09T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-09T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-10T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-10T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-10T18:00:00-04:00</end-valid-time> <start-valid-time>2006-07-10T18:00:00-04:00</start-valid-time> <end-valid-time>2006-07-11T06:00:00-04:00</end-valid-time> <start-valid-time>2006-07-11T06:00:00-04:00</start-valid-time> <end-valid-time>2006-07-11T18:00:00-04:00</end-valid-time> </time-layout> <parameters applicable-location="point1"> <temperature type='maximum' units="Fahrenheit" time-layout="k-p24h-n7-1"> <name>Daily Maximum Temperature</name> <value>78</value> <value>77</value> <value>79</value> <value>82</value> <value>82</value> <value>83</value> <value>82</value> </temperature> <temperature type='minimum' units="Fahrenheit" time-layout="k-p24h-n7-1"> <name>Daily Minimum Temperature</name> <value>58</value> <value>58</value> <value>58</value> <value>60</value> <value>61</value> <value>64</value> <value xsi:nil="true" /> </temperature> <probability-of-precipitation type='12 hour' units="percent" time-layout="k-p12h-n14-2"> <name>12 Hourly Probability of Precipitation</name> <value>50</value> <value>70</value> <value>55</value> <value>24</value> <value>12</value> <value>8</value> <value>8</value> <value>6</value> <value>10</value> <value>10</value> <value>10</value> <value>10</value> <value>12</value> <value>12</value> </probability-of-precipitation> <weather time-layout="k-p24h-n7-1"> <name>Weather Type, Coverage, and Intensity</name> <weather-conditions weather-summary="Rain Showers Likely"> <value coverage="likely" intensity="none" weather-type="thunderstorms" qualifier="none"> </value> <value coverage="likely" intensity="light" additive="and" weather-type="rain showers" qualifier="none"> </value> </weather-conditions> <weather-conditions weather-summary="Chance Rain Showers"> <value coverage="slight chance" intensity="none" weather-type="thunderstorms" qualifier="none"> </value> <value coverage="slight chance" intensity="light" additive="and" weather-type="rain showers" qualifier="none"> </value> </weather-conditions> <weather-conditions weather-summary="Mostly Sunny"> </weather-conditions> <weather-conditions weather-summary="Mostly Sunny"> </weather-conditions> <weather-conditions weather-summary="Mostly Sunny"> </weather-conditions> <weather-conditions weather-summary="Partly Cloudy"> </weather-conditions> <weather-conditions weather-summary="Partly Cloudy"> </weather-conditions> </weather> <conditions-icon type="forecast-NWS" time-layout="k-p24h-n7-1"> <name>Conditions Icons</name> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/hi_shwrs70.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/shra60.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/few.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/few.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/few.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/sct.jpg</icon-link> <icon-link>http://www.nws.noaa.gov/weather/images/fcicons/sct.jpg</icon-link> </conditions-icon> </parameters> </data> </dwml>
Notas
In the example code it is invoked the method NDFDgenByDay of the SOAP server of the National Weather Service (NWS) of the National Oceanic and Atmospheric Administration (NOAA) of the United States. The result is a XML document with weather information. Since a server can offer different WebServices, composed each one of several functions , with the attribute uri you should specify the identifier of the service. You should observe how the request does not require user authentication (attributes user and password), and that the names and the values of the differents input parameters are determined by the signature of the remote method. It is important how the SOAP communication is independent of the programming language, because the client process is writted in XSQL-Script and the function which you pretent execute is programed in PHP.
Call the service GoogleSearch (respuesta XML).
<println> <soap.call url='http://api.google.com/search/beta2' uri='urn:GoogleSearch' method='doGoogleSearch' encoding='NS_URI_SOAP_ENC' > <mappings> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='GoogleSearchResult' deserializer='RAWXML' /> </mappings> <parameters> <parameter name='key'><string>NEED YOU GOOGLE KEY HERE</string></parameter> <parameter name='q'><string>barcelona</string></parameter> <parameter name='start'><number type='integer'>0</number></parameter> <parameter name='maxResults'><number type='integer'>10</number></parameter> <parameter name='filter'><true/></parameter> <parameter name='restrict'><string/></parameter> <parameter name='safeSearch'><false/></parameter> <parameter name='lr'><string /></parameter> <parameter name='ie'><string>latin1</string></parameter> <parameter name='oe'><string>latin1</string></parameter> </parameters> </soap.call> </println>
Notas
The example is based in the wsdl which can be found in google. It is observed that a special deserialized which allows to obtain the XML of the google server response is used. This is installed in the root element of the GoogleSearch service response, GoogleSearchResult.
Call to the GoogleSearch Service (response in XSQL struct).
<set name='ret'> <soap.call url='http://api.google.com/search/beta2' uri='urn:GoogleSearch' method='doGoogleSearch' encoding='NS_URI_SOAP_ENC' > <mappings> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='GoogleSearchResult' /> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='DirectoryCategory' /> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='ResultElement' /> </mappings> <parameters> <parameter name='key'><string>NEEDS YOUR GOOGLE KEY HERE</string></parameter> <parameter name='q'><string>barcelona</string></parameter> <parameter name='start'><number type='integer'>0</number></parameter> <parameter name='maxResults'><number type='integer'>10</number></parameter> <parameter name='filter'><true/></parameter> <parameter name='restrict'><string/></parameter> <parameter name='safeSearch'><false/></parameter> <parameter name='lr'><string /></parameter> <parameter name='ie'><string>latin1</string></parameter> <parameter name='oe'><string>latin1</string></parameter> </parameters> </soap.call> </set> <println><ret /></println> <println>searchQuery................: <ret.searchQuery /></println> <println>searchTime.................: <ret.searchTime /></println> <println>startIndex.................: <ret.startIndex /></println> <println>estimateIsExact............: <ret.estimateIsExact /></println> <println>estimatedTotalResultsCount.: <ret.estimatedTotalResultsCount /></println> <iterator name='element'> <in> <ret.resultElements /> </in> <do> <println /> <println> URL...........: <element.URL /></println> <println> cachedSize....: <element.cachedSize /></println> <println> directoryTitle: <element.directoryTitle /></println> <println> snippet.......: <element.snippet /></println> <println> title.........: <element.title /></println> </do> </iterator>
Notas
The same example about the GoogleSearch service, but in this case the response of the GoogleSearchResult, DirectoryCategory, ResultElemen complex types is serialized. How the deserializer is not indicated, the system will create a struct for each type. You can observe in the example, The structures are traversed once the response has been obtained.
Call to the service ObtenerInfoCertificado of @signature.
<set name='ret'> <soap.call url='http://api.google.com/search/beta2' uri='urn:GoogleSearch' method='doGoogleSearch' encoding='NS_URI_SOAP_ENC' > <mappings> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='GoogleSearchResult' /> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='DirectoryCategory' /> <mapping encoding='http://schemas.xmlsoap.org/soap/encoding/' namespace='urn:GoogleSearch' type='ResultElement' /> </mappings> <parameters> <parameter name='key'><string>NECESITA SU CLAVE DE GOOGLE AQUI</string></parameter> <parameter name='q'><string>barcelona</string></parameter> <parameter name='start'><number type='integer'>0</number></parameter> <parameter name='maxResults'><number type='integer'>10</number></parameter> <parameter name='filter'><true/></parameter> <parameter name='restrict'><string/></parameter> <parameter name='safeSearch'><false/></parameter> <parameter name='lr'><string /></parameter> <parameter name='ie'><string>latin1</string></parameter> <parameter name='oe'><string>latin1</string></parameter> </parameters> </soap.call> </set> <println><ret /></println> <println>searchQuery................: <ret.searchQuery /></println> <println>searchTime.................: <ret.searchTime /></println> <println>startIndex.................: <ret.startIndex /></println> <println>estimateIsExact............: <ret.estimateIsExact /></println> <println>estimatedTotalResultsCount.: <ret.estimatedTotalResultsCount /></println> <iterator name='element'> <in> <ret.resultElements /> </in> <do> <println /> <println> URL...........: <element.URL /></println> <println> cachedSize....: <element.cachedSize /></println> <println> directoryTitle: <element.directoryTitle /></println> <println> snippet.......: <element.snippet /></println> <println> title.........: <element.title /></println> </do> </iterator>
Call to the SII service of the tax agency with authentication by certificate and with the body of the SOAP without method or URI of call.
<xsql-script> <body> <set name='resp'> <soap.call url="https://www1.agenciatributaria.gob.es/wlpl/SSII-FACT/ws/SiiFactV1PSOAP" keyStoreFile="file:///Users/certs/clientcert.pfx" keyStorePassword="samplepass" > <envelope> <namespace prefix="con" uri="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/ConsultaLR.xsd" /> <namespace prefix="sum" uri="https://www2.agenciatributaria.gob.es/static_files/common/internet/dep/aplicaciones/es/aeat/ssii/fact/ws/SuministroInformacion.xsd" /> </envelope> <parameters> <parameter> <dom.parse> <![CDATA[ <con:QueryLREmitedInvoices> <sum:Header> <sum:IDVersionSii>0.1</sum:IDVersionSii> <sum:Headline> <sum:BusinessName>COMPANYXXXX</sum:BusinessName> <sum:NIF>A84532501</sum:NIF> </sum:HeadLine> </sum:Header> <con:QueryFilter> <sum:TaxPeriod> <sum:Exercise>2016</sum:Exercise> <sum:Period>01</sum:Period> </sum:TaxPeriod> </con:QueryFilter> </con:QueryLREmitedInvoice> ]] > </dom.parse> </parameter> </parameters> </soap.call> </set> <if> <expr><soap.isFault><resp /></soap.isFault></expr> <then> <println>Fault Code...: <soap.fault.getCode><resp /></soap.fault.getCode></println> <println>Fault String.: <soap.fault.getString><resp/></soap.fault.getString></println> </then> <else> <println>Soap Response: <resp/></println> </else> </if> <return>SOAP call completed</return> </body> </xsql-script>