Showing posts with label service. Show all posts
Showing posts with label service. Show all posts

Wednesday, February 8, 2017

Weather or temperature conversion webservice WSDL

<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:tns="http://webservices.daehosting.com/temperature" name="TemperatureConversions" targetNamespace="http://webservices.daehosting.com/temperature">
<types>
<xs:schema elementFormDefault="qualified" targetNamespace="http://webservices.daehosting.com/temperature">
<xs:element name="CelsiusToFahrenheit">
<xs:complexType>
<xs:sequence>
<xs:element name="nCelsius" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="CelsiusToFahrenheitResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="CelsiusToFahrenheitResult" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FahrenheitToCelsius">
<xs:complexType>
<xs:sequence>
<xs:element name="nFahrenheit" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="FahrenheitToCelsiusResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="FahrenheitToCelsiusResult" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WindChillInCelsius">
<xs:complexType>
<xs:sequence>
<xs:element name="nCelsius" type="xs:decimal"/>
<xs:element name="nWindSpeed" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WindChillInCelsiusResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="WindChillInCelsiusResult" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WindChillInFahrenheit">
<xs:complexType>
<xs:sequence>
<xs:element name="nFahrenheit" type="xs:decimal"/>
<xs:element name="nWindSpeed" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="WindChillInFahrenheitResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="WindChillInFahrenheitResult" type="xs:decimal"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
</types>
<message name="CelsiusToFahrenheitSoapRequest">
<part name="parameters" element="tns:CelsiusToFahrenheit"/>
</message>
<message name="CelsiusToFahrenheitSoapResponse">
<part name="parameters" element="tns:CelsiusToFahrenheitResponse"/>
</message>
<message name="FahrenheitToCelsiusSoapRequest">
<part name="parameters" element="tns:FahrenheitToCelsius"/>
</message>
<message name="FahrenheitToCelsiusSoapResponse">
<part name="parameters" element="tns:FahrenheitToCelsiusResponse"/>
</message>
<message name="WindChillInCelsiusSoapRequest">
<part name="parameters" element="tns:WindChillInCelsius"/>
</message>
<message name="WindChillInCelsiusSoapResponse">
<part name="parameters" element="tns:WindChillInCelsiusResponse"/>
</message>
<message name="WindChillInFahrenheitSoapRequest">
<part name="parameters" element="tns:WindChillInFahrenheit"/>
</message>
<message name="WindChillInFahrenheitSoapResponse">
<part name="parameters" element="tns:WindChillInFahrenheitResponse"/>
</message>
<portType name="TemperatureConversionsSoapType">
<operation name="CelsiusToFahrenheit">
<documentation>
Converts a Celsius Temperature to a Fahrenheit value
</documentation>
<input message="tns:CelsiusToFahrenheitSoapRequest"/>
<output message="tns:CelsiusToFahrenheitSoapResponse"/>
</operation>
<operation name="FahrenheitToCelsius">
<documentation>
Converts a Fahrenheit Temperature to a Celsius value
</documentation>
<input message="tns:FahrenheitToCelsiusSoapRequest"/>
<output message="tns:FahrenheitToCelsiusSoapResponse"/>
</operation>
<operation name="WindChillInCelsius">
<documentation>
Windchill temperature calculated with the formula of Steadman
</documentation>
<input message="tns:WindChillInCelsiusSoapRequest"/>
<output message="tns:WindChillInCelsiusSoapResponse"/>
</operation>
<operation name="WindChillInFahrenheit">
<documentation>
Windchill temperature calculated with the formula of Steadman
</documentation>
<input message="tns:WindChillInFahrenheitSoapRequest"/>
<output message="tns:WindChillInFahrenheitSoapResponse"/>
</operation>
</portType>
<binding name="TemperatureConversionsSoapBinding" type="tns:TemperatureConversionsSoapType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="CelsiusToFahrenheit">
<soap:operation soapAction="" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="FahrenheitToCelsius">
<soap:operation soapAction="" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="WindChillInCelsius">
<soap:operation soapAction="" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
<operation name="WindChillInFahrenheit">
<soap:operation soapAction="" style="document"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<binding name="TemperatureConversionsSoapBinding12" type="tns:TemperatureConversionsSoapType">
<soap12:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="CelsiusToFahrenheit">
<soap12:operation soapAction="" style="document"/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
<operation name="FahrenheitToCelsius">
<soap12:operation soapAction="" style="document"/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
<operation name="WindChillInCelsius">
<soap12:operation soapAction="" style="document"/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
<operation name="WindChillInFahrenheit">
<soap12:operation soapAction="" style="document"/>
<input>
<soap12:body use="literal"/>
</input>
<output>
<soap12:body use="literal"/>
</output>
</operation>
</binding>
<service name="TemperatureConversions">
<documentation>
DataFlex Web Service to convert temperature values between Celsius and Fahrenheit
</documentation>
<port name="TemperatureConversionsSoap" binding="tns:TemperatureConversionsSoapBinding">
<soap:address location="http://webservices.daehosting.com/services/TemperatureConversions.wso"/>
</port>
<port name="TemperatureConversionsSoap12" binding="tns:TemperatureConversionsSoapBinding12">
<soap12:address location="http://webservices.daehosting.com/services/TemperatureConversions.wso"/>
</port>
</service>
</definitions>



