Simple Object Access Protocol (SOAP) is a protocol for cross-server and cross-application communication. It is based on XML, is language and platform independent, and is recommended by W3C.
SOAP is needed when normal internet access is blocked by security and compatibility preventions, and firewalls. With SOAP, different applications on different operating systems can exchange information, access databases on remote servers, without heed of language level or type.
There are four elements to the SOAP architecture:
An XML document needs to be declared as a SOAP message, so an envelope is placed around it:
Header information is optional for the SOAP call. The parts of the header include whether the call must comply to the optional header (soap:mustUnderstand="1"), the Actor, which points the header to a specific endpoint (soap:actor="URI"), and encoding (soap:encodingStyle="URI").
The call and response information is stored in the body element:
Errors and other information regarding the status of the SOAP call is returned in the Fault element.
Random string generation involves a simple application which is extremely useful for a wide range of applications.
We define the function
str_rand, which is based on the PHP
mt_rand, to generate the string:
With this function we can create an impressive number of different strings. With the values of
$chars as the basis, we have a string which is 32 characters long, selected from 62 characters, or 3262 permutations. Let's use Python to make the calculation:
Not enough? Given that the combinations increase exponentially, by simply doubling the length
$len of the string, we obtain 9.6 x 10111 possible results, or more than 4 billion billion times the previous number!
However, a high probability is not enough to guarantee that all of the generated strings are unique. As programmers we have to remain on the defensive, and be 100% sure that they can be no conflicts. It is sufficient to add a simple loop to ensure this condition is met:
Given the high number of possible keys, the condition
in_array($k, $keys) will be nearly always false, but if the number of keys already existing is very high and/or the number of possible combinations must be restricted (for example, shortening the key or including only the lower case letters in the initial
$chars set), it would be too involved to check every time all the values of
$keys. At this point, we could devise a more refined method for generating keys, but for most requirements this method works perfectly.
Content © Renewable-Media.com. All rights reserved. Created : November 28, 2014 Last updated :March 7, 2016
The most recent article is:
View this item in the topic:
and many more articles in the subject:
Physics is the science of the very small and the very large. Learn about Isaac Newton, who gave us the laws of motion and optics, and Albert Einstein, who explained the relativity of all things, as well as catch up on all the latest news about Physics, on ScienceLibrary.info.
1736 - 1806
Charles-Augustin de Coulomb, 1736 - 1806, French physicist, whose name is the unit for electrical charge.
"Or I shall have you hung, drawn and decimalled," threatened Napoleon.
"Decimalled?" enquired Sean with a rare mélange of curious anxiety.
"Yes. The French Republic has gone metric," explained Napoleon proudly.
Website © renewable-media.com | Designed by: Andrew Bone