IMPORTANT NOTE (2010-04-13): The WSDUtils component does not work with PHP 5.3 and greater. PHP 5.3 introduces the notion of “namespaces”, but the WSDLUtils defines “Namespace” as a class and therefore PHP 5.3 borks when loading up the files. (See: http://forums.developer.mindtouch.com/showthread.php?t=6059 for an example).

Full documentation for the WSDLUtils component is available here: here

WSDL Parsing

WSDL parsing in BioCatalogue involves reading the contents of a WSDL file and structuring the data from it so that it can be mapped to the data model used internally in the BioCatalogue (which is subsequently persisted to a relational database). This structured way of storing the data contents allows for individual pieces of the data to be annotated separately.
The main elements in the WSDL documents are :

  • the types
  • the messages
  • the portTypes
  • the bindings
  • the services

The WSDL parsing process in BioCatalogue also involves the mapping of the service elements with the operations within the portypes, the mapping of the messages with the types used in the messages to build a hierarchy of service, operations and operations/outputs.

The BioCatalogue view of the WSDL is a tree-like structure with the service at the root node. The operations as defined within the portType elements are attached to this root node. The messages used by the input and outputs of these operations form the leaves of the structure. The wsdl parsing document shows how the mapping is done.

The building of the service hierarchy used in BioCatalogue is achieved in a two stage process:

  • Using the WSDLUtils library from the EMBRACE registry to generate a simplified xml document. The main advantage of using this library is that the types defined in external xml schemas are imported. Importing types defined in external schemas permits details of complex types to be obtained. Often important bits of information for the end users, like the documentation of the types used by the service is hidden in these external schemas. Documentation (including installation instructions) for the WSDLUtils library is available here. This library has a rest interface and is currently installed on BioCatalogue test server. To use the wsdl parser, we pass it two parameters :
  • The xml file generated by the WSDLUtils library is then transformed into a ruby structure for storing in the BioCatalogue database. The the structures is as shown in wsdl parsing document

Configuration

Set the WSDLUtils parser loaction in

config/initializers/biocat_local.rb

Example

WSDLUTILS_BASE_URI = 'http://test.biocatalogue.org/WSDLUtils/WSDLUtils.php'

Run Parser in Console

 BioCatalogue::WSDLUtils::WSDLParser.parse("wsdl_url")

Example

The mrbws wsdl when parsed will produce:

{"name"=>"Mrbws",
 "end_point"=>"http://bioit.fleming.gr/mrb/mrbws",
 "operations"=>
  [{"operation_type"=>nil,
    "name"=>"getCategories",
    "inputs"=>
     [{"computational_type"=>"getCategories",
       "name"=>"getCategories",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getCategories", "type"=>{"name"=>"getCategories"}}}}],
    "parent_port_type"=>"mrbwsSEIPort",
    "action"=>nil,
    "description"=>nil,
    "outputs"=>
     [{"computational_type"=>"getCategoriesResponse",
       "name"=>"getCategoriesResponse",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getCategoriesResponse",
           "type"=>
            {"name"=>"getCategoriesResponse",
             "type"=>{"name"=>"result", "type"=>{"name"=>"string"}}}}}}]},
   {"operation_type"=>nil,
    "name"=>"getNonOboOntologies",
    "inputs"=>
     [{"computational_type"=>"getNonOboOntologies",
       "name"=>"getNonOboOntologies",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getNonOboOntologies",
           "type"=>{"name"=>"getNonOboOntologies"}}}}],
    "parent_port_type"=>"mrbwsSEIPort",
    "action"=>nil,
    "description"=>nil,
    "outputs"=>
     [{"computational_type"=>"getNonOboOntologiesResponse",
       "name"=>"getNonOboOntologiesResponse",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getNonOboOntologiesResponse",
           "type"=>
            {"name"=>"getNonOboOntologiesResponse",
             "type"=>{"name"=>"result", "type"=>{"name"=>"string"}}}}}}]},
   {"operation_type"=>nil,
    "name"=>"getQualityCriteria",
    "inputs"=>
     [{"computational_type"=>"getQualityCriteria",
       "name"=>"getQualityCriteria",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getQualityCriteria",
           "type"=>{"name"=>"getQualityCriteria"}}}}],
    "parent_port_type"=>"mrbwsSEIPort",
    "action"=>nil,
    "description"=>nil,
    "outputs"=>
     [{"computational_type"=>"getQualityCriteriaResponse",
       "name"=>"getQualityCriteriaResponse",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getQualityCriteriaResponse",
           "type"=>
            {"name"=>"getQualityCriteriaResponse",
             "type"=>{"name"=>"result", "type"=>{"name"=>"string"}}}}}}]},
   {"operation_type"=>nil,
    "name"=>"getResourcesByCategory",
    "inputs"=>
     [{"computational_type"=>"getResourcesByCategory",
       "name"=>"getResourcesByCategory",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getResourcesByCategory",
           "type"=>
            {"name"=>"getResourcesByCategory",
             "type"=>{"name"=>"int_1", "type"=>{"name"=>"int"}}}}}}],
    "parent_port_type"=>"mrbwsSEIPort",
    "action"=>nil,
    "description"=>nil,
    "outputs"=>
     [{"computational_type"=>"getResourcesByCategoryResponse",
       "name"=>"getResourcesByCategoryResponse",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getResourcesByCategoryResponse",
           "type"=>
            {"name"=>"getResourcesByCategoryResponse",
             "type"=>{"name"=>"result", "type"=>{"name"=>"string"}}}}}}]},
   {"operation_type"=>nil,
    "name"=>"getWSDLs",
    "inputs"=>
     [{"computational_type"=>"getWSDLs",
       "name"=>"getWSDLs",
       "computational_type_details"=>
        {"type"=>{"name"=>"getWSDLs", "type"=>{"name"=>"getWSDLs"}}}}],
    "parent_port_type"=>"mrbwsSEIPort",
    "action"=>nil,
    "description"=>nil,
    "outputs"=>
     [{"computational_type"=>"getWSDLsResponse",
       "name"=>"getWSDLsResponse",
       "computational_type_details"=>
        {"type"=>
          {"name"=>"getWSDLsResponse",
           "type"=>
            {"name"=>"getWSDLsResponse",
             "type"=>{"name"=>"result", "type"=>{"name"=>"string"}}}}}}]}],
 "namespace"=>"urn:mrbws/wsdl",
 "description"=>nil,
 "ports"=>
  [{"name"=>"mrbwsSEIPort",
    "protocol"=>"http://schemas.xmlsoap.org/soap/http",
    "location"=>"http://bioit.fleming.gr/mrb/mrbws",
    "style"=>"document"}]}

BioCatalogue Model Extensions

  New Model : Soap Service Port 
  Table Name : soap_service_ports 
  Fields :
    * name  
    * protocol
    * location
    * style
  New Model Attribute : computational_type_details 
  Table Name : soap_inputs,soap_outputs 
  Fields :
    * computational_type_details
    Computational type details are the details of complex types defined either inline or in an external schema. They are stored in the db as a
    serialized ruby hash

Known Issues

  • The WSDLUtils library fails to parse WSDLs with schema locations specified with relative paths. Examples include the NCBI soap services like
     http://www.ncbi.nlm.nih.gov/entrez/eutils/soap/eutils.wsdl 
development/wsdl_parsing.txt · Last modified: 2010/04/13 13:45 by jits
www.chimeric.de Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0