Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

As with all Fedora objects, Service Deployments must declare a persistent identifier ("PID") that is unique within the repository.  There are no special restrictions on the PID beyond those described in the Fedora Identifiers document.  In FOXML format, the PID is declared in the root element of the XML document as shown below:

Code Block

<?xml version="1.0" encoding="UTF-8"?>
<foxml:digitalObject xmlns:foxml="info:fedora/fedora-system:def/foxml#"
    VERSION="1.1" PID="demo:MyServiceDeployment">
  <!-- Object Properties -->
  <!-- Datastreams -->
</foxml:digitalObject>

...

There are also no special restrictions on the top-level object properties for Service Deployments.  In the following FOXML fragment, we assert that the state of the object is Active and the label is My Service Deployment.

Code Block

  <foxml:objectProperties>
    <foxml:property
        NAME="info:fedora/fedora-system:def/model#state"
        VALUE="Active"/>
    <foxml:property
        NAME="info:fedora/fedora-system:def/model#label"
        VALUE="My Service Deployment"/>
  </foxml:objectProperties>

...

  • an isDeploymentOf relationship to the associated Service Definition.  This tells Fedora which set of methods are deployed by this SDep.
  • an isContractorOf relationship to the associated Content Model.  This tells Fedora which set of objects this SDep is capable of operating on.
Code Block

  <foxml:datastream ID="RELS-EXT"
      CONTROL_GROUP="X" STATE="A" VERSIONABLE="true">
    <foxml:datastreamVersion ID="RELS-EXT1.0"
        MIMETYPE="application/rdf+xml"
        FORMAT_URI="info:fedora/fedora-system:FedoraRELSExt-1.0"
        LABEL="RDF Statements about this object">
      <foxml:xmlContent>
        <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
            xmlns:fedora-model="info:fedora/fedora-system:def/model#">
          <rdf:Description rdf:about="info:fedora/demo:MyServiceDeployment">
            <fedora-model:hasModel
                rdf:resource="info:fedora/fedora-system:ServiceDeployment-3.0"/>
            <fedora-model:isDeploymentOf
                rdf:resource="info:fedora/demo:MyServiceDefinition"/>
            <fedora-model:isContractorOf
                rdf:resource="info:fedora/demo:MyContentModel"/>
          </rdf:Description>
        </rdf:RDF>
      </foxml:xmlContent>
    </foxml:datastreamVersion>
  </foxml:datastream>

...

Note: Differences from the METHODMAP specified in the corresponding Service Definition are indicated below with a preceding "+" sign.

Code Block

  <foxml:datastream ID="METHODMAP"
        CONTROL_GROUP="X" STATE="A" VERSIONABLE="true">
    <foxml:datastreamVersion ID="METHODMAP1.0"
+       FORMAT_URI="info:fedora/fedora-system:FedoraSDepMethodMap-1.1"
+       LABEL="Deployment Method Map" MIMETYPE="text/xml">
      <foxml:xmlContent>
        <fmm:MethodMap
              xmlns:fmm="http://fedora.comm.nsdlib.org/service/methodmap"
              name="N/A">
          <fmm:Method operationName="methodOne"
+             wsdlMsgName="methodOneRequest"
+             wsdlMsgOutput="response">
+           <fmm:DatastreamInputParm parmName="FOO"
+               passBy="URL_REF" required="true"/>
+           <fmm:MethodReturnType wsdlMsgName="response"
+               wsdlMsgTOMIME="N/A"/>
          </fmm:Method>
          <fmm:Method operationName="methodTwo"
+             wsdlMsgName="methodTwoRequest"
+             wsdlMsgOutput="response">
            <fmm:UserInputParm parmName="parm1" defaultValue="value1"
                required="false" passBy="VALUE"/>
+           <fmm:DefaultInputParm parmName="uri" defaultValue="$objuri"
+               passBy="VALUE" required="true"/>
+           <fmm:MethodReturnType wsdlMsgName="response"
+               wsdlMsgTOMIME="N/A"/>
          </fmm:Method>
          <fmm:Method operationName="methodThree"
