Traditional Culture Encyclopedia - Weather forecast - How does a string get into a repeatable array in a wsdl message?
How does a string get into a repeatable array in a wsdl message?
Nowadays, applications are becoming more and more complex, and even a single application can't do all the work. Not to mention using only one language. So you need to access the services written by others to get the data you are interested in.
When writing an application to query the database, it does not consider why the query results can be returned to the upper application. I even think this is what the database should do. Actually, it is not. This is the result of communication between the database and another application through TCP/IP protocol. The database itself doesn't know what kind of application the upper application is and what language it uses. It only knows that it has received a protocol, which is the SQL92 query standard protocol.
At present, cloud computing and cloud killing are both services, and now the more popular saying is SOA (service-oriented framework).
Since the database can provide services to other external applications according to certain standards, and it doesn't care what language the other party uses, why can't it achieve cross-platform and cross-language services?
As long as the code written in Java can be called in any language, we will realize cross-platform and cross-language services! -Network services
Therefore, WebService, as its name implies, is a Web-based service. It uses the way of Web(HTTP) to receive and respond to some requests from external systems. So as to realize remote calling.
We can call a Web service to query weather information on the Internet and then embed it into our program (C/S or B/S program). When users see the weather information of our outlets, they will think that we have provided them with a lot of information services, but in fact, we have done nothing but simply use a piece of code on the server.
Learning WebService can publish your service (a piece of code) on the Internet for others to call, or you can call the WebService published on other people's machines, just like using your own code.
(2) Basic concept: XML
Xml extensible markup language-extensible markup language
XML used to transmit formatted data is the foundation of Web services.
Namespace-Namespace.
③ Basic concept: WSDL
Wsdl-web service description language–web service description language.
Explain the location-address of the service in XML format. Address position
Explain in XML what methods services provide-how to call them. operate
(4) Basic concept: soap
Soap- Simple Object Access Protocol (Simple Object Access Protocol)
As a protocol based on XML language, SOAP is used to transmit data on the Internet.
SOAP = +XML data based on HTTP.
SOAP is based on HTTP.
SOAP consists of the following:
Envelope-required part. Displayed as the root element of XML.
Title–Optional.
Body-of course. In the body section, it contains the server method to be executed. And data are sent to the server.
Data format passed:
& lt envelope & gt
& lt title & gt& lt/Header & gt;;
& ltBody & gt
& lt method name >
Method parameter
& lt/ method name >
& lt/Body & gt;
& lt/Envelope & gt;
(5) Examples of requests:
The following is an HTTP request, but the difference is that XML data is sent to the server!
Note: (1), because the data is sent by HTTP, the HTTP protocol should be followed first.
(The XML part, namely the SOAP protocol, must contain the Envelope and Body elements.
(6), response example:
1.3 Application Notes
1, WebService completes remote call through HTTP protocol.
(1), WebService only uses HTTP POST to transmit data, and does not use GET? -handshake, WSDL-get, (based on soap protocol, the transmission data format is XML)
Generally find the wsdl of the home page service of mobile phone number:
Copy uses the wsimport command to copy the generated java code into the MobileService project.
Visiting customers:
Public static void main(String[] args) {
mobile codews MC = new mobile codews();
MobileCodeWSSoap soap = MC . getmobilecodewssoap();
string str = soap . getmobilecodeinfo(" 130 1 1286707 ",null);
system . out . println(str);
}
- Previous article:What festival is the sixth day of the sixth lunar month?
- Next article:How much does it cost to climb Mount Everest?
- Related articles
- Tencent train tickets are discounted several times a day
- What are the nemesis of mites?
- It's getting colder and colder. If girls still want to wear skirts, how should they keep warm and look good when they put on clothes?
- I want to refer to your Chinese composition.
- When a typhoon hits your birthday
- Is it true that Yangshuo travels to buy Peruvian maca in the scenic spot?
- What kind of city is Zhanjiang?
- The heavy rain continues online. What do you know about severe convective weather?
- Whose fault is this? It is predicted that it will rain tomorrow. If it rains, I'll ask my blind date. If it doesn't rain, we'll meet, okay? The result is yellow.
- Who can help me check the weather in Chongqing this year+065438+1October 27th?