DOC PREVIEW
CMU ISM 95702 - Axis

This preview shows page 1-2-3-20-21-22-41-42-43 out of 43 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 43 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Apache SOAP and the Java API for XML Messaging (JAXM)Slide 2Slide 3Slide 4Slide 5Slide 6What is SOAP?What is Axis?Who competes with Axis?Axis ArchitectureAxis WSDL SupportWSDLSlide 13Slide 14Slide 15Example ClientSlide 17Slide 18On The ServerSlide 20Web Service DeploymentSlide 22SOAP To ServerSlide 24SOAP Back To ClientSlide 26Use WSDL2JavaCode Generation using WSDLBigCalcClient.javaBut We Are Still Working With StringsSlide 31Slide 32Write the ClientSlide 34Slide 35Slide 36SOAP To ClientEvents and NotificationsDistributed Event Based SystemsTwo Characteristics of Distributed Event Based SystemsSlide 41Slide 42Slide 431Apache SOAPand the Java API for XML Messaging (JAXM)Notes from the Axis User’s Guideand the books “Java Web Services” by Deitel and “Distributed Systems Concepts and Design” by Coulouris2Middleware layersApplicationsMiddlewarelayers Request reply protocolExternal data representationOperating SystemRMI, RPC and events3Remote and local method invocationsinvocation invocationremoteinvocationremotelocallocallocalinvocationinvocationABCDEF4A remote object and its remote interfaceinterfaceremotem1m2m3m4m5m6Dataimplementationremoteobject{of methods5Invocation semanticsFault tolerance measuresInvocation semanticsRetransmit request messageDuplicate filteringRe-execute procedure or retransmit replyNoYesYesNot applicableNoYesNot applicableRe-execute procedureRetransmit reply At-most-onceAt-least-onceMaybe6The role of proxy and skeleton in remote method invocationobject Aobject BskeletonRequestproxy for BReplyCommunicationRemote Remote referenceCommunication module modulereference module modulefor B’s class& dispatcherremoteclient server7What is SOAP?•XML-based communication protocol•XML-based encoding format•Supports inter-application communication•Cross platform•Cross Language8What is Axis?•Apache Extensible Integration System•Axis began as IBM’s SOAP4J•A Framework for constructing SOAP clients and servers•Written in Java9Who competes with Axis?•CapeConnect from CapeClear•GLUE Standard from MindElectric•Orbix E2A XMLBus 5.2 From IONA•WASP Server for Java 4.0 from Systinet10Axis ArchitectureClientTransportListenerProviderJavaClassMessage Handlers11Axis WSDL Support• The Web Service Description Language is a machine readable description of a web service• Given a WSDL document generate communication stubs (WSDL2Java)• Given a Java based web services generate WSDL (Java2WSDL)12WSDL•An Interface Definition Language (IDL)•Java RMI uses Java Remote Interfaces•An IDL is needed when languages differ•Other example IDL’s•Corba IDL (Object-oriented syntax)•OSF’s DCE (C like syntax)•DCOM IDL based on OSF’s DCE and used by Microsoft’s DCOM•Sun XDR (An IDL for RPC)13CORBA IDL example// In file Person.idlstruct Person {string name; string place;long year;} ;interface PersonList {readonly attribute string listname;void addPerson(in Person p) ;void getPerson(in string name, out Person p);long number();};14File interface in Sun XDR (Originally External Data Representation but now an IDL) const MAX = 1000;typedef int FileIdentifier;typedef int FilePointer;typedef int Length;struct Data {int length;char buffer[MAX];};struct writeargs {FileIdentifier f;FilePointer position;Data data;};struct readargs {FileIdentifier f;FilePointer position;Length length;};program FILEREADWRITE { version VERSION {void WRITE(writeargs)=1; // procedureData READ(readargs)=2; // numbers }=2; // version number} = 9999; // program number// numbers passed in request message// rpcgen is the interface compiler15WSDL•Given a Description of a service (WSDL document) Axis uses wsdl2java to create the client code•Given a Java service, Axis uses java2wsdl to generate a description (WSDL document)•wsdl2java is an interface compiler16Example Clientimport org.apache.axis.client.Call;import org.apache.axis.client.Service;import org.apache.axis.encoding.XMLType;import javax.xml.namespace.QName;import javax.xml.rpc.ParameterMode;public class Client{ public static void main(String [] args) { try { if(args.length != 2) { System.out.println("usage:java Client BigInt BigInt"); System.exit(-1); }17Service service = new Service(); Call call = (Call) service.createCall(); // hold data about the servicecall.setTargetEndpointAddress( new java.net.URL("http://localhost:8080/axis/servlet/AxisServlet") );call.setOperationName( new QName("BigCalculatorService", "add") );call.addParameter( "arg1", XMLType.XSD_STRING, ParameterMode.IN);call.addParameter( "arg2", XMLType.XSD_STRING, ParameterMode.IN);call.setReturnType( org.apache.axis.encoding.XMLType.XSD_STRING ); // This code does not look like normal// application code!18 String ret = (String) call.invoke( new Object[] { args[0],args[1] } ); System.out.println("The BigCalculator Service computed : " + ret); } catch (Exception e) { System.err.println(e.toString()); } }}19On The Server // copy compiled code to the axis/WEB-INF/classes directoryimport java.math.*;public class BigCalculator { public String add(String i1, String i2) { BigInteger x = new BigInteger(i1); BigInteger y = new BigInteger(i2); return new String(x.add(y).toString()); } public String subtract(String i1, String i2) { BigInteger x = new BigInteger(i1); BigInteger y = new BigInteger(i2); return new String(x.subtract(y).toString()); } //This code does not look //like normal server side Java!20public static void main(String args[]) { BigCalculator bc = new BigCalculator(); String a = bc.add("9999999999999","1"); System.out.println(a); }} STEPS :javac BigCalculator.javaCopy BigCalculator.class to D:\jwsdp-1.2\webapps\axis\WEB-INF\classesStartup Tomcatadminclient deploy.wsddjava org.apache.axis.client.AdminClient deploy.wsddProcessing file deploy.wsdd<Admin>Done processing</Admin>21Web Service Deployment<!-- deploy.wsdd --><!-- tell axis about this deployment with java org.apache.axis.client.AdminClient deploy.wsdd--><deployment xmlns="http://xml.apache.org/axis/wsdd/" xmlns:java="http://xml.apache.org/axis/wsdd/providers/java"> <service name="BigCalculatorService" provider="java:RPC"> <parameter name="className" value="BigCalculator"/> <parameter name="allowedMethods" value="*"/> </service></deployment>22java Client 1 999999999999999999999999999999999The BigCalculator Service computed :


View Full Document

CMU ISM 95702 - Axis

Documents in this Course
Homework

Homework

12 pages

Lecture

Lecture

25 pages

Lecture

Lecture

21 pages

Lecture

Lecture

24 pages

Exam

Exam

11 pages

Homework

Homework

16 pages

Homework

Homework

38 pages

lecture

lecture

38 pages

review

review

7 pages

lecture

lecture

18 pages

review

review

8 pages

Chapter2

Chapter2

32 pages

Lecture 4

Lecture 4

47 pages

Lecture

Lecture

22 pages

Naming

Naming

26 pages

lecture

lecture

34 pages

lecture

lecture

42 pages

lecture

lecture

112 pages

Lecture

Lecture

33 pages

lecture

lecture

32 pages

review

review

17 pages

Lecture

Lecture

53 pages

Lecture

Lecture

80 pages

Lab

Lab

14 pages

Load more
Download Axis
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Axis and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Axis 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?