+             wsdlMsgName="methodThreeRequest"
+             wsdlMsgOutput="response">
            <fmm:UserInputParm parmName="parm1" defaultValue="value1"
                required="false" passBy="VALUE">
              <fmm:ValidParmValues>
                <fmm:ValidParm value="value1"/>
                <fmm:ValidParm value="value2"/>
              </fmm:ValidParmValues>
            </fmm:UserInputParm>
            <fmm:UserInputParm parmName="parm2" defaultValue=""
                required="true" passBy="VALUE"/>
+           <fmm:DefaultInputParm parmName="pid" defaultValue="$pid"
+               passBy="VALUE" required="true"/>
+           <fmm:DatastreamInputParm parmName="FOO"
+               passBy="URL_REF" required="true"/>
+           <fmm:DatastreamInputParm parmName="BAR"
+               passBy="URL_REF" required="true"/>
+           <fmm:DatastreamInputParm parmName="BAZ"
+               passBy="URL_REF" required="true"/>
+           <fmm:MethodReturnType wsdlMsgName="response"
+               wsdlMsgTOMIME="N/A"/>
          </fmm:Method>
        </fmm:MethodMap>
      </foxml:xmlContent>
    </foxml:datastreamVersion>
  <foxml:datastream>

...

The DSINPUTSPEC datastream specifies additional information about each datastream.  It is written in the Fedora Datastream Input Specification format.

Code Block

  <foxml:datastream ID="DSINPUTSPEC"
        CONTROL_GROUP="X" STATE="A" VERSIONABLE="true">
    <foxml:datastreamVersion ID="DSINPUTSPEC1.0"
        MIMETYPE="text/xml"
        FORMAT_URI="info:fedora/fedora-system:FedoraDSInputSpec-1.1"
        Label="Datastream Input Specification">
      <foxml:xmlContent>
        <fbs:DSInputSpec
            xmlns:fbs="http://fedora.comm.nsdlib.org/service/bindspec"
            label="N/A">
          <fbs:DSInput wsdlMsgPartName="FOO"
              DSMax="1" DSMin="1" DSOrdinality="false">
            <fbs:DSInputLabel/>N/A</fbs:DSInputLabel>
            <fbs:DSMIME>N/A</fbs:DSMIME>
            <fbs:DSInputInstruction>N/A</fbs:DSInputInstruction>
          </fbs:DSInput>
          <fbs:DSInput wsdlMsgPartName="BAR"
                DSMax="1" DSMin="1" DSOrdinality="false">
            <fbs:DSInputLabel/>N/A</fbs:DSInputLabel>
            <fbs:DSMIME>N/A</fbs:DSMIME>
            <fbs:DSInputInstruction>N/A</fbs:DSInputInstruction>
          </fbs:DSInput>
          <fbs:DSInput wsdlMsgPartName="BAZ" pid="demo:MyContentModel"
                DSMax="1" DSMin="1" DSOrdinality="false">
            <fbs:DSInputLabel/>N/A</fbs:DSInputLabel>
            <fbs:DSMIME>N/A</fbs:DSMIME>
            <fbs:DSInputInstruction>N/A</fbs:DSInputInstruction>
          </fbs:DSInput>
        </fbs:DSInputSpec>
      </foxml:xmlContent>
    </foxml:datastreamVersion>
  </foxml:datastream>

...

  • Leave the "response" wsdl:message as-is, but replace the others with your own.  You should have a wsdl:message element for each method defined by the Service Definition.  By convention, the name of each message should be the method name followed by the word "Request" (e.g. "methodOneRequest").  Within each wsdl:message element, add a wsdl:part for each user and/or datastream input parameter, and specify all types as "this:inputType".
  • Within the wsdl:portType section, replace each existing operation with your own.  Each operation should reference the corresponding request method as the input, and point to "this:response" as the output.
  • Finally, in the wsdl:binding section, replace each existing operation with your own.  In this section, the location attribute is the important bit.  The location should given as a URL template, where all occurances of (VARIABLE) are automatically replaced with the appropriate value at runtime.  If VARIABLE denotes a datastream, it will be replaced with a URL reference to the datastream content at runtime.  If VARIABLE denotes a user input parameter, it will replaced with the URL-encoded value of the variable at runtime.  If VARIABLE is "PID" and your METHODMAP specifies $PID as the default value for the PID variable as in the example METHODMAP above , it will be replaced with the data object's URL-encoded PID at runtime.
