SOAP SOAP xml version1 0 soap Envelope xmlns
- Slides: 29
Въведение в SOAP § Скелет на SOAP съобщение <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Header> . . . </soap: Header> <soap: Body> . . . <soap: Fault>. . . </soap: Fault> </soap: Body> </soap: Envelope> 4
Въведение в SOAP § Елемент SOAP BODY § SOAP отговорът изглежда по следния начин: <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body> <m: Get. Price. Response xmlns: m="http: //www. w 3 schools. com/prices"> <m: Price>1. 90</m: Price> </m: Get. Price. Response> </soap: Body> </soap: Envelope> 10
SOAP и HTTP Синтаксис Content-Type: MIMEType; charset=character-encoding POST /item HTTP/1. 1 Content-Type: application/soap+xml; charset=utf-8 Пример § Заглавието Content-Length за SOAP запитване и отговор специфицира брой байтове в тялото на запитването или отговора. Content-Length: bytes Синтаксис POST /item HTTP/1. 1 Content-Type: application/soap+xml; charset=utf-8 Content-Length: 250 Пример 15
SOAP - пример § Запитване Get. Stock. Price се изпраща към сървъра. Запитването има параметър Stock. Name. Параметърът Price ще се върне в отговор. Областта данни за функцията е дефинирана на адрес: http: //www. example. org/stock. SOAP запитване POST /In. Stock HTTP/1. 1 Host: www. example. org Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body xmlns: m="http: //www. example. org/stock"> <m: Get. Stock. Price> <m: Stock. Name>IBM</m: Stock. Name> </m: Get. Stock. Price> </soap: Body> </soap: Envelope> 16
SOAP - пример SOAP отговор HTTP/1. 1 200 OK Content-Type: application/soap+xml; charset=utf-8 Content-Length: nnn <? xml version="1. 0"? > <soap: Envelope xmlns: soap="http: //www. w 3. org/2001/12/soap-envelope" soap: encoding. Style="http: //www. w 3. org/2001/12/soap-encoding"> <soap: Body xmlns: m="http: //www. example. org/stock"> <m: Get. Stock. Price. Response> <m: Price>34. 5</m: Price> </m: Get. Stock. Price. Response> </soap: Body> </soap: Envelope> 18
WSDL § WSDL Binding § Елементът <binding> дефинира формата на съобщението и особеностите на протокола за всеки порт. § WSDL пример Опростен WSDL документ <message name="get. Term. Request"> <part name="term" type="xs: string"/> </message> <message name="get. Term. Response"> <part name="value" type="xs: string"/> </message> <port. Type name="glossary. Terms"> <operation name="get. Term"> <input message="get. Term. Request"/> <output message="get. Term. Response"/> </operation> </port. Type> 22
WSDL § WSDL Ports § Операция One-way – пример <message name="new. Term. Values"> <part name="term" type="xs: string"/> Порт "glossary. Terms" <part name="value" type="xs: string"/> дефинира операция one </message> -way с име "set. Term" <port. Type name="glossary. Terms"> <operation name="set. Term"> <input name="new. Term" message="new. Term. Values"/> </operation> </port. Type > § Операцията "set. Term" позволява вход на нови съобщения, използвайки съобщението "new. Term. Values" с входни параметри "term" и "value". Но не е дефиниран изход за операцията. 25
WSDL § WSDL Ports § Операция Request-response – пример <message name="get. Term. Request"> <part name="term" type="xs: string"/> </message> <message name="get. Term. Response"> Порт "glossary. Terms" <part name="value" type="xs: string"/> дефинира операция </message> request-response <port. Type name="glossary. Terms"> наречена "get. Term". <operation name="get. Term"> <input message="get. Term. Request"/> <output message="get. Term. Response"/> </operation> </port. Type> § Операция "get. Term" изисква входно съобщение, наречено "get. Term. Request" с параметър "term“ и ще върне изходно съобщение, наречено "get. Term. Response" с параметър "value". 26
WSDL § WSDL Binding (свързване към) SOAP § WSDL bindings дефинира формат на съобщението и детайлите на протокола за web услугата. § Операция Request-response – пример <message name="get. Term. Request"> <part name="term" type="xs: string"/> </message> <message name="get. Term. Response"> <part name="value" type="xs: string"/> </message> <port. Type name="glossary. Terms"> <operation name="get. Term"> <input message="get. Term. Request"/> <output message="get. Term. Response"/> </operation> </port. Type> 1/2 27
WSDL § WSDL Binding (свързване. Два атрибута на елемента към) SOAP – име на връзката; § Операция Request-response –binding: name пример type – указва порта на връзката (glossary. Terms) <binding type="glossary. Terms" name="b 1"> 2/2 <soap: binding style="document" transport="http: //schemas. xmlsoap. org/soap/http" /> <operation> <soap: operation soap. Action="http: //example. com/get. Term"/> <input> <soap: body use="literal"/> </input> Два атрибута на елемента <output> soap: binding: style – document; <soap: body use="literal"/> transport – дефинира SOAP </output> протокола за използване (http) </operation> </binding> 28
- Slidetodoc
- Version1 0
- Version1 0
- Atribut primeri
- Xmlns:xsi
- Protocol
- Soap envelope structure
- Java soap xml 파싱
- Nucleus diagram
- To kill a mockingbird context
- Hyponichium
- O que escrever em um envelope de carta
- Envelope nuclear
- Suede envelopes
- What is envelope theorem
- Prepaid parcel post satchels
- Predefined sets of different shapes group
- Uraikan jenis menu yang merupakan flyout dari shape tool
- Nucleoplasm
- Single slit envelope
- Wcp envelope
- Hot potato teaching strategy
- Glass envelope in x-ray tube
- Gaseous envelope of the sun
- French envelope contraception
- Immediate side shift bennett movement
- Carrier envelope phase
- Cell theory timeline
- Vertical wave
- Sealed envelope