Explore model answers categorized by subjects like Java, HTML, DBMS, and more.
SOAP is stand for Simple Object Access Protocol.SOAP is an protocol based on XML used for accessing a Web Services.I have given you some main points about SOAP.
These are given below:
1.SOAP is protocol used for communication.
2.SOAP is used to enable communication between applications.
3.SOAP is an format for sending messages.
4.In SOAP communicates via Internet.
5.SOAP is an platform independent protocol.
6.SOAP is an language independent protocol.
7.SOAP is an protocol based on XML.
8.SOAP is simple and extensible.
9.SOAP allows you to get around firewalls.
10.SOAP is an W3C recommendation.
It is important for application development use to allow Internet communication b/w the programs.
Now days we communicate applications using Remote Procedure Calls (RPC) between objects like DCOM and CORBA, but HTTP was not designed for this purpose.
RPC is used to represents a compatibility and security problem. This kind of traffic can normally block by firewalls and proxy servers. will normally block this kind of traffic.
It\'s a good way to communicate between applications is over HTTP because HTTP is supported by all Internet
Using SOAP we can communicate between applications running on different operating systems with different technologies and programming languages.
When you write syntax of SOAP than please keep these points in mind.
1. We must encoded a SOAP message using XML.
2. A SOAP message must uses the SOAP Envelope namespace.
3.A SOAP message must uses the SOAP Encoding namespace.
4.A SOAP message must NOT be contain a DTD reference.
5.A SOAP message must NOT contain XML Processing Instructions.
Syntax of SOAP message:<?xml version=\"1.0\"?>
<soap:Envelope xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\" soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Header>
...
</soap:Header>
<soap:Body>
...
<soap:Fault>
...
</soap:Fault>
</soap:Body>
</soap:Envelope>
Their are many advantages of SOAP over standard http request.Some main are given below:
1.SOAP is a firewalls friendly way use to make remote procedures call.
2.SOAP provides us a shared language that is used for mapping structured data transmitted over the wire.This is used to enable processes of different platforms and architectures use to decode the serialized data structures.
SOAP is a protocol that is used by Web service and Web service consumer to communicate with each other and it is independent of operating system and language.
SOAP uses XML format to encode data. I have provide you two ways to perform this task:
1.It can maps high level datatypes like: integers, arrays to a serialized XML format Section 5 encoding and Literal encoding. Section 5 encoding is also known as SOAP encoding, is has named after the section in the SOAP 1.1 specification that is use to define it.
2.We can also use Literal encoding to uses a XML Schema to validate them.
Loosely coupled means services that use by you are reusable.In this a service does not depend upon the other services.Means if we change Java service shall not affect another service that was developed in PHP.
In this all components that are necessary for an application that are not tightly coupled.So, That we perform a single change in some class that it can changes all other parts of the application.Instead to break the whole application into small parts.
ESB is stands for Enterprise Service Bus.ESP is standard based which is most important component of Service Oriented Architecture(SOA). Using ESP we can connect applications through service interfaces.
The main difference b/w SOAP and Traditional RPC are given below:
In SOAP we used procedures which has named parameters and order is irrelevant Where as in XML-RPC order is relevant and parameters do not have names.
Suppose, If wanted to transfer messages from one end to another end using with Internet application layer.Using SOAP we can transport many productsfrom one end to another end.
To perform this task without any error we use one of SMTP and HTTP protocols(Used in transfering information).
We can say that HTTPS is similar to HTTP But the main difference b/w them is that HTTPS has an additional layer underneath the internet application layer which is use to make encrypted data.
HTTPS protocol is much better and widely than other protocols like IOP or DCOM because these protocols can filtered by firewalls.
HTTP protocol provide us security when we want to transfer secured data by using advocates WS-I method.
XML use by many large companies due to its open source nature.
XML is an standard format than it is accepted by many organization.
Their is a wide variety of tools are available on shelves which is use to ease the process of transition to SOAP.
Significance of XML is that to reduce the speed and efficiency.
Future format of XML is binary XML.
Some main advantages of SOAP are given below:
1. SOAP has huge collection of protocols
2. SOAP is an platform and independent.
3. SOAP is an language independent.
4. Most important feature of SOAP is that it has Simple and extensible by nature.
Yes,SOAP has many advantages.But it has some disadvantages also.
1. It is much slower than middle-ware technologies.
2. Because we used HTTP for transporting messages and not use to defined ESB or WS-Addressing interaction of parties over a message is fixed.
3. Application protocol level is problematic because usability of HTTP for different purposes is not present.
I have given you element that we used in SOAP:
1. An envelope element is used to identifies and translates the XML document into a SOAP message.
2. A header element is used to contain header message.
3. A body is used to contain call and response message.
4. Fault element is used to communicate about the errors occurred during the process.
We can called SOAP envelope element as root element of a SOAP message.
SOAP Envelope Element: This is use to define an XML document as SOAP message.Syntax:
<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
...
To write information message here
...
</soap:Envelope>
The xmlns:soap Namespace is used to defines the Envelope as a SOAP Envelope.
f we different namespace is used,Than the application generates an error and discards that message.
The encodingStyle Attribute: It is used to define the data types that we used in the XML document.
Attribute may show on any SOAP element.
In SOAP message their is no default encoding.Syntax: soap:encodingStyle=\"URI\"
Example:<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
...
To write information message here
...
</soap:Envelope>
We use SOAP Header element to store the application specific information about the SOAP message.like: authentication, payment etc.
If our Header element is present,it should be the first child element of the Envelope element.
One thing I want to clear you all immediate child elements of the Header element must be namespace-qualified.<?xml version=\"1.0\"?>
Above example has a header with a \"Trans\" element and a \"mustUnderstand\" attribute with a value of 1 and a value of 234.
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Header>
<m:Trans xmlns:m=\"http://www.w3schools.com/transaction/\"
soap:mustUnderstand=\"1\">234
</m:Trans>
</soap:Header>
...
</soap:Envelope>
Here, SOAP defines three attributes in the default namespace
(\"http://www.w3.org/2001/12/soap-envelope\").
These three attributes are:
1. mustUnderstand attribute
2. actor attribute
3. encodingStyle attribute
We use attribute in the SOAP header to define how a recipient should process the SOAP message.
1. mustUnderstand attribute: This is used to inform that a header entry is mandatory or optional for the recipient to process.
When we add mustUnderstand=\"1\" to a child element of the Header element it show that the receiver processing those Header must have recognize them.
Suppose that if receiver has unable to recognize elements when we process the header they will failed.Syntax:
soap:mustUnderstand=\"0|1\"
Example:
<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Header>
<m:Trans xmlns:m=\"http://www.w3schools.com/transaction/\"
soap:mustUnderstand=\"1\">234
</m:Trans>
</soap:Header>
...
</soap:Envelope>
2. actor attribute: You shpould know that by passing different endpoints along with the message path SOAP message may travel from a sender to a receiver .
We can address the Header element to a specific endpoint by using SOAP actor attribute.Syntax:
soap:actor=\"URI\"
Example:
<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Header>
<m:Trans xmlns:m=\"http://www.w3schools.com/transaction/\"
soap:actor=\"http://www.w3schools.com/appml/\">234
</m:Trans>
</soap:Header>
...
</soap:Envelope>
3. encodingStyle attribute: Using this attribute we can define data types that we used in the document.
we can use this attribute in element\'s contents and all child elements.encodeingStyle attribute can be appear on any SOAP element.
No default encoding has in SOAP message.Syntax:
soap:encodingStyle=\"URL\"
We use Body element in SOAP to contains the actual SOAP message specify the ultimate endpoint of the message.Example:
<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Body>
<m:GetPrice xmlns:m=\"http://www.w3schools.com/prices\">
<m:Item>Mangos</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
Above example has write to requests the price of Mangos.In this m:GetPrice and Item elements both are called as application specific elements. I want to confirm you both elements are not a part of SOAP namespace.
I have given you a SOAP response code according to above SOAP request.
Example:<?xml version=\"1.0\"?>
<soap:Envelope
xmlns:soap=\"http://www.w3.org/2001/12/soap-envelope\"
soap:encodingStyle=\"http://www.w3.org/2001/12/soap-encoding\">
<soap:Body>
<m:GetPriceResponse xmlns:m=\"http://www.w3schools.com/prices\">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
We used SOAP Fault element to contains errors and the status information for a SOAP message.
Fault element can come only once in a SOAP message.When Fault element is present that is will show like child element in Body element.
I have given you sub elements that are in Fault element of SOAP.
<faultcode>
This is used code to identifying the fault.
<faultstring>
This is an explanation of the fault which can easily read by human.
<faultactor>
This is used get reason of fault happening.
<detail>
This is used to Holds application specific error information those are related to the Body element.
SOAP Fault Codes: Some Fault Codes of SOAP are given below:
VersionMismatch
This is used to Find an invalid namespace for the SOAP Envelope element.
MustUnderstand
This is an immediate child element of the Header element with an mustUnderstand attribute which we set to \'1\'.
Client
This is used to contain incorrect information.
Server
If a problem exists with the server.Than message could not proceed.
UML is stand for Unified Modeling Language.It contains a textual description of a model we use this features found in UML class diagrams (classes, associations etc).
Those expressions that we write in the Object Constraint Language (OCL) are used to specify additional integrity constraints on the model.
We can animated a model used to validate the specification against non-formal requirements. During an animation we can create and manipulate system states.
We use graphical views to given a information about system state. We use OCL expressions to entered and evaluated query detailed information about system state.
SOAP is stands for Simple Object Access Protocol. SOAP was first comes in 1990 after that in 2000 it introduced to W3C.
In Web Component we use SOAP to send an request for to invoke programs on remote computers with using XML wrappers.
The main purpose to use SOAP in Web Service is that to send messages over HTTP protocol.
XML processor and HTTP Server are mandatory when you want to build SOAP Server.We have to use some other tools when you deal with different language.
When you deal with Visual Basic 6.0 or VBA than you must have to use either Microsoft SOAP TOOLkit or PocketSOAP.
When you deal with VB.Net or C# than you must have to use Visual Stdio.Net or .Net Framework.
When you deal with Delphi than you have to use Borland\'s Web services.
When you deal with C++ than you have to use Systinet WASP Server for C++ or gSOAP.
When you deal with Java,Than their is a many choices for you like: Apache Axis, Systinet WASP Server for Java, The Mind Electric GLUE, Cape Clear Cape Connect, BEA Workshop, etc.
Most likely Java environments are WASP, GLUE, and Axis.
Difference b/w the fault and exception depends upon where these error occurs, may be they occur on client side or on server side.
Exception occurs on client side where as fault occur on server side.
I have explain you with an example.We send an SOAP encoded request for which method that does not exist results in a SOAP fault whereas
when server sends a response with a field that does not exist in a client side class.
I want to inform you HTTP perform communication over TCP/IP and TCP HTTP client can connect to an HTTP server.
When connection will established than using that connection client can send an HTTP request message to the server.
POST /item HTTP/1.1
Host: 189.123.345.239
Content-Type: text/plain
Content-Length: 200
Server processes this request and sends an HTTP response back to the client. The response contains has a status code that are use to indicate the status of the request.
200 OK
Content-Type: text/plain
Content-Length: 200
This server returned a status code of 200.This is also called as standard success code for HTTP.
If the server has unable to decode the request, it can returned something like.
400 Bad Request
Content-Length: 0
SOAP HTTP Binding: We use SOAP method to complies with the SOAP encoding rules.
HTTP + XML = SOAP
A SOAP request may be an HTTP POST or an HTTP GET request.
HTTP POST request specifies at least two HTTP headers:
1. Content-Type
2. Content-Length
1. Content-Type: In case of Soap request and response, Content-Type header defines the MIME type for the message and the character encoding ( that is optional) used only for XML body of the request or response.
Syntax:
Content-Type MIMEType;
charset=character-encoding
Example:
POST /item HTTP/1.1
Content-Type application/soap+xml; charset=utf-8
2. Content-Length: Using Content-Length header we specifies the number of bytes in the body of the request or response for a SOAP request and response.
Syntax:
Content-Length: bytes
Example:
POST /item HTTP/1.1
Content-Type: application/soap+xml; charset=utf-8
Content-Length: 250
Header of SOAP contains information like that,
1. In SOAP header client should handle authentication and transaction.
2. The SOAP message should process by client.
3. EncodingStyle is also has in header.
SOAP-DSIG and SSL both technology are used to satisfy security requirement.
SOAP-DSIG: Using SOAP-DSIG we can satisfy requirement message authentication.We perform task to transmit messagesl, SOAP-DSIG Message authentication by using MAC or digital signature.
SSL: In SSL we use MAC for confidentiality, sender/recipient authentication and
message authentication. Using SSL we can also add two MACs to transmit messages.
We have need guarantee simultaneously for both message authentication through use of digital signature and sender authentication to satisfy the requirement of non-repudiation.
Now, we can say that simultaneously use of SOAP-DSIG and SSL(Used with client authentication )is the starting step towards non-repudiation.
Key difference b/w SOAP-DSIG and SSL is that SOAP-DSIG can perform task of message authentication by using digital signature and use SSL client/server authentication for sender/recipient authentication.