1 ! 2 " #$ %#& %'()% " #$ % * + % -" & % & % " # " '() # % & % / 0 % 0 0 # 0#& , #$ + . # '() % # & #& & 1 3 . # "2 ( + % 3 4 " +3 3 2 3 4& 5 % 5 3 4& 5 ) % 3 3 4& 5%1 6 4& 5 3 7 , 82 / + ) 9 )) 3 3 % " #$ '() # 6 : 3 : 2 % % + 1 : 31 % <% ; 3 = 8 : 7 2 8 8 " : 2 # 1 % % # ) 4& 5 Soap proxy XML/HTTP Soap listener Client application Component Vendor A Vendor B 9 9 10 11 ( $ 82 4& 5 5 > =% % > % % 7 5> 4& 5 % % 7 12 ( 2 %3 4& 5 3 % 4& 52 <X1>12</X1> ?@ % " A 2 <X1 xsd:type="String">12</X1> 13 2 82 8% / 5 8 + 5 8)8 8 3 2 3 3 14 9 )) 3 9 )) ; < ) % % + &) * 4 1 1 15 9 )) 9 )) 2 )% % ; 8 < B()% GET /index.html?campo=valore HTTP/1.0 - % 3 8 = 3 ) 16 17 2 : + 31 2 5+ / 2 + ) + C 18 2 ! " # $ & ' % ( ' 19 2 = 5 3 5 3 + ' =2 D 1 20 2 : 3 + EF =2 G % / 3 G 2 + =2 G / + 21 4& 5 4& 52 3 4& 5 4& 5 -5 5 :-- 4& 5 22 2 B 4& 5 . 2 4& 5 3 + - -5 5 + :-- + 2 6 : - 8%- 2 + 23 Internet HTML Response GET/POST Request Server (s) Internet Client SOAP Response SOAP Request Server (s) 24 " 25 " -5 :-- 2 H8 5 :-- + I Service Registry Scopre WSDL UDDI Registry Service Consumer Registra WSDL Service Provider SOAP (HTTP + XML) Appl. Client Appl. Server Proxy Service Contract 26 J" 5 4& 5 + G" : -5 3 3 27 -52 WSDL1.1 Document Structure - ! 2 " " / " #$ # - -5 :-- % & " & # %& # & 28 " -5 : -5 3 K 4& 52 )8 2 & 2 5 )8 2 3 $ + 2 % % % % % 2 8 " 29 2 ( % 1 4 3 ) ) 7 4 L M 2DD.* 30 ) 2 - 8 + 8 ) 31 2 + + 8 ) 2 , ) 8 , 2 ) , ) 2 2 , 8 ) 2 , , 8 ) 23 ) , / 1 3 8 *2 0 32 ) + 2 3 ) 3 % 2DD = 2EFEF 33 : 3 0 %9 )& 5% % % % 2 MyWebApplication/ WEB-INF classes lib MyWebApplication 5 INF% + 1 WEB- 2 + 5 + .class 5+ WEB-INF + + % % + .jar web.xml% classes% lib% / % / images MyWebApplication webapps ) % = = + % % / + 8 34 H 2 C :#5 5+ H 3 = 35 C C *C H C 1 % = 1 36 C " -5 -5% -5 H % 3 3 = 37 5 *5 + H 38 : ( . 3 % / 3 //File Esempio1.java /* Classe che implementa il servizio. */ public class Esempio1{ /* Metodo che implementa il servizio. * Questo servizio restituisce una stringa di saluto. **/ public String saluto(){ return "Ciao Mondo"; } } 39 ) !** classes + AdminClient 40 -' -N % O 2 % -- 3 <deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="Esempio1" provider="java:RPC"> <parameter name="className" value="Esempio1"/> <parameter name="allowedMethods" value="saluto"/> <parameter name="scope" value="Request"/> </service> </deployment> 41 " - 3 % )9 "5 3 )9 % 42 ' -5 43 2 @ 0 8 ;. < % P ;. < % 8 H = :#5% 2DD 2EFEFD H D( K. -5 = ;! < :#5 + * 2 44 0 " 3 / 3 5 1 . " --% 0 H * + 45 0 ( = % 8 46 5 2 + % + " -5% +:#5 % import import import import " 3 % % java.net.*; java.rmi.*; javax.xml.namespace.*; javax.xml.rpc.*; import org.apache.axis.client.Call; import org.apache.axis.client.Service; public class ClientEsempio1{ . . . 47 5 2 public static void main(String[] args){ String messaggio = ""; try{ Call call = (Call)new Service().createCall(); call.setTargetEndpointAddress( new URL("http://localhost:8080/axis/services/")); call.setOperationName(new QName("Esempio1", "saluto")); Object rispostaWS = call.invoke(new Object[]{}); messaggio = "il Web service ha risposto:" + (String)rispostaWS; } catch(MalformedURLException ex){messaggio = "errore: l'url non è esatta";} catch(ServiceException ex){messaggio = "errore: la creazione della chiamata è fallita";} catch(RemoteException ex){messaggio = "errore: l'invocazione del WS è fallita";} finally{ System.out.println(messaggio); } } } 48 -8 " 5 " <?xml version="1.0" encoding="UTF-8"?> <SOAP-ENV:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <SOAP-ENV:Body> <ns1:Echo2 xmlns:ns1="http://localhost:8080/axis/Echo.jws"> <arg0 xsi:type="xsd:string">Hello!</arg0> </ns1:echoService> </SOAP-ENV:Body> </SOAP-ENV:Envelope> 49 " 50 5 ) . ' 3 5+ 5 2B -5@0 7 -5 % ; % < ;Q +:#5 5 < -5 51 5 2B -5@0 52 " 53 B C -5 54 B :#5 -52 http://api.google.com/GoogleSearch.wsdl " 2 java org.apache.axis.wsdl.WSDL2Java http://api.google.com/GoogleSearch.wsdl # 2 8" 8. B $ . B . B # . B . B 5 . # ( . 55 B /** * GoogleSearchPort.java * * This file was auto-generated from WSDL * by the Apache Axis 1.2.1 Jun 14, 2005 (09:15:57 EDT) WSDL2Java emitter. */ package GoogleSearch; public interface GoogleSearchPort extends java.rmi.Remote { public byte[] doGetCachedPage(java.lang.String key, java.lang.String url) throws java.rmi.RemoteException; public java.lang.String doSpellingSuggestion(java.lang.String key, java.lang.String phrase) throws java.rmi.RemoteException; public GoogleSearch.GoogleSearchResult doGoogleSearch(java.lang.String key, java.lang.String q, int start, int maxResults, boolean filter, java.lang.String restrict, boolean safeSearch, java.lang.String lr, java.lang.String ie, java.lang.String oe) throws java.rmi.RemoteException; } 56 B - % + 5+ 1 % B 1 -5 % + % % ?FFF 57 : 2 ) :#5 2DD M D( H! , 58 " 59