Presentation 10 SOAP on the Microsoft Platform (.NET)

19
Presentation 10 SOAP on the Microsoft Platform (.NET)

description

Presentation 10 SOAP on the Microsoft Platform (.NET). Outline. You have already been introduced to SOAP, WSDL & UDDI on the JAVA platform using AXIS Now we will take a look at the MS . NET platforms SOAP capabilities - PowerPoint PPT Presentation

Transcript of Presentation 10 SOAP on the Microsoft Platform (.NET)

Page 1: Presentation 10  SOAP on the Microsoft Platform (.NET)

Presentation 10

SOAP on the Microsoft Platform (.NET)

Page 2: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 2 af 20

Outline

• You have already been introduced to SOAP, WSDL & UDDI on the JAVA platform using AXIS

• Now we will take a look at the MS . NET platforms SOAP capabilities

• Luckily – SOAP & WSDL are well standardized – so we do not need to look at these again

• Instead we will:– Show the counterpart of the AXIS project in .NET - IIS– Show the alternatives to JAVA development – using the

tools from Microsoft Visual Studio .NET

Page 3: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 3 af 20

Apache Tomcat vs. Microsoft Internet Information Server

• Apache Tomcat with AXIS & J2SE Java SDK– Works on:

• Windows, UNIX, LINUX• Open source Can be compiled to any platform (with some work)

– Server listening for events: • HTTP on port 8080 (optional)• Executes Servlets/JSP

– AXIS is an embedded project within the Tomcat environment but works with most J2EE compliant AS• Microsoft Internet Information Server with the .NET Framework SDK (ASP.NET)

– Works on:• Only Windows

– Server listening for events:• HTTP on port 80 (optional)• Executes Web resources – ASP.NET, Web services, Web forms (resulting in client side HTML )

– Tightly integrated with the Visual Studio .NET – for easy deployment & debugging

SOAP ClientJava, C++, C#,

Delphi, VB Application

SOAP ClientJava, C++, C#,

Delphi, VB Application

SOAP over HTTPSOAP over HTTP

Web ServerMS Internet Information Server

& the .NET Framework SDK(ASP.NET)

(vs. Apache Tomcat, with AXIS & J2SE SDK)

Web ServerMS Internet Information Server

& the .NET Framework SDK(ASP.NET)

(vs. Apache Tomcat, with AXIS & J2SE SDK)

Web FormsWeb Forms

WebService

WebService

C++ unman.C++

unman.

Managedcode

Managedcode

Common code base – but only MS!Common code base – but only MS!

Page 4: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 4 af 20

Web service enabling Windows

• You need to:– Install .NET Framework SDK

• Download from Microsoft (130 MB)

– Install Internet Information Server• Enabled via the Control Panel

– Visual Studio .NET• Already installed (7 or 7.1)

• More detailed instructions will follow for the LAB exercise

Page 5: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 5 af 20

Not a Windows ASP.NET course

• You will NOT be required to be an expert on .NET• You will be required to be knowledgeable about it

• ASP.NET is a framework for Web enabling Windows code

• Traditional HTML & DHTML – and Web services• Complete architecture

Page 6: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 6 af 20

Ressources for learning more

• Feel free to learn more about ASP.NET:– Getting started with the .NET framework– http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpcongettingstarte

dwithnetframework.asp

– Link can be found at the course site– Books on the subject

• Beginning .NET Web Services using C# by Joseph Bustos and Karli Watsom (WROK forlag)

• More will be listed on the course site

Page 7: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 7 af 20

Making the HelloWorld application

• Using Notepad !• Using Microsoft Visual Studio .NET• First:

– Install .NET Framework– Install IIS

• Then:– Produce code

• Manually for Notepad• Wizard for Visual Studio

– Deploy in the IIS folder • \inetpub\wwwroot\• As an .asmx file

– Test the Webservice• Using the build in functionality

– Write the Client – and all is well

Page 8: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 8 af 20

C# Notepad HelloWorld

Page 9: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 9 af 20

Deploy & Test

Page 10: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 10 af 20

Developing the Client application

• Support for using Web services in an Visual Studio application

• Stubs are automatically compiled by Visual Studio

Page 11: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 11 af 20

New Application & Add Web Reference

Page 12: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 12 af 20

Discover & bind the Web service

Page 13: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 13 af 20

Visual Studio produces a Proxy DLL

Performed by Visual Studio tool:a DLL is generated (Web Service Proxy Generator), and a header fileand a WSDL support document is madeavailable

Page 14: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 14 af 20

Write the C++ code

Page 15: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 15 af 20

Try it out

Page 16: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 16 af 20

Piece of Cake – Now C#

Page 17: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 17 af 20

C# - coding the connection

Page 18: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 18 af 20

Heterogeneous system C# to Java

Proxy DLL stubgenerated by VS

Proxy DLL skeletongenerated by AXIS

// Hello World.Java

public class HelloWorld {

public HelloWorld() { } public String getHelloWorldMessage(String name) { return "Hello World to "+name; }}

private void button1_Click(object sender, System.EventArgs e){ localhost.HelloWorldService hello = new localhost.HelloWorldService(); textBox1.Text = hello.getHelloWorldMessage("Stefan");}

Page 19: Presentation 10  SOAP on the Microsoft Platform (.NET)

Ingeniørhøjskolen i ÅrhusSlide 19 af 20

Try it with C++

• WARNING: In VS7 there seems to be a bug!– Need to manually paste the

WSDL file and compile the proxy stub DLL

– This works fine in C#– No problem in VS7.1