Code Block

  <foxml:datastream ID="WSDL"
      CONTROL_GROUP="X" STATE="A" VERSIONABLE="true">
    <foxml:datastreamVersion ID="WSDL1.0"
        MIMETYPE="text/xml"
        FORMAT_URI="http://schemas.xmlsoap.org/wsdl/"
        LABEL="WSDL Bindings">
      <foxml:xmlContent>
        <wsdl:definitions name="definitions"
            targetNamespace="urn:thisNamespace"
            xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
            xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
            xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap"
            xmlns:soapenc="http://schemas.xmlsoap.org/wsdl/soap/encoding"
            xmlns:this="urn:thisNamespace"
            xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
            xmlns:xsd="http://www.w3.org/2001/XMLSchema">
          <wsdl:types>
            <xsd:schema targetNamespace="urn:thisNamespace">
              <xsd:simpleType name="inputType">
                <xsd:restriction base="xsd:string"/>
              </xsd:simpleType>
            </xsd:schema>
          </wsdl:types>
          <wsdl:message name="methodOneRequest">
            <wsdl:part name="FOO" type="this:inputType"/>
          </wsdl:message>
          <wsdl:message name="methodTwoRequest">
            <wsdl:part name="parm1" type="this:inputType"/>
            <wsdl:part name="uri" type="this:inputType"/>
          </wsdl:message>
          <wsdl:message name="methodThreeRequest">
            <wsdl:part name="parm1" type="this:inputType"/>
            <wsdl:part name="parm2" type="this:inputType"/>
            <wsdl:part name="pid" type="this:inputType"/>
            <wsdl:part name="FOO" type="this:inputType"/>
            <wsdl:part name="BAR" type="this:inputType"/>
            <wsdl:part name="BAZ" type="this:inputType"/>
          </wsdl:message>
          <wsdl:message name="response">
            <wsdl:part name="response" type="xsd:base64Binary"/>
          </wsdl:message>
          <wsdl:portType name="portType">
            <wsdl:operation name="methodOne">
              <wsdl:input message="this:methodOneRequest"/>
              <wsdl:output message="this:response"/>
            </wsdl:operation>
            <wsdl:operation name="methodTwo">
              <wsdl:input message="this:methodTwoRequest"/>
              <wsdl:output message="this:response"/>
            </wsdl:operation>
            <wsdl:operation name="methodThree">
              <wsdl:input message="this:methodThreeRequest"/>
              <wsdl:output message="this:response"/>
            </wsdl:operation>
          </wsdl:portType>
          <wsdl:service name="service">
            <wsdl:port binding="this:binding" name="port">
              <http:address location="LOCAL"/>
            </wsdl:port>
          </wsdl:service>
          <wsdl:binding name="binding" type="this:portType">
            <http:binding verb="GET"/>
            <wsdl:operation name="methodOne">
              <http:operation location="(FOO)"/>
              <wsdl:input>
                <http:urlReplacement/>
              </wsdl:input>
              <wsdl:output>
                <mime:content type="N/A"/>
              </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="methodTwo">
              <http:operation
                  location="http://local.fedora.server/fedora/risearch?format=(parm1)&amp;type=triples&amp;lang=spo&amp;query=(uri)+*+*"/>
              <wsdl:input>
                <http:urlReplacement/>
              </wsdl:input>
              <wsdl:output>
                <mime:content type="N/A"/>
              </wsdl:output>
            </wsdl:operation>
            <wsdl:operation name="methodThree">
              <http:operation
                  location="http://example.org/service?a=(parm1)&amp;b=(parm2)&amp;c=(parm3)&amp;d=(FOO)&amp;e=(BAR)&amp;f=(BAZ)&amp;g=(pid)"/>
              <wsdl:input>
                <http:urlReplacement/>
              </wsdl:input>
              <wsdl:output>
                <mime:content type="N/A"/>
              </wsdl:output>
            </wsdl:operation>
          </wsdl:binding>
        </wsdl:definitions>
      </foxml:xmlContent>
    </foxml:datastreamVersion>
  </foxml:datastream>