Professional Documents
Culture Documents
SOAP Background
http://www.w3.org/TR/SOAP
Elemen SOAP
Plus-Minus SOAP
Plus
Uses HTTP which is widely used and scalable
Flexible for growth because of XML properties
It can be used for RPC.
Minus
Parsing of SOAP packet and mapping to objects
reduces performance
Doesnt implement security because it relies on
HTTP
HTTP POST
POST /LelangService/LelangService.asmx/checkCC HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length
userid=string&tipe=string&no_cc=string&cvv=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length
<?xml version="1.0" encoding="utf-8"?>
<boolean xmlns="http://tempuri.org/LelangService/LelangServiceClass">
boolean
</boolean>
Aturan
xmlns:xsi="http://www.w3.org/2001/XMLSchemainstance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelop
e/"
SOAP harus dibuat dengan menggunakan sintaks XML
SOAP harus menggunakan SOAP Envelope namespace
SOAP tidak boleh mengandung DTD
SOAP Skeleton
SOAP Fault
SOAP Envelope
What is WSDL?
Stands for Web Service Description
Language
WSDL is a document written in XML
The document describes a Web service
Specifies the location of the service and
the methods the service exposes
Not a W3C Standard
Introduction
Why WSDL?
Without WSDL, calling syntax must be
determined from documentation that must
be provided, or from examining wire
messages
With WSDL, the generation of proxies for
Web services is automated in a truly
language- and platform-independent way
Working of WSDL
WSDL Elements
Namespace used
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd=http://www.w3.org/2001/XMLSchema
xmlns:soap=http://schemas.xmlsoap.org/wsdl/soap/
xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
Types Section
<xsd:complexType name="PERSON">
<xsd:sequence>
<xsd:element name="firstName type="xsd:string"/>
<xsd:element name="lastName" type="xsd:string"/>
<xsd:element name="ageInYears" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
Message
Messages Section
PortTypes Section
Defines a web service, the operations that can be performed, and the
messages that are involved.
Operation defines which message is the input and which message is the
output
SOAP Binding
<binding >
<soap:binding transport=uri? Style=rpc|document?>
</binding>
<binding >
<operation >
<soap:operation soapAction=uri? Style=rpc|document?>
<input> . </input>
<output> . </output>
</operation>
</binding>
<input>
<soap:body parts=nmtokens? use=literal|encoded?
encodingStyle=uri-list? Namespace=uri?>
</input>
<fault>
<soap:fault name=nmtoken use=literal|encoded
encodingStyle=uri-list? Namespace=uri?>
</fault>
<input>
<soap:header message=qname part=nmtoken
use=literal|encoded? encodingStyle=uri-list? Namespace=uri?>
<soap:headerfault message=qname part=nmtoken
use=literal|encoded? encodingStyle=uri-list? Namespace=uri?>
</input>
<binding >
<soap:address location=uri />
</binding>
Bindings Section
PortType Operation
PortType Operation
PortType Operation
<message name=getBilAcak>
<part name=bil type=xsd:int>
</message>
<portType name=BilanganAcak>
<operation name=getBilanganAcak>
<output message=getBilAcak/>
</operation>
</portType>
Element Service
<service name="GoogleSearchService">
<port name="GoogleSearchPort
binding="typens:GoogleSearchBinding">
<soap:address
location="http://api.google.com/search/beta2"/>
</port>
</service>
UDDI
Universal Description, Discovery and
Integration
Adalah direktori/registry yang bersifat
platform independent, untuk
mendeskripsikan, menyimpan service,
bisnis dan integrasi bisnis pada Internet
yang berkomunikasi via SOAP dan WSDL.
SW companies, standards
bodies, and programmers
populate the registry with
descriptions of different types
of services
2.
UDDI Business Registry
Businesses
populate
the registry
with
descriptions of
the services
they support
Business
Registrations
3.
Segrvice Type
Reistrations
4.
Marketplaces, search
engines, and business
apps query the registry to
discover services at other
companies
5.
Komponen UDDI
UDDI
memiliki 3 komponen:
White Pages
Yellow Pages
Green Pages
White Pages
Berisi Business Name
Text Description
Contact info
Known Identifiers
Yellow Pages
Business categories
Green Pages
Nested model
Business processes
Service descriptions
Binding information
Programming/platform/implementation agnostic
Services can also be categorized
Keuntungan UDDI
Procedure : adalah suatu kumpulan perintahperintah yang digunakan untuk suatu tujuan
tertentu dan diberi nama tertentu.
Function : adalah suatu kumpulan perintahperintah yang digunakan untuk suatu tujuan
tertentu dan diberi nama tertentu serta
mengembalikan nilai tertentu keluar kepada
fungsi yang memanggilnya.
Contoh Procedure
Dalam VB:
Private Sub LuasPersegiPanjang(ByVal panjang as
Integer,ByVal lebar as Integer)
Dim luas as Integer
luas = panjang * lebar
Console.WriteLn(Luas = & Str(luas))
End Sub
Dalam C#:
private void LuasPersegiPanjang(int panj, int lebar){
int luas;
luas = panj * lebar;
Console.WriteLn(Luas = + Convert.ToString(luas));
}
Contoh Function
Dalam VB:
Private Function LuasPersegiPanjang(ByVal panjang as
Integer,ByVal lebar as Integer) as Integer
Return panjang*luas;
End Sub
Console.WriteLn(Luas = & LuasPersegiPanjang(5,3));
Dalam C#:
private int LuasPersegiPanjang(int panj, int lebar){
return panj*lebar;
}
Console.WriteLn(Luas = + LuasPersegiPanjang(5,3));
Number Guest
Prinsip-prinsip Method
NumberGuestWeb
NumberGuestWeb
NumberGuestWeb
NumberGuestWeb
NumberGuestDesktop
Buatlah project baru pada VS.NET yaitu
ASP.NET Windows Application
Kemudian desainlah!
Cara menambahkan Web Service ke
project sama dengan pada Web Client
Application
Desainlah sebagai berikut:
NumberGuestDesktop
Database WebService
Database WebService
Database WebService
Database WebService
Database WebService
Database WebService
Database WebService