Monday, January 9, 2017

MQ as a Service in IIB


IBM introdued MQ or Database as SOA service in IIB.This is available in earlier versions of WMB as supportpac.
This includes two things :
·         An IRI Specification defining addresses for referencing WebSphere MQ queues and topics in a way similar to URL Web addresses.
·         A WSDL Binding Specification defining extensions for WSDL that describe WebSphere MQ applications, including its connections, the queues or topics it uses, its message exchange pattern (request-response or one-way) and the quality of service and message formats it uses.
Why MQ or Database services can be used as SOA services?Whats the benefit?
·         Architects can catalogue MQ/DB  applications in a standard way as they are specified in WSDL
·         MQ/DB applications can be extended to Webservice stack. These specifications will enable them to write a WMQ/DB service implementation that will interoperate with other WMQ/DB service implementations.
·         Use the Service Definitions to aid the development, management and monitoring of WebSphere MQ/DB applications, particularly where tools exist that take advantage of these specifications
·         Helps in dynamic invocation

Now,lets create a MQ service and use it in a message flow,

1)Select MQ Service in File->New





2)After creating MQ service,a screen open for MQ service to fill in all the details
3)Provide MQ details to test the connectivity with MQ QueueManager

4)Next step is to choose,whether we are going for One-way or Req-Res modal ,and what are the queues we are selecting
5)Next is to choose ,MQ header information as below,
If we are selecting only one-way,then only Request MQ headers are sufficient to be fillied up
6) Now,we can choose the messagetypes for input messages by first having the messageset in the MQ service folder itself so that it gets referred in the Input (Use XML schema elements àOpen file)

7)Now drag and drop the newly created MQService to the MQInput node.We can now see that all the properties defined in MQ Service gets reflected in the MQInput node’s properties.

Tuesday, November 15, 2016

Using Shared Libraries in websphere IIB-IBM integration bus



IBM Integration Bus v10 has introduced many new features. One of the important feature, from my point of view, is the introduction of Shared Library concept.
We all know that WebSphere Message Broker v8 provided new ways of organizing resources in toolkit by introducing
  • Application container, as per the info-center, is a container for all the resources that are required to create a solution.
    • Provides run-time isolation –> resources inside the application are not visible to other resources
    • Used when updates to one group of deployed resources should not affect another group of deployed resources
  • Library container, for organizing resources for re-usability. Can be referenced by applications or services or integration projects.
    • WMB v8 introduced Static library
The behavior of the library container introduced in WMB 8 and used in IIB v9, as per info-center are provided below
StaticLib
Drawback of Library used in WMB 8 / IIB 9: Owing to Application / Service’s run time isolation behavior, we solution developers faced major challenges on deciding whether to organize our solution using Applications / Services or using Integration Projects.Whensolutions were organized using Applications / Services and the reusable artifact(s), like Common Error Handling framework / logging framework, organized using libraries, each application / services carried copy of library within themselvesAs a result, any changes made to these reusable artifact always resulted in need to re-deploy all applications / services.
In that regards, organizing the resources as Integration Projects was better and very much appealing.
But IIB v10 has addressed this concern / problem by introducing Shared Libraries. Now the Applications / Services do not take copy of the Shared Library within themselves. As the Shared Libraries are deployed directly at the Integration Server level.
Advantages of Shared Libraries
  1. Shared Libraries can be added to the BAR file independently of referencing Applications / Services
  2. Deployment of updated Shared Library results in the changes immediately picked up by all referencing applications / services at run-time. Hence no need to redeploy all referencing applications / services
  3. Enables using / referencing to multiple XML or DFDL schema files that declare the same elements and types, by having them stored in separate Shared Libraries
