Showing posts with label WSDL. Show all posts
Showing posts with label WSDL. Show all posts

Tuesday, May 23, 2017

Swagger doesn't support decimal

As of version 7.10.0 using node.js the swagger doesn't support the decimal however it supports the number of type float of 32 bit, double of 64 bit but not decimal of 128 bit.

So you can declare as a field of type decimal as below..

  "amount" : {
          "type" : "number"


Then cast it to decimal like CAST(amount AS DECIMAL);

Thursday, March 9, 2017

SOAP based webservice

1) Create new application.
2)New soap based message model with existing wsdl
3)new message flow
4)drag the wsdl onto the message flow edit on the new flow
5)this gives a skeleton etc. then write business transformation, routing logic's etc.

WSDL to Swagger Generator

Generate JSON/YAML swaggers from a WSDL

Installation

  1. Install Node.js >= v6.0.0 (https://nodejs.org/en/)
  2. Clone the repo from SAMI-GIT
    git clone https://git.xyz.com/NAWM_Tools/wsdl-to-swagger.git
    cd wsdl-to-swagger
    
  3. Install dependencies
    npm install
    

Usage

This script takes two inputs: 1) input WSDL file, and 2) output file. The output file needs to end with .json or .yml.
Example:
node wsdl-to-swagger.js example.wsdl example.json
Swagger validation: http://editor.swagger.io/

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>



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...