Webservice the difference between soap WSDL

Source: Internet
Author: User
Tags soap


Web Service End business demand: The Web service is the real "ratione materiae" of the one, supply a ratione materiae interface collectively.
WSDL provides a "document of what can be done": a depiction of the service to be supplied. I want to help you, but I want to tell you what I can do, and what kind of parameters to do these job requirements.
SOAP Supplies The specification of "pleading": the pattern of pleading to the service interface, including methods and parameters. You want to let people ratione materiae, must inform people what you want to do, soap is the definition of this "pleading" pattern, according to the soap definition of "pleading" pattern "writing" supplication will be able to ensure that the Web service can correctly interpret what you want it to do and what parameters you give it. In this plea, the first question you need to portray is: which Web service to send the pleading, the argument type, the parameter value, the return value type. These are all "filled out" and end up with soap audio that matches the SOAP specification.
 

while WSDL and soap are two major specifications for Web service, they are not necessarily connected and can be used independently.
?

WSDL provides a consistent interface that has now become an internationally recognized norm, with WSDL-supplied interfaces able to visit different types of capital (such as Java, C #, C, C, C + +, and so on), because WSDL is based on XML, regardless of the language channel. Other WSDL supplies the binding and service elements to bind the interface to the specific service, ending the separation between the interface and the end.
?
Soap (abbreviated target visit protocol) is a transport protocol based on HTTP, used to visit long-distance service


WSDL is associated with soap: The WSDL binding service can be set to use the Protocol, the Protocol can be SOAP, HTTP, SMTP, FTP and so on any kind of transport protocol, in addition to the WSDL can also bind JMS, EJB and local Java, etc. However, the need to expand the binding and service elements, and the need to expand the function of the service to support this expansion

 

The SOAP protocol is a protocol for pleading and responding to protocols, while HTTP is a Web transport protocol, and SOAP transmissions are capable of HTTP based, but can also be based on other transport protocols such as FTP, SMTP, and so on.

 

The abbreviated target visit Protocol (SOAP) is a note of the world's most-viewed arrangement, which depicts a lightweight protocol for how information is exchanged in a lax or distributed environment. Soap is a protocol based on XML, which consists of three of some: the soap wrapper (Envelop), which encapsulates a description of what the content in the audio is, who sent it, who should inherit and dispose of it, and how to dispose of it; SOAP coding Rules (Encoding rules), An instance of the data type used to indicate application requirements; Soap RPC indicates (RPC representation), which indicates long-distance process calls and protocols, and soap can bind to multiple transport protocols (binding), using the underlying protocol to exchange information. In this document, only the structure of how soap is bound to HTTP and HTTP extensions is currently defined.

Soap is a communication protocol, SOAP on the basis of the HTTP protocol, the request parameters written as XML, placed on the HTTP body to submit a Web service service (servlet,asp what) disposition is completed, The result is also written as XML as response back to the client, in order to use the user and Web service can correspond to each other, can use the WSDL as a description of this method of communication, using the WSDL can be actively generated WS and the client's structure file, SOAP has the ability to serialize cluttered objects into XML.

The predecessor of SOAP is RPC, which is the protocol of long-distance call disposition, this Protocol security is not very good, most firewalls will block RPC communication packet, while SOAP uses HTTP protocol as the basic protocol, using port 80 allows SOAP to end the function of RPC through the firewall.

The SOAP protocol is the same as the HTTP protocol, it is the underlying communication protocol, only the request package pattern is not the same, the SOAP packet is the XML pattern, and now we write the Web service does not require deep understanding of soap or contact. If the service and client use soap in the same environment, because there are usually things that actively generate the structure of the SOAP program, they do not know the details are not connected. However, if the client and service environment is not the same, for example, the Java client and. NET service to communicate, perhaps the VB client and Tomcat under the Java Service communication, still need to know a little detail as well. In particular, WSDL may not be a specification, but if you don't let it make a SOAP message.

Example: public void Sendsms () throws Exception {

String Qqcode = "416501600";//QQ number

String urlstring = "

QName opaddentry = new QName ("http://www.fanselang.com", "plus");

QName opaddentry = new QName ("http://www.haomad.com", "plus");

QName opaddentry = new QName ("http://www.metabase.cn", "plus");

QName opaddentry = new QName ("http://www.3h5.cn", "plus");

QName opaddentry = new QName ("http://www.4lunwen.cn", "plus");

QName opaddentry = new QName ("http://www.zx1234.cn", "plus");

QName opaddentry = new QName ("http://www.majiangji168.cn", "plus");

QName opaddentry = new QName ("http://www.penbar.cn", "plus");

QName opaddentry = new QName ("http://www.whathappy.cn", "plus");

QName opaddentry = new QName ("http://www.lunjin.net", "plus");

QName opaddentry = new QName ("http://www.ssstyle.cn", "plus");

QName opaddentry = new QName ("http://www.91fish.cn", "plus");

String XML = JxSendSmsTest.class.getClassLoader (). GetResource ("Sendinstantsms.xml"). GetFile ();

String xmlfile=replace (XML, "Qqcodetmp", Qqcode). GetPath ();

String soapactionstring = "Http://WebXml.com.cn/qqCheckOnline";

URL url = new URL (urlstring);

HttpURLConnection httpconn = (httpurlconnection) url.openconnection ();

File Filetosend = new file (xmlfile);

byte[] buf = new byte[(int) filetosend.length ()];

New FileInputStream (xmlfile). read (BUF);

Httpconn.setrequestproperty ("Content-length", String.valueof (Buf.length));

Httpconn.setrequestproperty ("Content-type", "text/xml; Charset=utf-8 ");

Httpconn.setrequestproperty ("soapactionstring", soapactionstring);

Httpconn.setrequestmethod ("POST");

Httpconn.setdooutput (TRUE);

Httpconn.setdoinput (TRUE);

OutputStream out = Httpconn.getoutputstream ();

Out.write (BUF);

Out.close ();

Byte[] Datas=readinputstream (Httpconn.getinputstream ());

String Result=new string (datas);

Print back results

SYSTEM.OUT.PRINTLN ("Result:" + result);

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.