25
SOAP Services in Mule Esb

SOAP Service in Mule Esb

Embed Size (px)

Citation preview

Web Services Using SOAP, WSDL, and UDDI

SOAP Services in Mule Esb

What are Web Services?IBM A Web service is an interface that describes a collection of operations that are network accessible through standardized XML messagingMicrosoft: XML Web Services.. expose useful functionality to Web users through a standard Web protocol.. provide a way to describe their interfaces in enough detail to allow a user to build a client application to talk to them.. are registered so that potential users can find them easily

Why Web Services?From business standpointIntegrationWithin an organizationBetween companiesAllows time/cost efficienciesPurchase ordersAnswering inquiriesProcessing shipment requestsDo this without locking in to a single partner

Web Service ArchitectureService-Oriented Architecture

Service Registry

Service Requestor

Service Provider

FindPublishBind

Architecture IIAll the technologies are XML based

Registry(UDDI)

Service Requestor

Service Provider

FindPublishBind(SOAP)(SOAP)(WSDL)

XML Leveraging FeaturesXML NamespacesCollisionCommon XML element namesApplication specific or embedded in message?Allows composition of multiple XML documentsIdentifies elements belonging to the same document type

XML Leveraging Features IIXML SchemasAlternative to DTDs for describing document structureWritten in XMLSimple typesComplex typesReusableIntended to be used with namespaces

SOAPSimple Object Access ProtocolWeb service messaging and invocation2nd Generation XML ProtocolTakes advantage ofXML NamespacesXML Schema

First Generation XML ProtocolBased on XML 1.0Example: XML-RPCIntroduced by Userland in 1998Uses HTTP as underlying transport

twenty-eight

CallResponse

NumberToText 28

First Gen. XML Protocol IssuesExtensibilityAll protocol architects had to agree for changesAvoid with namespacesDatatypingSingle DTDsLimited in use of XML elementsDescriptive nature of XML sacrificedXML schema is a better solution

SOAP History

1998 Term SOAP coined at Microsoft1999

Microsoft works with BizTalk to release SOAP 0.9 Submitted to IETF SOAP 1.0 released in December

2000

SOAP 1.1 submitted to W3C with IBM IBM releases a Java SOAP implementation Sun starts work on Web services in J2EE

2001

SOAP 1.2 released by XML Protocol working group at W3CCurrently, about 80+ SOAP implementations available including Apple

SOAP Messaging Layers

App API

SOAP, XML Processing

App API

SOAP, XML Processing

SOAP Message

SOAP Message

HTTP

HTTPDeveloperSOAP Service ProviderHTTP

ClientProviderView

SOAP Message

SOAP EnvelopeRoot elementMandatoryDoes not expose any protocol versionsProtocol version is the URI of SOAP envelope namespaceencodingStyle attribute for complex types

SOAP HeaderOptionalAllows packaging of information orthogonal to messageTransactionsAuthentication informationAccount informationSOAP-ENV:mustUnderstand

SOAP-ENV:mustUnderstandAttribute for Header elementValue 0 skip this element if it doesnt make senseValue 1 must fail if it doesnt make senseEnsures recipients be aware of important protocol extensions

[email protected]

SOAP BodyCan contain arbitrary XMLConventions forRPCsFaultsFaultcode lookup stringFaultstring human readable stringFaultactor where in the message pathDetail optionalData encoding

Data encoding in SOAPSOAP provides default encoding schemaWhy reinvent the wheel?Simple data typesUse xsi:typeString, floats etcComplex data typesSOAP arraysStructs: compound typesData referencingHref and id attributes

Data encoding in SOAPBinary dataBase64 encoding

Can roll your own schemaencodingStyleInteroperability issues

SOAP Protocol Binding: HTTP

POST /ServiceLoc HTTP/1.1Host: www.foo.comContent-Type: text/xml; charset=utf-8Content-Length: nnnnSOAPAction: Directory/Service

Out-of-message context

In-message contextSample RPC Call

Other SOAP Protocol BindingsHTTPSSimilar to HTTPUse POSTReturn 200 for success500 for failure + SOAP faultSOAPAction HTTP header for hintMIME media type: text/htmlSMTPSOAP messages with Attachments

SOAP RPC Example: getQuoteimport SOAPserver = SOAP.SOAPProxy("http://services.xmethods.com:80/soap", namespace = 'urn:xmethods-delayed-quotes')

print "IBM>>", server.getQuote(symbol = 'IBM')

RPC Invocation Message

IBM

RPC Reply Message

107.89

Roadmap

Registry(UDDI)

Service Requestor

Service Provider

FindPublishBind(SOAP)(SOAP)(WSDL)