SharedLib
Shared Library vs Static Library from Toolkit to Run-time
  • In the New Library window, specify the name for the library and selecting the library type as “Shared Library”, click FinishLoggerSL
  • Below Images shows the Shared and Static libraries in the toolkit
StaticVsShared
  • Referencing to Shared Library / Static library from Application is shown belowLibReferences
  • When adding to the BAR file, Shared Libraries are displayed in the BAR Editor separately and have to be selected explicitly for adding to the bar file. This is not the case with Static Library as they are added automatically when application referencing them is added to BAR file.
BAREditor
  • After deployment, you could notice the difference between Shared & Static library. Static library copy will be present within the application container, where as the Shared Library is outside the application container and directly under the Integration Server.
Runtime

Friday, October 21, 2016

What's WSDL?

A WSDL document defines services as collections of network endpoints, or ports. In WSDL, the abstract definition of endpoints and messages is separated from their concrete network deployment or data format bindings. This allows the reuse of abstract definitions: messages, which are abstract descriptions of the data being exchanged, and port types which are abstract collections of operations. The concrete protocol and data format specifications for a particular port type constitutes a reusable binding. A port is defined by associating a network address with a reusable binding, and a collection of ports define a service. Hence, a WSDL document uses the following elements in the definition of network services:
  • Types– a container for data type definitions using some type system (such as XSD).
  <wsdl:types> ?
        <wsdl:documentation .... />?
        <xsd:schema .... />*
        <-- extensibility element --> *
    </wsdl:types
  • Message– an abstract, typed definition of the data being communicated.
    <wsdl:message name="nmtoken"> *
        <wsdl:documentation .... />?
        <part name="nmtoken" element="qname"? type="qname"?/> *
    </wsdl:message>
  • Operation– an abstract description of an action supported by the service.
  • Port Type–an abstract set of operations supported by one or more endpoints.--Operation
  <wsdl:portType name="nmtoken">*
        <wsdl:documentation .... />?
        <wsdl:operation name="nmtoken">*
           <wsdl:documentation .... /> ?
           <wsdl:input name="nmtoken"? message="qname">?
               <wsdl:documentation .... /> ?
           </wsdl:input>
           <wsdl:output name="nmtoken"? message="qname">?
               <wsdl:documentation .... /> ?
           </wsdl:output>
           <wsdl:fault name="nmtoken" message="qname"> *
               <wsdl:documentation .... /> ?
           </wsdl:fault>
        </wsdl:operation>
    </wsdl:portType>
  • Binding– a concrete protocol and data format specification for a particular port type.
 <wsdl:binding name="nmtoken" type="qname">*
        <wsdl:documentation .... />?
        <-- extensibility element --> *
        <wsdl:operation name="nmtoken">*
           <wsdl:documentation .... /> ?
           <-- extensibility element --> *
           <wsdl:input> ?
               <wsdl:documentation .... /> ?
               <-- extensibility element -->
           </wsdl:input>
           <wsdl:output> ?
               <wsdl:documentation .... /> ?
               <-- extensibility element --> *
           </wsdl:output>
           <wsdl:fault name="nmtoken"> *
               <wsdl:documentation .... /> ?
               <-- extensibility element --> *
           </wsdl:fault>
        </wsdl:operation>
    </wsdl:binding>
  • Port– a single endpoint defined as a combination of a binding and a network address.

  <wsdl:port name="nmtoken" binding="qname"> *
           <wsdl:documentation .... /> ?
           <-- extensibility element -->
  </wsdl:port>
  • Service– a collection of related endpoints-- 
  •     <wsdl:service name="nmtoken"> *
            <wsdl:documentation .... />?
            <wsdl:port name="nmtoken" binding="qname"> *
               <wsdl:documentation .... /> ?
               <-- extensibility element -->
            </wsdl:port>
            <-- extensibility element -->
        </wsdl:service>



Example 1 SOAP 1.1 Request/Response via HTTP
<?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:StockQuoteBinding">
           <soap:address location="http://example.com/stockquote"/>
        </port>
    </service>

</definitions>



For more information please click the link

Distributed Computing: A Guide to Comparing Data Between Hive Tables Using Spark

In big data, efficient data comparison is essential for ensuring data integrity and validating data migrations. Apache Spark, with its in-me...