[MOBY-dev] JMoby....

Dmitry Repchevsky dmitry.repchevski at bsc.es
Tue Feb 19 15:23:41 UTC 2008


Hello Andreas,

Thank you for reply, but actually I do not use Eclipse, neither JMoby...
Could we once and forever clarify the difference between specification 
and implementation.

I have my own (not JMoby) API that could allow me to use a standard 
JAX-WS web-services if BioMoby team follows the standard.

On the server side it could look like:
*****************************
package es.bsc.inb.ejb.moby;

import javax.jws.*;
import javax.ejb.Stateless;
import javax.jws.soap.SOAPBinding;
import org.biomoby.shared.jaxb.messages.MobyMessage;

@Stateless()
@WebService()
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT,
             use=SOAPBinding.Use.LITERAL,
             parameterStyle=SOAPBinding.ParameterStyle.BARE)
public class MobyDocWebService
{
    @WebResult(name="result")
    public MobyMessage runMyService(@WebParam(name="request", mode = 
WebParam.Mode.IN) MobyMessage msg)
    {
        return msg;
    }
}
*****************************
This is the STANDARD JAX-WS endpoint. You can deploy it on ANY JEE5 
Application server.
The application server will generate and deploy the service automatically.

Here is generated (by JBoss) wsdl:
*****************************
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="MobyDocWebServiceService" 
targetNamespace="http://moby.ejb.inb.bsc.es/" 
xmlns:tns="http://moby.ejb.inb.bsc.es/" 
xmlns:ns1="http://www.biomoby.org/moby" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns="http://schemas.xmlsoap.org/wsdl/">
  <types>
    <xs:schema targetNamespace="http://moby.ejb.inb.bsc.es/" 
version="1.0" xmlns:ns1="http://www.biomoby.org/moby" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:import namespace="http://www.biomoby.org/moby"/>
   <xs:element name="request" nillable="true" type="ns1:mobyMessage"/>
   <xs:element name="result" nillable="true" type="ns1:mobyMessage"/>
  </xs:schema>
    <xs:schema attributeFormDefault="qualified" 
elementFormDefault="qualified" 
targetNamespace="http://www.biomoby.org/moby" version="1.0" 
xmlns="http://www.biomoby.org/moby" 
xmlns:moby="http://www.biomoby.org/moby" 
xmlns:tns="http://www.biomoby.org/moby" 
xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="Collection" type="mobyCollection"/>
   <xs:element name="MOBY" type="mobyMessage"/>
   <xs:element name="Simple" type="mobySimple"/>
   <xs:element name="mobyData" type="mobyData"/>
   <xs:element name="mobyException" type="mobyException"/>
   <xs:element name="serviceNotes" type="serviceNotes"/>
   <xs:complexType name="mobyMessage">
    <xs:sequence>
     <xs:element minOccurs="0" name="mobyContent" type="mobyContent"/>
    </xs:sequence>
   </xs:complexType>
   <xs:complexType name="mobyContent">
    <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="mobyData"/>
     <xs:element minOccurs="0" ref="serviceNotes"/>
    </xs:sequence>
   </xs:complexType>
   <xs:complexType name="mobyData">
    <xs:sequence>
     <xs:choice maxOccurs="unbounded" minOccurs="0">
      <xs:element ref="Simple"/>
      <xs:element ref="Collection"/>
     </xs:choice>
     <xs:element maxOccurs="unbounded" minOccurs="0" name="Parameter" 
type="mobyParameter"/>
    </xs:sequence>
    <xs:attribute ref="queryID"/>
   </xs:complexType>
   <xs:complexType name="mobySimple">
    <xs:sequence>
     <xs:any namespace="##other" processContents="lax"/>
    </xs:sequence>
    <xs:attribute ref="articleName"/>
   </xs:complexType>
   <xs:complexType name="mobyCollection">
    <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="Simple"/>
    </xs:sequence>
    <xs:attribute ref="articleName"/>
   </xs:complexType>
   <xs:complexType name="mobyParameter">
    <xs:sequence>
     <xs:element minOccurs="0" name="Value" type="xs:string"/>
    </xs:sequence>
    <xs:attribute ref="articleName"/>
   </xs:complexType>
   <xs:complexType name="serviceNotes">
    <xs:sequence>
     <xs:element maxOccurs="unbounded" minOccurs="0" ref="mobyException"/>
     <xs:element minOccurs="0" name="notes" type="xs:string"/>
    </xs:sequence>
   </xs:complexType>
   <xs:complexType name="mobyException">
    <xs:sequence>
     <xs:element minOccurs="0" name="exceptionCode" type="xs:string"/>
     <xs:element minOccurs="0" name="exceptionMessage" type="xs:string"/>
    </xs:sequence>
    <xs:attribute ref="refElement"/>
    <xs:attribute ref="refQueryID"/>
    <xs:attribute ref="severity"/>
   </xs:complexType>
   <xs:simpleType name="severity">
    <xs:restriction base="xs:string">
     <xs:enumeration value="error"/>
     <xs:enumeration value="warning"/>
     <xs:enumeration value="information"/>
    </xs:restriction>
   </xs:simpleType>
   <xs:attribute name="articleName" type="xs:string"/>
   <xs:attribute name="queryID" type="xs:string"/>
   <xs:attribute name="refElement" type="xs:string"/>
   <xs:attribute name="refQueryID" type="xs:string"/>
   <xs:attribute name="severity" type="severity"/>
  </xs:schema>
  </types>
  <message name="MobyDocWebService_runMyServiceResponse">
    <part name="result" element="tns:result">
    </part>
  </message>
  <message name="MobyDocWebService_runMyService">
    <part name="request" element="tns:request">
    </part>
  </message>
  <portType name="MobyDocWebService">
    <operation name="runMyService" parameterOrder="request">
      <input message="tns:MobyDocWebService_runMyService">
    </input>
      <output message="tns:MobyDocWebService_runMyServiceResponse">
    </output>
    </operation>
  </portType>
  <binding name="MobyDocWebServiceBinding" type="tns:MobyDocWebService">
    <soap:binding style="document" 
transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="runMyService">
      <soap:operation soapAction=""/>
      <input>
        <soap:body use="literal"/>
      </input>
      <output>
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="MobyDocWebServiceService">
    <port name="MobyDocWebServicePort" 
binding="tns:MobyDocWebServiceBinding">
      <soap:address 
location="http://127.0.0.1:8080/BioServices/MobyDocWebService"/>
    </port>
  </service>
</definitions>
*****************************

Having this you do not need even my API on the client side (you could 
generate it using the tool for your language)
Well you still need an ontology which couldn't (?) be injected in wsdl...
My API generates JAXB annotated ontology classes that JAX-WS 
automatically marshal/unmarshall.

This is IF we would use Document/Literal encoding and not just a hack 
when we pass the XML String and have to parse it manually.
Using Moby Message (the Moby XML that we pass as a string now) as a 
payload would allow us in future to explore the full power of SOAP 
(streaming, compression, WS-Addresing for TRULY asynchronous services 
through callbacks and so on).

This is the question I'm asking:
Are we going to use the same ugly hack (passing the XML string) for the 
document/literal or, finally, move on to the standard, interoperable Web 
Services?

Best regards,

Dmitry

P.S. I'm afraid that JMoby has a hard time to support this...

/ /



More information about the MOBY-dev mailing list