I ran into some odd behavior this afternoon...

I have a service deployment object, test:imageDefaultResSDep.  This 
object implements four methods:

    getIcon()
    getThumb()
    getReference()
    getLarge()

getIcon() is handled by a call out to the imagemanip service, 
distributed with Fedora, to dynamically generate an icon off the THUMB 
datastream.  The methods getThumb(), getReference(), and getLarge() 
simply serve up the object's THUMB, REF, and LARGE datastreams.

So I put all the pieces together, made my content model, my service 
definition, and linked them all up.

When I went to test the disseminations, I could get the icon with 
getIcon(), but the other three methods returned:

fedora.server.errors.MethodNotFoundException: Method getThumb [or 
getReference, or getLarge] was not found in test:imageDefaultResSDep's 
operation  binding.


Here's what I have in my SDep object's WSDL datastream:

   [...]
   <wsdl:service name="s1">
     <wsdl:port binding="this:b2" name="imageIconSDep_port">
       <http:address location="http://myserver.edu/imagemanip/"/>
     </wsdl:port>
     <wsdl:port binding="this:b1" name="imageDefaultResSDep_port">
       <http:address location="LOCAL"/>
     </wsdl:port>
   </wsdl:service>

   <wsdl:binding name="b1" type="this:ImageWithDefaultResPortType">
     <http:binding verb="GET"/>
     <wsdl:operation name="getThumb">
       <http:operation location="(THUMB)"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="getReference">
     [...]
     </wsdl:binding>
   <wsdl:binding name="b2" type="this:ImageWithDefaultResPortType">
     <http:binding verb="GET"/>
     <wsdl:operation name="getIcon">
       <http:operation 
location="ImageManipulation?url=(THUMB)&amp;op=resize&amp;newWidth=60"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
    [...]

When I switched the order of the <wsdl:port binding=...> elements in the 
<wsdl:service> stanza, then I could run getThumb(), getReference(), and 
getLarge(), but not getIcon().

Apparently, Fedora only picks up and processes the first <wsdl:port> 
binding?  According to the WSDL specs, you can specify multiple 
bindings, and they can all refer to the same portType.  Is it a 
limitation of Fedora, that it only works with one WSDL binding (the 
first one listed in the <wdsl:service> element), or am I missing some 
key piece?  I'd like to avoid having to create a ServiceDefinition and 
ServiceDeployment just for icons (although that wouldn't be the end of 
the world;  mainly, I'm just curious about how Fedora parses its WSDL 
descriptions).

Below is my full WSDL datastream.

thanks,

-- Scott

#######################################
<wsdl:definitions name="Image with Default Resolutions Implementation" 
targetNamespace="bmech"
   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="bmech" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema";>
   <wsdl:types>
     <xsd:schema targetNamespace="bmech">
       <xsd:simpleType name="THUMBType">
         <xsd:restriction base="xsd:string"/>
       </xsd:simpleType>
       <xsd:simpleType name="REFType">
         <xsd:restriction base="xsd:string"/>
       </xsd:simpleType>
       <xsd:simpleType name="LARGEType">
         <xsd:restriction base="xsd:string"/>
       </xsd:simpleType>
     </xsd:schema>
   </wsdl:types>
   <wsdl:message name="iconRequest">
     <wsdl:part name="THUMB" type="this:THUMBType"/>
   </wsdl:message>
   <wsdl:message name="thumbRequest">
     <wsdl:part name="THUMB" type="this:THUMBType"/>
   </wsdl:message>
   <wsdl:message name="refRequest">
     <wsdl:part name="REF" type="this:REFType"/>
   </wsdl:message>
   <wsdl:message name="largeRequest">
     <wsdl:part name="REF" type="this:LARGEType"/>
   </wsdl:message>
   <wsdl:message name="dissemResponse">
     <wsdl:part name="dissem" type="xsd:base64Binary"/>
   </wsdl:message>
   <wsdl:portType name="ImageWithDefaultResPortType">
     <wsdl:operation name="getIcon">
       <wsdl:input message="this:iconRequest"/>
       <wsdl:output message="this:dissemResponse"/>
     </wsdl:operation>
     <wsdl:operation name="getThumb">
       <wsdl:input message="this:thumbRequest"/>
       <wsdl:output message="this:dissemResponse"/>
     </wsdl:operation>
     <wsdl:operation name="getReference">
       <wsdl:input message="this:refRequest"/>
       <wsdl:output message="this:dissemResponse"/>
     </wsdl:operation>
     <wsdl:operation name="getLarge">
       <wsdl:input message="this:largeRequest"/>
       <wsdl:output message="this:dissemResponse"/>
     </wsdl:operation>
   </wsdl:portType>
   <wsdl:service name="s1">
     <wsdl:port binding="this:b2" name="imageIconSDep_port">
       <http:address location="http://myserver.edu/imagemanip/"/>
     </wsdl:port>
     <wsdl:port binding="this:b1" name="imageDefaultResSDep_port">
       <http:address location="LOCAL"/>
     </wsdl:port>
   </wsdl:service>
   <wsdl:binding name="b1" type="this:ImageWithDefaultResPortType">
     <http:binding verb="GET"/>
     <wsdl:operation name="getThumb">
       <http:operation location="(THUMB)"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="getReference">
       <http:operation location="(REF)"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
     <wsdl:operation name="getLarge">
       <http:operation location="(LARGE)"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
   <wsdl:binding name="b2" type="this:ImageWithDefaultResPortType">
     <http:binding verb="GET"/>
     <wsdl:operation name="getIcon">
       <http:operation 
location="ImageManipulation?url=(THUMB)&amp;op=resize&amp;newWidth=60"/>
       <wsdl:input>
         <http:urlReplacement/>
       </wsdl:input>
       <wsdl:output>
         <mime:content type="image/jpeg"/>
       </wsdl:output>
     </wsdl:operation>
   </wsdl:binding>
</wsdl:definitions>

-- 
Scott Prater
Library, Instructional, and Research Applications (LIRA)
Division of Information Technology (DoIT)
University of Wisconsin - Madison
[email protected]

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Fedora-commons-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fedora-commons-developers

Reply via email to