Loading ...
Sorry, an error occurred while loading the content.

Access to Horde from Perl - How do I call remote methods with dots w/args too?

Expand Messages
  • jeffreydhorn
    I m trying to access Horde soap procedures from Perl on another server. I have a WSDL specification, but I cannot figure out how to put together a simple
    Message 1 of 1 , Oct 7, 2005
    • 0 Attachment
      I'm trying to access Horde soap procedures from Perl on another
      server. I have a WSDL specification, but I cannot figure out how to
      put together a simple SOAP::Lite program to access the information.

      I'm having problems putting together methods that have dots in them
      (and so aren't proper Perl subroutine names) and which also have
      arguments.

      For instance this script works:

      #!/usr/bin/perl -w

      use strict;
      use diagnostics; # Remove from production code
      #use SOAP::Lite +trace => [qw(all -debug)];
      use SOAP::Lite;

      my $soapRequest = SOAP::Lite
      -> uri('urn:horde')
      -> proxy('http://jhorn:jhorn@.../horde/rpc.php');

      my $result = $soapRequest -> call('horde.listAPIs') -> result;

      # Print the result
      print "Result = '", join(',', @$result), "'\n";

      But if I want to call a method say calendar.listCalendars which
      actually takes two arguments, how do I pass those through. Here is
      the WSDL:

      <?xml version="1.0"?><definitions name="horde"
      targetNamespace="urn:horde"
      xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
      xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
      xmlns:tns="urn:horde" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
      xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
      xmlns="http://schemas.xmlsoap.org/wsdl/">
      <types xmlns="http://schemas.xmlsoap.org/wsdl/">
      <schema xmlns="http://www.w3.org/2001/XMLSchema"
      targetNamespace="urn:horde">
      <complexType name="stringArray">
      <complexContent>
      <restriction base="SOAP-ENC:Array">
      <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="xsd:string[]" />
      </restriction>
      </complexContent>
      </complexType>
      <complexType name="hashItem">
      <all>
      <element name="key" type="xsd:string" />
      <element name="value" type="xsd:string" />
      </all>
      </complexType>
      <complexType name="hash">

      <complexContent>
      <restriction base="SOAP-ENC:Array">
      <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:hashItem[]" />
      </restriction>
      </complexContent>
      </complexType>
      <complexType name="hashHashItem">
      <all>
      <element name="key" type="xsd:string" />
      <element name="value" type="tns:hash" />
      </all>
      </complexType>
      <complexType name="hashHash">
      <complexContent>
      <restriction base="SOAP-ENC:Array">
      <attribute ref="SOAP-ENC:arrayType" wsdl:arrayType="tns:hashHashItem
      []" />
      </restriction>

      </complexContent>
      </complexType>
      </schema>
      </types>
      <message name="horde.listAppsRequest">
      <part name="filter" type="tns:stringArray" />
      </message>
      <message name="horde.listAppsResponse">
      <part name="output" type="tns:stringArray" />
      </message>
      <message name="horde.listAPIsRequest" />
      <message name="horde.listAPIsResponse">
      <part name="output" type="tns:stringArray" />
      </message>
      <message name="horde.blockTitleRequest">
      <part name="app" type="xsd:string" />
      <part name="name" type="xsd:string" />

      <part name="params" type="tns:hash" />
      </message>
      <message name="horde.blockTitleResponse">
      <part name="output" type="xsd:string" />
      </message>
      <message name="horde.blockContentRequest">
      <part name="app" type="xsd:string" />
      <part name="name" type="xsd:string" />
      <part name="params" type="tns:hash" />
      </message>
      <message name="horde.blockContentResponse">
      <part name="output" type="xsd:string" />
      </message>
      <message name="horde.blocksRequest" />
      <message name="horde.blocksResponse">
      <part name="output" type="tns:hash" />
      </message>

      <message name="calendar.getFreeBusyRequest">
      <part name="startstamp" type="xsd:int" />
      <part name="endstamp" type="xsd:int" />
      <part name="calendar" type="xsd:string" />
      </message>
      <message name="calendar.getFreeBusyResponse">
      <part name="output" type="tns:stringArray" />
      </message>
      <message name="calendar.listCalendarsRequest">
      <part name="owneronly" type="xsd:boolean" />
      <part name="permission" type="xsd:int" />
      </message>
      <message name="calendar.listCalendarsResponse">
      <part name="output" type="tns:stringArray" />
      </message>
      <message name="calendar.listEventsRequest">
      <part name="startstamp" type="xsd:int" />

      <part name="endstamp" type="xsd:int" />
      <part name="calendar" type="xsd:string" />
      <part name="showRecurrence" type="xsd:string" />
      </message>
      <message name="calendar.listEventsResponse">
      <part name="output" type="xsd:array" />
      </message>
      <message name="calendar.listRequest" />
      <message name="calendar.listResponse">
      <part name="output" type="tns:stringArray" />
      </message>
      <message name="calendar.listByRequest">
      <part name="action" type="xsd:string" />
      <part name="timestamp" type="xsd:int" />
      </message>
      <message name="calendar.listByResponse">
      <part name="output" type="tns:stringArray" />

      </message>
      <message name="calendar.importRequest">
      <part name="content" type="xsd:string" />
      <part name="contentType" type="xsd:string" />
      <part name="calendar" type="xsd:string" />
      </message>
      <message name="calendar.importResponse">
      <part name="output" type="xsd:int" />
      </message>
      <message name="calendar.exportRequest">
      <part name="uid" type="xsd:string" />
      <part name="contentType" type="xsd:string" />
      </message>
      <message name="calendar.exportResponse">
      <part name="output" type="xsd:string" />
      </message>
      <message name="calendar.deleteRequest">

      <part name="uid" type="xsd:string" />
      </message>
      <message name="calendar.deleteResponse">
      <part name="output" type="xsd:boolean" />
      </message>
      <message name="calendar.replaceRequest">
      <part name="uid" type="xsd:string" />
      <part name="content" type="xsd:string" />
      <part name="contentType" type="xsd:string" />
      </message>
      <message name="calendar.replaceResponse">
      <part name="output" type="xsd:boolean" />
      </message>
      <message name="calendar.eventFromUIDRequest">
      <part name="uid" type="xsd:string" />
      </message>
      <message name="calendar.eventFromUIDResponse">

      <part name="output" type="xsd:object" />
      </message>
      <message name="calendar.updateAttendeeRequest">
      <part name="response" type="xsd:object" />
      </message>
      <message name="calendar.updateAttendeeResponse">
      <part name="output" type="xsd:boolean" />
      </message>
      <portType name="hordePort">
      <operation name="horde.listApps">
      <input message="tns:horde.listAppsRequest" />
      <output message="tns:horde.listAppsResponse" />
      </operation>
      <operation name="horde.listAPIs">
      <input message="tns:horde.listAPIsRequest" />
      <output message="tns:horde.listAPIsResponse" />
      </operation>

      <operation name="horde.blockTitle">
      <input message="tns:horde.blockTitleRequest" />
      <output message="tns:horde.blockTitleResponse" />
      </operation>
      <operation name="horde.blockContent">
      <input message="tns:horde.blockContentRequest" />
      <output message="tns:horde.blockContentResponse" />
      </operation>
      <operation name="horde.blocks">
      <input message="tns:horde.blocksRequest" />
      <output message="tns:horde.blocksResponse" />
      </operation>
      <operation name="calendar.getFreeBusy">
      <input message="tns:calendar.getFreeBusyRequest" />
      <output message="tns:calendar.getFreeBusyResponse" />
      </operation>
      <operation name="calendar.listCalendars">

      <input message="tns:calendar.listCalendarsRequest" />
      <output message="tns:calendar.listCalendarsResponse" />
      </operation>
      <operation name="calendar.listEvents">
      <input message="tns:calendar.listEventsRequest" />
      <output message="tns:calendar.listEventsResponse" />
      </operation>
      <operation name="calendar.list">
      <input message="tns:calendar.listRequest" />
      <output message="tns:calendar.listResponse" />
      </operation>
      <operation name="calendar.listBy">
      <input message="tns:calendar.listByRequest" />
      <output message="tns:calendar.listByResponse" />
      </operation>
      <operation name="calendar.import">
      <input message="tns:calendar.importRequest" />

      <output message="tns:calendar.importResponse" />
      </operation>
      <operation name="calendar.export">
      <input message="tns:calendar.exportRequest" />
      <output message="tns:calendar.exportResponse" />
      </operation>
      <operation name="calendar.delete">
      <input message="tns:calendar.deleteRequest" />
      <output message="tns:calendar.deleteResponse" />
      </operation>
      <operation name="calendar.replace">
      <input message="tns:calendar.replaceRequest" />
      <output message="tns:calendar.replaceResponse" />
      </operation>
      <operation name="calendar.eventFromUID">
      <input message="tns:calendar.eventFromUIDRequest" />
      <output message="tns:calendar.eventFromUIDResponse" />

      </operation>
      <operation name="calendar.updateAttendee">
      <input message="tns:calendar.updateAttendeeRequest" />
      <output message="tns:calendar.updateAttendeeResponse" />
      </operation>
      </portType>
      <binding name="hordeBinding" type="tns:hordePort">
      <soap:binding style="rpc"
      transport="http://schemas.xmlsoap.org/soap/http" />
      <operation name="horde.listApps">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#horde.listApps" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>

      <operation name="horde.listAPIs">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#horde.listAPIs" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="horde.blockTitle">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#horde.blockTitle" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>

      </operation>
      <operation name="horde.blockContent">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#horde.blockContent" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="horde.blocks">
      <soap:operation soapAction="urn:horde#horde_rpc_soap#horde.blocks" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

      </output>
      </operation>
      <operation name="calendar.getFreeBusy">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.getFreeBusy" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.listCalendars">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.listCalendars" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>

      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.listEvents">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.listEvents" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.list">
      <soap:operation soapAction="urn:horde#horde_rpc_soap#calendar.list" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>

      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.listBy">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.listBy" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.import">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.import" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />

      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.export">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.export" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.delete">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.delete" />
      <input>

      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.replace">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.replace" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.eventFromUID">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.eventFromUID" />

      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      <operation name="calendar.updateAttendee">
      <soap:operation
      soapAction="urn:horde#horde_rpc_soap#calendar.updateAttendee" />
      <input>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
      <output>
      <soap:body use="encoded" namespace="urn:horde"
      encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>

      <service name="hordeService">
      <documentation />
      <port name="hordePort" binding="tns:hordeBinding">
      <soap:address location="http://www.codeq.com/horde/rpc.php" />
      </port>
      </service>
      </definitions>
    Your message has been successfully submitted and would be delivered to recipients shortly.