Native Web Service Thoughts
Thinking about one of my previous posts, where I said that Gen can participate fully in SOAs, it became obvious that this is not entirely true if one considers “out of the box” functionality. Gen can generate WS-I compliant services, proxies of various types (C/Com/Java etc) and EJBs which can be called from a variety of technologies but its is the consumption of non-Gen created objects that pose a problem.
There are many products that allow the consumption of Web Services (such as Cool Profs’ WebService Connector) and a presentation you can download from their website (EDGE 2006 - Using Webservices)) and XML Composer from CANAM, for exmaple.
However, it makes a lot of sense to me to allow native consumption of web services - after all - Gen r7.6 can produce WS-I compliant webservices, rather than rely on EABs.
How would this work ?
Well - given a piece of WSDL (as follows):
<?xml version=”1.0″?>
<definitions name=”StockQuote”
targetNamespace=”http://example.com/stockquote.wsdl“
xmlns:tns=”http://example.com/stockquote.wsdl“
xmlns:xsd1=”http://example.com/stockquote.xsd“
xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/“
xmlns=”http://schemas.xmlsoap.org/wsdl/“>
<types>
<schema targetNamespace=”http://example.com/stockquote.xsd“
xmlns=”http://www.w3.org/2000/10/XMLSchema“>
<element name=”TradePriceRequest”>
<complexType>
<all>
<element name=”tickerSymbol” type=”string”/>
</all>
</complexType>
</element>
<element name=”TradePrice”>
<complexType>
<all>
<element name=”price” type=”float”/>
</all>
</complexType>
</element>
</schema>
</types>
<message name=”GetLastTradePriceInput”>
<part name=”body” element=”xsd1:TradePriceRequest”/>
</message>
<message name=”GetLastTradePriceOutput”>
<part name=”body” element=”xsd1:TradePrice”/>
</message>
<portType name=”StockQuotePortType”>
<operation name=”GetLastTradePrice”>
<input message=”tns:GetLastTradePriceInput”/>
<output message=”tns:GetLastTradePriceOutput”/>
</operation>
</portType>
<binding name=”StockQuoteSoapBinding” type=”tns:StockQuotePortType”>
<soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/>
<operation name=”GetLastTradePrice”>
<soap:operation soapAction=”http://example.com/GetLastTradePrice”/>
<input>
<soap:body use=”literal”/>
</input>
<output>
<soap:body use=”literal”/>
</output>
</operation>
</binding>
<service name=”StockQuoteService”>
<documentation>My first service</documentation>
<port name=”StockQuotePort” binding=”tns:StockQuoteSoapBinding”>
<soap:address location=”http://example.com/stockquote”/>
</port>
</service>
</definitions>
I’d like to import that into the Gen model and USE it as an action diagram - basically I’d like to see the import and export views of a Gen action diagram map to the input and output data sets of the Web Service.
I shouldn’t have to use some custom EAB-style generator to inerface with the Web Service!!!
Over the next few weeks I’m going to be dissecting the WSDL example and trying to see what should be done in terms of the Gen import and how it will look, and updating this page with my thoughts - its like a blog-within-a-blog I suppose!
First things first - presumably we’d need a wizard-type interface to import details of the WSDL into the model and represent it as an object.
Really speaking, the first portion of the WSDL specification (reproduced below):
<?xml version=”1.0″?>
<definitions name=”StockQuote”
targetNamespace=”http://example.com/stockquote.wsdl“
xmlns:tns=”http://example.com/stockquote.wsdl“
xmlns:xsd1=”http://example.com/stockquote.xsd“
xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/“
xmlns=”http://schemas.xmlsoap.org/wsdl/“>
doesn’t really affect anything at design time, only at run-time, so presumably these properties (although editable) could remain stored in the WSDL.
By the way, all these machinations and cogitations assume that the WSDL file is available at run-time.



