Version 5 (modified by joshuadf, 13 years ago) (diff)

update examples to work with SaxonWebService

SOAP Web Services

Wiki pages and WSDL locations

Term confusion

By the way, Web Services terms overload common terms which causes some confusion. Here is a rough correspondence:

  • port: like Java Class, Perl module, etc.
  • operation: like Java Method, Perl function, etc.; may take parameters

So you call the TransformationServer with the Web Services port TransformationServer and the Web Services operation transformXML.

Documentation may also refer to the endpoint or location which is a full URL including server and path where the SOAP client POSTs its message; in this case the endpoint is You usually don't need to know the endpoint, since most clients generate it using information in the WSDL.

Example clients

These examples query the SaxonWebService; for the syntax used with the other services, see their individual wiki pages.

Example: AngloSaxon

AngloSaxon is an pre-beta product written by Eider designed to call Web Services from within Saxon, an open source XSLT/XQuery processor.

let $q := 

let $a := anglo:xquery("", "XQuery", "doXQuery", $q)

Example: Apache Axis

This example is modified from the Apache Axis documentation, save this as

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

public class testClient
   public static void main(String [] args) {
       try {
           String endpoint = "";
           Service  service = new Service();
           Call     call    = (Call) service.createCall();

           call.setTargetEndpointAddress( new );
           call.setOperationName(new QName("", "doXQuery") );

           call.addParameter("xquery", org.apache.axis.Constants.XSD_STRING,javax.xml.rpc.ParameterMode.IN);

           String xquery = ""+
             "<results> {"+ 
           String ret = (String) call.invoke(new Object[] {xquery});

           System.out.println("QUERY: \n" + xquery + "\nRESULTS: \n\n" + ret + "\n");
       } catch (Exception e) {

On SIG Linux machines, you can compile and run with:

javac -cp $CP 
java -cp $CP testClient

Example: perl SOAP::Lite

For more information see, especially Access with service description (WSDL))

use SOAP::Lite;
# if you want debug output including SOAP faults add '+trace':
#use SOAP::Lite +trace;
$q = '
let $p := $pv/patient[pnum=117] 
return $p/pnum
print SOAP::Lite
  -> service("")
  -> doXQuery("$q");
print "\n";