{"id":445,"date":"2024-02-05T17:00:21","date_gmt":"2023-11-21T07:55:13","guid":{"rendered":"https:\/\/www.silicloud.com\/zh\/blog\/index.php\/2023\/11\/30\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/"},"modified":"2025-08-02T09:48:58","modified_gmt":"2025-08-02T01:48:58","slug":"%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful","status":"publish","type":"post","link":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/","title":{"rendered":"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848"},"content":{"rendered":"<p>\u6b22\u8fce\u6765\u5230\u8be6\u7ec6\u7b54\u6848\u7684Web\u670d\u52a1\u9762\u8bd5\u95ee\u9898\u3002\u6700\u8fd1\u6211\u5199\u4e86\u5f88\u591a\u5173\u4e8eWeb\u670d\u52a1\u7684\u5185\u5bb9\uff0c\u5305\u62ec\u5982\u4f55\u5728Java\u4e2d\u521b\u5efaSOAP\u548cRESTful\u7684Web\u670d\u52a1\u3002<\/p>\n<h2>Web\u670d\u52a1\u9762\u8bd5\u95ee\u9898<\/p>\n<p>\u5728\u8fd9\u91cc\uff0c\u6211\u63d0\u4f9b\u7ed9\u4f60\u4e00\u4efd\u7f51\u7edc\u670d\u52a1\u9762\u8bd5\u95ee\u9898\u7684\u5217\u8868\uff0c\u4ee5\u5e2e\u52a9\u4f60\u5728\u9762\u8bd5\u4e2d\u3002\u9996\u5148\uff0c\u6709\u4e00\u4e9b\u901a\u7528\u7684\u7f51\u7edc\u670d\u52a1\u6982\u5ff5\u95ee\u9898\uff0c\u56e0\u4e3a\u5b83\u5e76\u4e0d\u7279\u5b9a\u4e8e\u6280\u672f\u6216\u8bed\u8a00\uff0c\u7136\u540e\u6211\u4eec\u6709\u4e00\u4e9b\u9488\u5bf9Java\u7f51\u7edc\u670d\u52a1\u7684\u9762\u8bd5\u95ee\u9898\u3002<\/p>\n<ol>SOAP Web Services have the following advantages:<\/p>\n<p>1. Platform and language independent: SOAP is based on XML, making it compatible with different platforms and languages.<br \/>\n2. Enhanced security: SOAP supports multiple security protocols such as WS-Security, ensuring secure communication between client and server.<br \/>\n3. Reliable messaging: SOAP provides reliable messaging features, ensuring the delivery of messages even in the presence of network failures.<br \/>\n4. Extensibility: SOAP allows the use of different add-ons and extensions, making it highly customizable.<br \/>\n5. Supports complex operations: SOAP supports complex operations such as distributed transactions and coordination of multiple services.<br \/>\n6. Wide industry support: SOAP is widely supported in the industry with well-defined standards and specifications.<\/ol>\n<pre class=\"post-pre\"><code>SOAP web services have all the advantages that web services has, some of the additional advantages are:\r\n-   WSDL document provides contract and technical details of the web services for client applications without exposing the underlying implementation technologies.\r\n-   SOAP uses XML data for payload as well as contract, so it can be easily read by any technology.\r\n-   SOAP protocol is universally accepted, so it's an industry standard approach with many easily available open source implementations.\r\n<\/code><\/pre>\n<ol>SOAP Web Services\u6709\u54ea\u4e9b\u7f3a\u70b9?<\/ol>\n<pre class=\"post-pre\"><code>Some of the disadvantages of SOAP protocol are:\r\n-   Only XML can be used, JSON and other lightweight formats are not supported.\r\n-   SOAP is based on the contract, so there is a tight coupling between client and server applications.\r\n-   SOAP is slow because payload is large for a simple string message, since it uses XML format.\r\n-   Anytime there is change in the server side contract, client stub classes need to be generated again.\r\n-   Can't be tested easily in browser\r\n<\/code><\/pre>\n<ol>WSDL\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>WSDL stands for Web Service Description Language. WSDL is an XML based document that provides technical details about the web service. Some of the useful information in WSDL document are: method name, port types, service end point, binding, method parameters etc.\r\n<\/code><\/pre>\n<ol>WSDL\u6709\u54ea\u4e9b\u4e0d\u540c\u7684\u7ec4\u6210\u90e8\u5206\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Some of the different tags in WSDL xml are:\r\n-   xsd:import namespace and schemaLocation: provides WSDL URL and unique namespace for web service.\r\n-   message: for method arguments\r\n-   part: for method argument name and type\r\n-   portType: service name, there can be multiple services in a wsdl document.\r\n-   operation: contains method name\r\n-   soap:address for endpoint URL.\r\n<\/code><\/pre>\n<ol>\u4ec0\u4e48\u662fUDDI\uff1f<\/ol>\n<pre class=\"post-pre\"><code>UDDI is acronym for Universal Description, Discovery and Integration. UDDI is a directory of web services where client applications can lookup for web services. Web Services can register to the UDDI server and make them available to client applications.\r\n<\/code><\/pre>\n<ol>SOAP \u7f51\u7edc\u670d\u52a1\u4e2d\u7684\u201c\u81ea\u9876\u5411\u4e0b\u201d\u548c\u201c\u81ea\u5e95\u5411\u4e0a\u201d\u65b9\u6cd5\u6709\u54ea\u4e9b\u533a\u522b\uff1f<\/ol>\n<pre class=\"post-pre\"><code>In Top Down approach first WSDL document is created to establish the contract between web service and client and then code is written, it's also termed as contract first approach. This is hard to implement because classes need to be written to confirm the contract established in WSDL. Benefit of this approach is that both client and server code can be written in parallel. In Bottom Up approach, first web service code is written and then WSDL is generated. It's also termed as contract last approach. This approach is easy to implement because WSDL is generated based on code. In this approach client code have to wait for WSDL from server side to start their work.\r\n<\/code><\/pre>\n<ol>REST\u7f51\u7edc\u670d\u52a1\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>REST is the acronym for REpresentational State Transfer. REST is an architectural style for developing applications that can be accessed over the network. REST architectural style was brought in light by Roy Fielding in his doctoral thesis in 2000. REST is a stateless client-server architecture where web services are resources and can be identified by their URIs. Client applications can use HTTP GET\/POST methods to invoke Restful web services. REST doesn\u2019t specify any specific protocol to use, but in almost all cases it\u2019s used over HTTP\/HTTPS. When compared to SOAP web services, these are lightweight and doesn\u2019t follow any standard. We can use XML, JSON, text or any other type of data for request and response.\r\n<\/code><\/pre>\n<ol>REST\u7f51\u7edc\u670d\u52a1\u7684\u4f18\u70b9\u6709\u54ea\u4e9b\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Some of the advantages of REST web services are:\r\n-   Learning curve is easy since it works on HTTP protocol\r\n-   Supports multiple technologies for data transfer such as text, xml, json, image etc.\r\n-   No contract defined between server and client, so loosely coupled implementation.\r\n-   REST is a lightweight protocol\r\n-   REST methods can be tested easily over browser.\r\n<\/code><\/pre>\n<ol>REST Web\u670d\u52a1\u6709\u54ea\u4e9b\u7f3a\u70b9\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Some of the disadvantages of REST are:\r\n-   Since there is no contract defined between service and client, it has to be communicated through other means such as documentation or emails.\r\n-   Since it works on HTTP, there can't be asynchronous calls.\r\n-   Sessions can't be maintained.\r\n<\/code><\/pre>\n<ol>\u5728RESTful\u7f51\u7edc\u670d\u52a1\u4e2d\uff0c\u8d44\u6e90\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Resource is the fundamental concept of Restful architecture. A resource is an object with a type, relationship with other resources and methods that operate on it. Resources are identified with their URI, HTTP methods they support and request\/response data type and format of data.\r\n<\/code><\/pre>\n<ol>\u5728Restful Web\u670d\u52a1\u4e2d\u652f\u6301\u54ea\u4e9b\u4e0d\u540c\u7684HTTP\u65b9\u6cd5\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Restful web services supported HTTP methods are - GET, POST, PUT, DELETE and HEAD.\r\n<\/code><\/pre>\n<ol>\u6bd4\u8f83SOAP\u548cREST\u7f51\u7edc\u670d\u52a1\u3002<\/ol>\n<pre class=\"post-pre\"><code>&lt;!--\r\n&lt;style&gt;.tg {border-collapse:collapse;border-spacing:0;border-color:#999;} .tg td{font-family:Arial, sans-serif;font-size:14px;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#999;color:#444;background-color:#F7FDFA;} .tg th{font-family:Arial, sans-serif;font-size:14px;font-weight:normal;padding:10px 5px;border-style:solid;border-width:1px;overflow:hidden;word-break:normal;border-color:#999;color:#fff;background-color:#26ADE4;} .tg .tg-baqh{text-align:center;vertical-align:top} .tg .tg-6k2t{background-color:#D2E4FC;vertical-align:top} .tg .tg-yw4l{vertical-align:top}&lt;\/style&gt;\r\n--&gt;\r\n\r\n| SOAP | REST  \r\n |\r\n| --- | --- |\r\n| SOAP is a standard protocol for creating web services.  \r\n | REST is an architectural style to create web services.  \r\n |\r\n| SOAP is acronym for Simple Object Access Protocol. | REST is acronym for REpresentational State Transfer. |\r\n| SOAP uses WSDL to expose supported methods and technical details.  \r\n | REST exposes methods through URIs, there are no technical details.  \r\n |\r\n| SOAP web services and client programs are bind with WSDL contract  \r\n | REST doesn't have any contract defined between server and client  \r\n |\r\n| SOAP web services and client are tightly coupled with contract.  \r\n | REST web services are loosely coupled.  \r\n |\r\n| SOAP learning curve is hard, requires us to learn about WSDL generation, client stubs creation etc.  \r\n | REST learning curve is simple, POJO classes can be generated easily and works on simple HTTP methods.  \r\n |\r\n| SOAP supports XML data format only  \r\n | REST supports any data type such as XML, JSON, image etc.  \r\n |\r\n| SOAP web services are hard to maintain, any change in WSDL contract requires us to create client stubs again and then make changes to client code.  \r\n | REST web services are easy to maintain when compared to SOAP, a new method can be added without any change at client side for existing resources.  \r\n |\r\n| SOAP web services can be tested through programs or software such as Soap UI.  \r\n | REST can be easily tested through CURL command, Browsers and extensions such as Chrome Postman.  \r\n |\r\n<\/code><\/pre>\n<ol>\u6d4b\u8bd5\u7f51\u9875\u670d\u52a1\u6709\u54ea\u4e9b\u4e0d\u540c\u7684\u65b9\u6cd5\uff1f<\/ol>\n<pre class=\"post-pre\"><code>SOAP web services can be tested programmatically by generating client stubs from WSDL or through software such as Soap UI. REST web services can be tested easily with program, curl commands and through browser extensions. Resources supporting GET method can be tested with browser itself, without any program.\r\n<\/code><\/pre>\n<ol>\u6211\u4eec\u80fd\u5728\u7f51\u7edc\u670d\u52a1\u4e2d\u7ef4\u6301\u7528\u6237\u4f1a\u8bdd\u5417\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Web services are stateless so we can't maintain user sessions in web services.\r\n<\/code><\/pre>\n<ol>SOA\u548cWeb\u670d\u52a1\u7684\u533a\u522b\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Service Oriented Architecture (SOA) is an architectural pattern where applications are designed in terms of services that can be accessed through communication protocol over network. SOA is a design pattern and doesn't go into implementation. Web Services can be thought of as Services in SOAP architecture and providing means to implement SOA pattern.\r\n<\/code><\/pre>\n<ol>HTTP\u8bf7\u6c42\u4e2d\u7684Accept\u548cContent-Type\u5934\u90e8\u6709\u4ec0\u4e48\u7528\u9014\uff1f<\/ol>\n<pre class=\"post-pre\"><code>These are important headers in Restful web services. Accept headers tells web service what kind of response client is accepting, so if a web service is capable of sending response in XML and JSON format and client sends Accept header as \"application\/xml\" then XML response will be sent. For Accept header \"application\/json\", server will send the JSON response. Content-Type header is used to tell server what is the format of data being sent in the request. If Content-Type header is \"application\/xml\" then server will try to parse it as XML data. This header is useful in HTTP Post and Put requests.\r\n<\/code><\/pre>\n<ol>\u4f60\u4f1a\u5982\u4f55\u9009\u62e9SOAP\u548cREST\u7f51\u7edc\u670d\u52a1\u4e4b\u95f4\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Web Services work on client-server model and when it comes to choose between SOAP and REST, it all depends on project requirements. Let's look at some of the conditions affecting our choice:\r\n-   Do you know your web service clients beforehand? If Yes, then you can define a contract before implementation and SOAP seems better choice. But if you don't then REST seems better choice because you can provide sample request\/response and test cases easily for client applications to use later on.\r\n-   How much time you have? For quick implementation REST is the best choice. You can create web service easily, test it through browser\/curl and get ready for your clients.\r\n-   What kind of data format are supported? If only XML then you can go with SOAP but if you think about supporting JSON also in future then go with REST.\r\n<\/code><\/pre>\n<ol>\u4ec0\u4e48\u662fJAX-WS API\uff1f<\/ol>\n<pre class=\"post-pre\"><code>JAX-WS stands for Java API for XML Web Services. JAX-WS is XML based Java API to build web services server and client application. It\u2019s part of standard Java API, so we don\u2019t need to include anything else which working with it. Refer to [JAX-WS Tutorial](\/community\/tutorials\/jax-ws-tutorial) for a complete example.\r\n<\/code><\/pre>\n<ol>\u8bf7\u5217\u4e3e\u4e00\u4e9b\u7528Java\u5b9e\u73b0SOAP Web\u670d\u52a1\u7684\u6846\u67b6\u3002<\/ol>\n<pre class=\"post-pre\"><code>We can create SOAP web services using JAX-WS API, however some of the other frameworks that can be used are Apache Axis and Apache CXF. Note that they are not implementations of JAX-WS API, they are totally different framework that work on Servlet model to expose your business logic classes as SOAP web services. Read more at [Java SOAP Web Service Eclipse](\/community\/tutorials\/soap-webservices-in-java-example-eclipse) example.\r\n<\/code><\/pre>\n<ol>\u5728JAX-WS API\u4e2d\uff0c\u6709\u54ea\u4e9b\u91cd\u8981\u7684\u6ce8\u89e3\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Some of the important annotations used in JAX-WS API are:\r\n-   @WebService\r\n-   @SOAPBinding\r\n-   @WebMethod\r\n<\/code><\/pre>\n<ol>javax.xml.ws.Endpoint\u7c7b\u7684\u7528\u9014\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Endpoint class provides useful methods to create endpoint and publish existing implementation as web service. This comes handy in testing web services before making further changes to deploy it on actual server.\r\n<\/code><\/pre>\n<ol>RPC \u98ce\u683c\u548c\u6587\u6863\u98ce\u683c\u7684SOAP\u7f51\u7edc\u670d\u52a1\u6709\u4ec0\u4e48\u533a\u522b\uff1f<\/ol>\n<pre class=\"post-pre\"><code>RPC style generate WSDL document based on the method name and it's parameters. No type definitions are present in WSDL document. Document style contains type and can be validated against predefined schema. Let's look at these with a simple program. Below is a simple test program where I am using Endpoint to publish my simple SOAP web service. `TestService.java`\r\n\r\n```\r\npackage com.Olivia.jaxws.service;\r\n\r\nimport javax.jws.WebMethod;\r\nimport javax.jws.WebService;\r\nimport javax.jws.soap.SOAPBinding;\r\nimport javax.xml.ws.Endpoint;\r\n\r\n@WebService\r\n@SOAPBinding(style = SOAPBinding.Style.RPC)\r\npublic class TestService {\r\n\r\n\t@WebMethod\r\n\tpublic String sayHello(String msg){\r\n\t\treturn \"Hello \"+msg;\r\n\t}\r\n\t\r\n\tpublic static void main(String[] args){\r\n\t\tEndpoint.publish(\"https:\/\/localhost:8888\/testWS\", new TestService());\r\n\t}\r\n}\r\n```\r\n\r\nWhen I run above program and then access the WSDL, it gives me below XML. `rpc.xml`\r\n\r\n```\r\n&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;!-- Published by JAX-WS RI (https:\/\/jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. --&gt;&lt;!-- Generated by JAX-WS RI (https:\/\/jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. --&gt;\r\n&lt;definitions xmlns:wsu=\"https:\/\/docs.oasis-open.org\/wss\/2004\/01\/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:wsp=\"https:\/\/www.w3.org\/ns\/ws-policy\" xmlns:wsp1_2=\"https:\/\/schemas.xmlsoap.org\/ws\/2004\/09\/policy\" xmlns:wsam=\"https:\/\/www.w3.org\/2007\/05\/addressing\/metadata\" xmlns:soap=\"https:\/\/schemas.xmlsoap.org\/wsdl\/soap\/\" xmlns:tns=\"https:\/\/service.jaxws.scdev.com\/\" xmlns:xsd=\"https:\/\/www.w3.org\/2001\/XMLSchema\" xmlns=\"https:\/\/schemas.xmlsoap.org\/wsdl\/\" targetNamespace=\"https:\/\/service.jaxws.scdev.com\/\" name=\"TestServiceService\"&gt;\r\n&lt;types\/&gt;\r\n&lt;message name=\"sayHello\"&gt;\r\n&lt;part name=\"arg0\" type=\"xsd:string\"\/&gt;\r\n&lt;\/message&gt;\r\n&lt;message name=\"sayHelloResponse\"&gt;\r\n&lt;part name=\"return\" type=\"xsd:string\"\/&gt;\r\n&lt;\/message&gt;\r\n&lt;portType name=\"TestService\"&gt;\r\n&lt;operation name=\"sayHello\"&gt;\r\n&lt;input wsam:Action=\"https:\/\/service.jaxws.scdev.com\/TestService\/sayHelloRequest\" message=\"tns:sayHello\"\/&gt;\r\n&lt;output wsam:Action=\"https:\/\/service.jaxws.scdev.com\/TestService\/sayHelloResponse\" message=\"tns:sayHelloResponse\"\/&gt;\r\n&lt;\/operation&gt;\r\n&lt;\/portType&gt;\r\n&lt;binding name=\"TestServicePortBinding\" type=\"tns:TestService\"&gt;\r\n&lt;soap:binding transport=\"https:\/\/schemas.xmlsoap.org\/soap\/http\" style=\"rpc\"\/&gt;\r\n&lt;operation name=\"sayHello\"&gt;\r\n&lt;soap:operation soapAction=\"\"\/&gt;\r\n&lt;input&gt;\r\n&lt;soap:body use=\"literal\" namespace=\"https:\/\/service.jaxws.scdev.com\/\"\/&gt;\r\n&lt;\/input&gt;\r\n&lt;output&gt;\r\n&lt;soap:body use=\"literal\" namespace=\"https:\/\/service.jaxws.scdev.com\/\"\/&gt;\r\n&lt;\/output&gt;\r\n&lt;\/operation&gt;\r\n&lt;\/binding&gt;\r\n&lt;service name=\"TestServiceService\"&gt;\r\n&lt;port name=\"TestServicePort\" binding=\"tns:TestServicePortBinding\"&gt;\r\n&lt;soap:address location=\"https:\/\/localhost:8888\/testWS\"\/&gt;\r\n&lt;\/port&gt;\r\n&lt;\/service&gt;\r\n&lt;\/definitions&gt;\r\n```\r\n\r\nNotice that **types** element is empty and we can't validate it against any schema. Now just change the `SOAPBinding.Style.RPC` to `SOAPBinding.Style.DOCUMENT` and you will get below WSDL. `document.xml`\r\n\r\n```\r\n&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;!-- Published by JAX-WS RI (https:\/\/jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. --&gt;&lt;!-- Generated by JAX-WS RI (https:\/\/jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. --&gt;\r\n&lt;definitions xmlns:wsu=\"https:\/\/docs.oasis-open.org\/wss\/2004\/01\/oasis-200401-wss-wssecurity-utility-1.0.xsd\" xmlns:wsp=\"https:\/\/www.w3.org\/ns\/ws-policy\" xmlns:wsp1_2=\"https:\/\/schemas.xmlsoap.org\/ws\/2004\/09\/policy\" xmlns:wsam=\"https:\/\/www.w3.org\/2007\/05\/addressing\/metadata\" xmlns:soap=\"https:\/\/schemas.xmlsoap.org\/wsdl\/soap\/\" xmlns:tns=\"https:\/\/service.jaxws.scdev.com\/\" xmlns:xsd=\"https:\/\/www.w3.org\/2001\/XMLSchema\" xmlns=\"https:\/\/schemas.xmlsoap.org\/wsdl\/\" targetNamespace=\"https:\/\/service.jaxws.scdev.com\/\" name=\"TestServiceService\"&gt;\r\n&lt;types&gt;\r\n&lt;xsd:schema&gt;\r\n&lt;xsd:import namespace=\"https:\/\/service.jaxws.scdev.com\/\" schemaLocation=\"https:\/\/localhost:8888\/testWS?xsd=1\"\/&gt;\r\n&lt;\/xsd:schema&gt;\r\n&lt;\/types&gt;\r\n&lt;message name=\"sayHello\"&gt;\r\n&lt;part name=\"parameters\" element=\"tns:sayHello\"\/&gt;\r\n&lt;\/message&gt;\r\n&lt;message name=\"sayHelloResponse\"&gt;\r\n&lt;part name=\"parameters\" element=\"tns:sayHelloResponse\"\/&gt;\r\n&lt;\/message&gt;\r\n&lt;portType name=\"TestService\"&gt;\r\n&lt;operation name=\"sayHello\"&gt;\r\n&lt;input wsam:Action=\"https:\/\/service.jaxws.scdev.com\/TestService\/sayHelloRequest\" message=\"tns:sayHello\"\/&gt;\r\n&lt;output wsam:Action=\"https:\/\/service.jaxws.scdev.com\/TestService\/sayHelloResponse\" message=\"tns:sayHelloResponse\"\/&gt;\r\n&lt;\/operation&gt;\r\n&lt;\/portType&gt;\r\n&lt;binding name=\"TestServicePortBinding\" type=\"tns:TestService\"&gt;\r\n&lt;soap:binding transport=\"https:\/\/schemas.xmlsoap.org\/soap\/http\" style=\"document\"\/&gt;\r\n&lt;operation name=\"sayHello\"&gt;\r\n&lt;soap:operation soapAction=\"\"\/&gt;\r\n&lt;input&gt;\r\n&lt;soap:body use=\"literal\"\/&gt;\r\n&lt;\/input&gt;\r\n&lt;output&gt;\r\n&lt;soap:body use=\"literal\"\/&gt;\r\n&lt;\/output&gt;\r\n&lt;\/operation&gt;\r\n&lt;\/binding&gt;\r\n&lt;service name=\"TestServiceService\"&gt;\r\n&lt;port name=\"TestServicePort\" binding=\"tns:TestServicePortBinding\"&gt;\r\n&lt;soap:address location=\"https:\/\/localhost:8888\/testWS\"\/&gt;\r\n&lt;\/port&gt;\r\n&lt;\/service&gt;\r\n&lt;\/definitions&gt;\r\n```\r\n\r\nOpen schemaLocation URL in browser and you will get below XML. `schemaLocation.xml`\r\n\r\n```\r\n&lt;?xml version='1.0' encoding='UTF-8'?&gt;\r\n&lt;!-- Published by JAX-WS RI (https:\/\/jax-ws.java.net). RI's version is JAX-WS RI 2.2.10 svn-revision#919b322c92f13ad085a933e8dd6dd35d4947364b. --&gt;\r\n&lt;xs:schema xmlns:tns=\"https:\/\/service.jaxws.scdev.com\/\" xmlns:xs=\"https:\/\/www.w3.org\/2001\/XMLSchema\" version=\"1.0\" targetNamespace=\"https:\/\/service.jaxws.scdev.com\/\"&gt;\r\n\r\n&lt;xs:element name=\"sayHello\" type=\"tns:sayHello\"\/&gt;\r\n\r\n&lt;xs:element name=\"sayHelloResponse\" type=\"tns:sayHelloResponse\"\/&gt;\r\n\r\n&lt;xs:complexType name=\"sayHello\"&gt;\r\n&lt;xs:sequence&gt;\r\n&lt;xs:element name=\"arg0\" type=\"xs:string\" minOccurs=\"0\"\/&gt;\r\n&lt;\/xs:sequence&gt;\r\n&lt;\/xs:complexType&gt;\r\n\r\n&lt;xs:complexType name=\"sayHelloResponse\"&gt;\r\n&lt;xs:sequence&gt;\r\n&lt;xs:element name=\"return\" type=\"xs:string\" minOccurs=\"0\"\/&gt;\r\n&lt;\/xs:sequence&gt;\r\n&lt;\/xs:complexType&gt;\r\n&lt;\/xs:schema&gt;\r\n```\r\n\r\nSo here WSDL document can be validated against the schema definintion.\r\n<\/code><\/pre>\n<ol>\u5982\u4f55\u83b7\u53d6SOAP Web\u670d\u52a1\u7684WSDL\u6587\u4ef6\uff1f<\/ol>\n<pre class=\"post-pre\"><code>WSDL document can be accessed by appending ?wsdl to the SOAP endoint URL. In above example, we can access it at `https:\/\/localhost:8888\/testWS?wsdl` location.\r\n<\/code><\/pre>\n<ol>sun-jaxws.xml\u6587\u4ef6\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>This file is used to provide endpoints details when JAX-WS web services are deployed in servlet container such as Tomcat. This file is present in WEB-INF directory and contains endpoint name, implementation class and URL pattern. For example; `sun-jaxws.xml`\r\n\r\n```\r\n&lt;?xml version=\"1.0\" encoding=\"UTF-8\"?&gt;\r\n&lt;endpoints xmlns=\"https:\/\/java.sun.com\/xml\/ns\/jax-ws\/ri\/runtime\" version=\"2.0\"&gt;\r\n  &lt;endpoint\r\n     name=\"PersonServiceImpl\"\r\n     implementation=\"com.Olivia.jaxws.service.PersonServiceImpl\"\r\n     url-pattern=\"\/personWS\"\/&gt;\r\n&lt;\/endpoints&gt;\r\n```\r\n<\/code><\/pre>\n<ol>\u4ec0\u4e48\u662fJAX-RS API\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Java API for RESTful Web Services (JAX-RS) is the Java API for creating REST web services. JAX-RS uses annotations to simplify the development and deployment of web services. JAX-RS is part of JDK, so you don\u2019t need to include anything to use it\u2019s annotations.\r\n<\/code><\/pre>\n<ol>\u5217\u4e3e\u4e00\u4e9bJAX-RS API\u7684\u5b9e\u73b0\u65b9\u5f0f\u3002<\/ol>\n<pre class=\"post-pre\"><code>There are two major implementations of JAX-RS API.\r\n1.  Jersey: Jersey is the reference implementation provided by Sun. For using Jersey as our JAX-RS implementation, all we need to configure its servlet in web.xml and add required dependencies. Note that JAX-RS API is part of JDK not Jersey, so we have to add its dependency jars in our application.\r\n2.  RESTEasy: RESTEasy is the JBoss project that provides JAX-RS implementation.\r\n<\/code><\/pre>\n<ol>wsimport\u5b9e\u7528\u5de5\u5177\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>We can use wsimport utility to generate the client stubs. This utility comes with standard installation of JDK. Below image shows an example execution of this utility for one of JAX-WS project. [![wsimport, parse wsdl, web services interview questions, restful interview questions, soap interview questions](https:\/\/scdev.nyc3.cdn.digitaloceanspaces.com\/2015\/10\/wsimport-utility-parse-wsdl-450x293.png)](https:\/\/scdev.nyc3.cdn.digitaloceanspaces.com\/2015\/10\/wsimport-utility-parse-wsdl.png)\r\n<\/code><\/pre>\n<ol>\u5728JAX-RS API\u4e2d\u4f7f\u7528\u7684\u91cd\u8981\u6ce8\u91ca\u7684\u540d\u79f0\u662f\u4ec0\u4e48\uff1f<\/ol>\n<pre class=\"post-pre\"><code>Some of the important JAX-RS annotations are:\r\n-   `@Path`: used to specify the relative path of class and methods. We can get the URI of a webservice by scanning the Path annotation value.\r\n-   `@GET`, `@PUT`, `@POST`, `@DELETE` and `@HEAD`: used to specify the HTTP request type for a method.\r\n-   `@Produces`, `@Consumes`: used to specify the request and response types.\r\n-   `@PathParam`: used to bind the method parameter to path value by parsing it.\r\n<\/code><\/pre>\n<ol>@XmlRootElement\u6ce8\u91ca\u6709\u4ec0\u4e48\u7528\u9014\uff1f<\/ol>\n<pre class=\"post-pre\"><code>XmlRootElement annotation is used by JAXB to transform java object to XML and vice versa. So we have to annotate model classes with this annotation.\r\n<\/code><\/pre>\n<ol>\u5982\u4f55\u5728HTTP\u54cd\u5e94\u4e2d\u8bbe\u7f6e\u4e0d\u540c\u7684\u72b6\u6001\u7801\uff1f<\/ol>\n<pre class=\"post-pre\"><code>For setting HTTP status code other than 200, we have to use `javax.ws.rs.core.Response` class for response. Below are some of the sample return statements showing it's usage.\r\n\r\n```\r\nreturn Response.status(422).entity(exception).build();\r\nreturn Response.ok(response).build(); \/\/200\r\n```\r\n\r\nFor a complete example, please read [RESTEasy Tutorial](\/community\/tutorials\/resteasy-tutorial-eclipse-tomcat).\r\n<\/code><\/pre>\n<p>\u8fd9\u5c31\u662f\u5173\u4e8eweb\u670d\u52a1\u9762\u8bd5\u95ee\u9898\u7684\u5168\u90e8\uff0c\u6b22\u8fce\u901a\u8fc7\u8bc4\u8bba\u544a\u8bc9\u6211\u4f60\u7684\u60f3\u6cd5\u3002\u5982\u679c\u4f60\u8ba4\u4e3a\u6211\u6f0f\u6389\u4e86\u4e00\u4e9b\u91cd\u8981\u7684\u95ee\u9898\uff0c\u8bf7\u5728\u8bc4\u8bba\u4e2d\u544a\u8bc9\u6211\uff0c\u6211\u5c06\u5f88\u4e50\u610f\u56de\u7b54\u5e76\u5c06\u5176\u6dfb\u52a0\u5230\u5217\u8868\u4e2d\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6b22\u8fce\u6765\u5230\u8be6\u7ec6\u7b54\u6848\u7684Web\u670d\u52a1\u9762\u8bd5\u95ee\u9898\u3002\u6700\u8fd1\u6211\u5199\u4e86\u5f88\u591a\u5173\u4e8eWeb\u670d\u52a1\u7684\u5185\u5bb9\uff0c\u5305\u62ec\u5982\u4f55\u5728Java\u4e2d\u521b\u5efaSOAP\u548cR [&hellip;]<\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[267,1386,1385,1384,942],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-api","tag-restful","tag-soap","tag-1384","tag-942"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v21.5 (Yoast SEO v21.5) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848 - Blog - Silicon Cloud<\/title>\n<meta name=\"description\" content=\"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u95ee\u9898-soap\uff0crestful\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848\" \/>\n<meta property=\"og:description\" content=\"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.silicloud.com\/zh\/blog\/\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u95ee\u9898-soap\uff0crestful\/\" \/>\n<meta property=\"og:site_name\" content=\"Blog - Silicon Cloud\" \/>\n<meta property=\"article:published_time\" content=\"2023-11-21T07:55:13+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-08-02T01:48:58+00:00\" \/>\n<meta name=\"author\" content=\"\u5b87, \u534e\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"\u5b87, \u534e\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/\",\"name\":\"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848 - Blog - Silicon Cloud\",\"isPartOf\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\"},\"datePublished\":\"2023-11-21T07:55:13+00:00\",\"dateModified\":\"2025-08-02T01:48:58+00:00\",\"author\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\"},\"description\":\"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002\",\"breadcrumb\":{\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.silicloud.com\/zh\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#website\",\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/\",\"name\":\"Blog - Silicon Cloud\",\"description\":\"\",\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458\",\"name\":\"\u5b87, \u534e\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g\",\"caption\":\"\u5b87, \u534e\"},\"url\":\"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/\"},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#local-main-organization-logo\",\"url\":\"\",\"contentUrl\":\"\",\"caption\":\"Blog - Silicon Cloud\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848 - Blog - Silicon Cloud","description":"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.silicloud.com\/zh\/blog\/\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u95ee\u9898-soap\uff0crestful\/","og_locale":"zh_CN","og_type":"article","og_title":"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848","og_description":"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002","og_url":"https:\/\/www.silicloud.com\/zh\/blog\/\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u95ee\u9898-soap\uff0crestful\/","og_site_name":"Blog - Silicon Cloud","article_published_time":"2023-11-21T07:55:13+00:00","article_modified_time":"2025-08-02T01:48:58+00:00","author":"\u5b87, \u534e","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"\u5b87, \u534e","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"1 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/","url":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/","name":"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848 - Blog - Silicon Cloud","isPartOf":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website"},"datePublished":"2023-11-21T07:55:13+00:00","dateModified":"2025-08-02T01:48:58+00:00","author":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458"},"description":"\u5168\u9762\u89e3\u6790SOAP\u548cRESTful\u7f51\u9875\u670d\u52a1\u7684\u6838\u5fc3\u9762\u8bd5\u95ee\u9898\uff0c\u5305\u542b\u5e38\u89c1\u95ee\u9898\u7b54\u6848\u548c\u5b9e\u6218\u6280\u5de7\u3002\u5e2e\u52a9\u5f00\u53d1\u8005\u51c6\u5907\u6280\u672f\u9762\u8bd5\uff0c\u6df1\u5165\u7406\u89e3\u4e24\u79cd\u4e3b\u6d41Web Services\u67b6\u6784\u7684\u5f02\u540c\u4e0e\u5e94\u7528\u573a\u666f\u3002\u63d0\u5347\u9762\u8bd5\u6210\u529f\u7387\uff0c\u6210\u4e3a\u7f51\u9875\u670d\u52a1\u5f00\u53d1\u4e13\u5bb6\u3002","breadcrumb":{"@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.silicloud.com\/zh\/blog\/"},{"@type":"ListItem","position":2,"name":"\u5168\u9762\u638c\u63e1SOAP\u548cRESTful\uff1a\u7f51\u9875\u670d\u52a1\u9762\u8bd5\u5fc5\u5907\u95ee\u9898\u4e0e\u7b54\u6848"}]},{"@type":"WebSite","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#website","url":"https:\/\/www.silicloud.com\/zh\/blog\/","name":"Blog - Silicon Cloud","description":"","inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/513018e4e121d3add1b7c5de8be21458","name":"\u5b87, \u534e","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/63cd45cbc05a35fc4ff7637a163c83c4962ef58d27472726c3a3e0c9c5194f0f?s=96&d=mm&r=g","caption":"\u5b87, \u534e"},"url":"https:\/\/www.silicloud.com\/zh\/blog\/author\/yuhua\/"},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.silicloud.com\/zh\/blog\/%e7%bd%91%e9%a1%b5%e6%9c%8d%e5%8a%a1%e9%9d%a2%e8%af%95%e9%97%ae%e9%a2%98-soap%ef%bc%8crestful\/#local-main-organization-logo","url":"","contentUrl":"","caption":"Blog - Silicon Cloud"}]}},"_links":{"self":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/445","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/comments?post=445"}],"version-history":[{"count":3,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":110055,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/posts\/445\/revisions\/110055"}],"wp:attachment":[{"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/media?parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/categories?post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.silicloud.com\/zh\/blog\/wp-json\/wp\/v2\/tags?post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}