Advanced Programming Using Visual Basic 2008

Similar documents
Transport (http) Encoding (XML) Standard Structure (SOAP) Description (WSDL) Discovery (UDDI - platform independent XML)

Windows Communication Foundation

An Integrated Development Environment to Establish Web Services in Grid Computing Using.NET Framework 4.5 and Visual Basic 2012

Getting Started with WCF

MOC 6461A C#: Visual Studio 2008: Windows Communication Foundation

Remote Web Server. Develop Locally. foldername. publish project files to

Introduction to Web Services & SOA

describe the functions of Windows Communication Foundation describe the features of the Windows Workflow Foundation solution

University College of Southeast Norway. Web Services. with Examples. Hans-Petter Halvorsen,

Introduction to Web Services & SOA

Chapter 8 Web Services Objectives

JAVA COURSES. Empowering Innovation. DN InfoTech Pvt. Ltd. H-151, Sector 63, Noida, UP

WWW, REST, and Web Services

Pro WCF 4. Practical Microsoft SOA Implementation SECOND EDITION. Apress* Nishith Pathak

Distributed Multitiered Application

Enabling Embedded Systems to access Internet Resources

Chapter 9. Web Applications The McGraw-Hill Companies, Inc. All rights reserved. McGraw-Hill

Web Services Hans-Petter Halvorsen

Building Web Services with Java and SAP Web Application Server

XML Web Service? A programmable component Provides a particular function for an application Can be published, located, and invoked across the Web

Developing Windows Communication Foundation Solutions with Microsoft Visual Studio 2010

Distribution and web services

CS708 Lecture Notes. Visual Basic.NET Object-Oriented Programming. Implementing Client/Server Architectures. Part (I of?) (Lecture Notes 5A)

Services Web Nabil Abdennadher

SOAP Specification. 3 major parts. SOAP envelope specification. Data encoding rules. RPC conventions

Web Services in Cincom VisualWorks. WHITE PAPER Cincom In-depth Analysis and Review

Mastering VB.NET using Visual Studio 2010 Course Length: 5 days Price: $2,500

Web Services Introduction to Web Services Web Services can convert your applications into Web-applications. Web Services are published, found, and

RESTful Web service composition with BPEL for REST

Introduction to RESTful Web Services. Presented by Steve Ives

WCF Services in Nutshell

(9A05803) WEB SERVICES (ELECTIVE - III)

Java Web Service Essentials (TT7300) Day(s): 3. Course Code: GK4232. Overview

Getting Started with Web Services

BPEL Research. Tuomas Piispanen Comarch

Windows Communication Foundation (WCF) Visual Studio 2008

Distributed Systems. Web Services (WS) and Service Oriented Architectures (SOA) László Böszörményi Distributed Systems Web Services - 1

Hands-On Lab. Part 1: Introduction to the AppFabric Service Bus. Lab version: Last updated: 11/16/2010. Page 1

Understanding RESTful APIs and documenting them with Swagger. Presented by: Tanya Perelmuter Date: 06/18/2018

Getting Started with the Bullhorn SOAP API and C#/.NET

Glossary of Exchange Network Related Groups

Getting Started with Web Services

juddi Developer Guide

Lotus Exam Using Web Services in IBM Lotus Domino 7 Applications Version: 5.0 [ Total Questions: 90 ]

Routing and security for remote labs for teaching and research (SRS-E-LABO)

Session 12. RESTful Services. Lecture Objectives

Synchronization of Services between the IBM WebSphere Services Registry & Repository and SAP s Services Registry

SUN. Java Platform Enterprise Edition 6 Web Services Developer Certified Professional

Apex TG India Pvt. Ltd.

OPC UA Configuration Manager Help 2010 Kepware Technologies

Sistemi ICT per il Business Networking

CmpE 596: Service-Oriented Computing

Programming Web Services in Java

Chapter 12 Microsoft Assemblies. Software Architecture Microsoft Assemblies 1

Advanced WCF 4.0 .NET. Web Services. Contents for.net Professionals. Learn new and stay updated. Design Patterns, OOPS Principles, WCF, WPF, MVC &LINQ

Cloud Enabling.NET Client Applications ---

WCF-Service-Endpoint. WCF Endpoint Components

Web Services Development for IBM WebSphere Application Server V7.0

Developing Windows Communication Foundation Solutions with Microsoft Visual Studio 2010

CIS 764 Tutorial. By Vamsee Raja Jarugula.

XML Applications. Introduction Jaana Holvikivi 1

Communication Foundation

The SOAP Story. Martin Parry Developer & Platform Group Microsoft Ltd

Implementing a Ground Service- Oriented Architecture (SOA) March 28, 2006

Realisation of SOA using Web Services. Adomas Svirskas Vilnius University December 2005

HP Service Test. Tutorial. for the Windows operating systems. Software Version: 11.10

Windows Communication Foundation Using C#

BEAWebLogic Server. WebLogic Web Services: Advanced Programming

OPC UA Configuration Manager PTC Inc. All Rights Reserved.

Web-Based Systems. INF 5040 autumn lecturer: Roman Vitenberg

Service oriented Middleware (SOM)

Web Services: Introduction and overview. Outline

JBoss SOAP Web Services User Guide. Version: M5

Web-APIs. Examples Consumer Technology Cross-Domain communication Provider Technology

1.264 Lecture 14. SOAP, WSDL, UDDI Web services

TPF Users Group Fall 2007

Project Overview. CSE 403, Spring 2004 Software Engineering Samuel Kim University of Washington

Java CAPS Creating a Simple Web Service from a JCD

IT6503 WEB PROGRAMMING. Unit-I

Sentinet for BizTalk Server SENTINET

UNIT - V. 1. What is the concept behind JAX-RPC technology? (NOV/DEC 2011)

Activating AspxCodeGen 4.0

Introduzione ai Web Services

Java Development and Grid Computing with the Globus Toolkit Version 3

SERVICE-ORIENTED COMPUTING

MarkLogic Server. Information Studio Developer s Guide. MarkLogic 8 February, Copyright 2015 MarkLogic Corporation. All rights reserved.

Neuron Change History

Delivery Options: Attend face-to-face in the classroom or remote-live attendance.

Services Oriented Architecture and the Enterprise Services Bus

Windows Communication Foundation Using C#

Web Services Security. Dr. Ingo Melzer, Prof. Mario Jeckle

Installing CaseMap Server User Guide

Semantic Web. Semantic Web Services. Morteza Amini. Sharif University of Technology Fall 94-95

A short introduction to Web Services

IUID Registry Application Programming Interface (API) Version 5.6. Software User s Manual (SUM)

Installing CaseMap Server User Guide

Introduction to.net FX 3.0 (+ sneak preview of.net FX 3.5)

Lab Manual Visual Studio Team Architect Edition

Web Services DELMIA Apriso 2017 Implementation Guide

DEVELOPING WEB AZURE AND WEB SERVICES MICROSOFT WINDOWS AZURE

Transcription:

Chapter 6 Services Part 1 Introduction to Services Advanced Programming Using Visual Basic 2008 First There Were Web Services A class that can be compiled and stored on the Web for an application to use Instantiate the class from Windows or Web applications A Web/Windows application consumes (uses) the service Instantiate means to create an run time instance of the class an object The object resides in volatile memory 2 Web Services as Components They are like components that have been created for multi-tier applications They are made available via the Web Can be publicly available Can be privately available on a intranet Can have a cost associated with them 3 1

Integral Technologies Web services employ additional services/technologies XML extensible markup language SOAP simple object access protocol WSDL web service definition language UDDI Universal description, discovery, and integration.net handles many of the details if you develop with Visual Studio 4 History of Web Services They are not a Microsoft technology See: From EDI To XML And UDDI: A Brief History Of Web Services at http://www.informationweek.com/news/so ftware/development/showarticle.jhtml?ar ticleid=6506480 5 XML Web Services Many Web services use XML Thus they are XML Web Services Not all Web Services use XML Web Services can be created using many languages/platforms 6 2

After Web Services At Microsoft, Inc. Windows Communication Foundation Microsoft s technology for communicating between applications Broader than Web Services Supported in VS 2008 Web services are also supported in VS 2008 A Word from Microsoft Windows Communication Foundation (WCF) is Microsoft s unified programming model for building service-oriented applications. It enables developers to build secure, reliable, transacted solutions that integrate across platforms and interoperate with existing investments. http://msdn.microsoft.com/en-us/library/ms735119.aspx 3

Communication and Services - Concepts message SOAP response Application running Service running (might itself be a service) http://msdn.microsoft.com/en-us/library/ms731082.aspx Messaging and Endpoints - Messaging Model: message-based communication anything that can be modeled as a message (HTTP request, e.g.) can be represented in a uniform way in the programming model unified API across different transport mechanisms Clients: applications that initiate communication Services: applications that wait for clients to communicate with them and then respond to that communication single application can act as both a client and a service Messages are sent between endpoints Messaging and Endpoints - Endpoints Endpoints: places where messages are sent or received (or both) and they define all the information required for the message exchange client app must generate an endpoint compatible with target service's s endpoint endpoint describes in a standards-based way where messages should be sent, how they should be sent, and what the messages should look like services expose the requirements as metadata so that client apps can be built 4

More Acronyms Pertinent to Services Universal Resource Identifier (URI) uniquely identifies a resource on the Web More generic term than URL URI is preferred to URL for technical specifications i.e., URL is Old Hat now Each Web project must have a target namespace Default: http://tempuri.org Default OK for development but not for production URI of a site you control for production See http://www.w3.org/addressing/ 13 Alphabet Soup Technologies (continued) Services employ additional services/technologies XML extensible markup language SOAP simple object access protocol WSDL web service definition language UDDI Universal description, discovery, and integration.net handles many of the details if you develop with Visual Sudio 14 XML- Extensible Markup Language Tags mark up data according to what type of data it is e.g. <street address>4292 Eagle Ridge</street address> Facilitates data transfer across platforms Transmitted in text format with markup Text data can pass through firewalls, whereas binary data often is not allowed 15 5

SOAP - Simple Object Access Protocol Standard for sending data Protocol for handling requests and responses that includes class names, method names, and parameters Works with XML Does not include a specific protocol for transporting response/request packets Transport protocol is usually HTTP 16 WCF s WS Discovery Provides search mechanism for available services Directory service for services The Add Web Reference dialog in Visual Studio IDE allows you to search for an existing service Can access UDDI registries- Universal Description, Discovery, and Integration UDDI directory service for web services 17 WSDL- Web Services Description Language Controls format of calls to methods in Web Services Contains information (metadata) about names of the methods parameters that can be passed values that are returned from the functions 18 6

Create a WCF Service Adapted from Bradley & Millspaugh pp. 252-256 Create a WCF Service- 1 Open Visual Studio File New Project WCF Service Develop locally on usb or desktop or at home on file space When complete: publish to icnn web folder icnn is a subfolder of your class web folder, nn is the next number in the sequence 20 Create a WCF Service -2 Name the WCF service WCFService1 (the default name) 21 7

Create a WCF Service -3 Files created include.vb,.svc,.config types No user interface Why? You are designing a component for others to use and incorporate into their interface 22 Create a WCF Service -4 Rename the service (in Solution Explorer) Change Service1.svc to FirstSvc.svc Use the properties window Show all files in Solution Explorer Doubleclick to open FirstSvc.svc.vb 23 Create a WCF Service -5 With FirstSvc.svc.vb open Change the name of the Public Class to FirstSvc Change Implements to IFirstSvc Rename IService.vb to IFirstSvc.vb Open web.config Change references to Service1 and IService1 to FirstSvc and IFirstSvc 24 8

Create a WCF Service -6 Create Operation Contracts for two Public methods First one is a HelloWorld message function Open IFirstSvc.vb and add the HelloWorld contract where you see the comment TODO <OperationContract()> _ Function HelloWorld() As String 25 Create a WCF Service -7 First one is a contract for an ExtendedPrice calculator function Open IFirstSvc.vb and add the ExtendedPrice contract <OperationContract()> _ Function ExtendedPrice(ByVal Price As Decimal, ByVal Quantity As Integer) As Decimal Delete the other operation contracts that are provided as part of the default setup 26 Additional Info From Microsoft Getting Started Tutorial http://msdn.microsoft.com/enus/library/ms734712(v=vs.90).aspx When creating a basic WCF service first task is to define a contract Contract states what operations the service supports operation = Web service method 27 9

Additional Info From Microsoft (cont) Create a contract by defining a Visual Basic (VB) interface Each interface method is a specific service operation 28 Additional Info From Microsoft (cont) Each interface must have the ServiceContractAttribute applied to it <ServiceContract()> _ Public Interface IFirstSvc Each operation must have the OperationContractAttribute applied to it <OperationContract()> _ Function functionname(arguments) As type If method does not have the OperationContractAttribute, the method is not exposed 29 Create a WCF Service -8 Add contracts for calculator operations (as shown in Microsoft tutorial) <OperationContract()> _ Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double <OperationContract()> _ Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double <OperationContract()> _ Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double <OperationContract()> _ Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double 30 10

Create a WCF Service -9 Code the service methods Open FirstSvc.svc.vb. Code as shown. Public Sub New End Sub Public Function HelloWorld() As String _ Implements IHWSvc.HelloWorld Return Hello World! Make your string a little bit different and unique to you End Function 31 Create a WCF Service -10 Continue. Code as shown. Public Function ExtendedPrice(ByVal Price As Decimal, ByVal Quantity As Integer) As Decimal _ Implements IFirstSvc.ExtendedPrice Return Price * Quantity End Function 32 Additional Info from Microsoft Creating a WCF service First you createf the contracts Contracts are defined using an interface The next step is to implement the interface Create a class FirstSvc that implements the user-defined IFirstSvc interface 33 11

Create a WCF Service -11 Continue. Code as shown. Public Function Add(ByVal n1 As Double, ByVal n2 As Double) As Double Implements IFirstSvc.Add Dim result As Double = n1 + n2 Return result End Function Public Function Subtract(ByVal n1 As Double, ByVal n2 As Double) As Double Implements IFirstSvc.Subtract Dim result As Double = n1 - n2 Return result End Function 34 Create a WCF Service -12 Continue. Code as shown. Public Function Multiply(ByVal n1 As Double, ByVal n2 As Double) As Double Implements IFirstSvc.Multiply Dim result As Double = n1 * n2 Return result End Function Public Function Divide(ByVal n1 As Double, ByVal n2 As Double) As Double Implements IFirstSvc.Divide Dim result As Double = n1 / n2 Return result End Function 35 Create a WCF Service -13 Save all files Now the service contract is created and implemented. Build the solution to ensure there are no compilation errors Note and fix errors 36 12

Test the Service Run w/o debugging 37 Test the Service Read the message Click on the link Working! at some level 13

Create a WCF Service -14 Your turn add an operation Open IFirstSvc.vb and write the operation contract Then open FirstSvc.svc.vb and create the function 40 Create a WCF Service -15 Save and Build or Rebuild Run w/o debugging Click on the link Read the message Click on the link Scroll down to see references to your new function 41 Publish Publish your service to the icnn subweb of your subweb on the class server From the Build menu in Visual Studio, choose Publish enter the url http://cot-itec4339-02.cougarnet.uh.edu/fall2010/lastnamef/icnn 42 14

Call the Service to Check the Publish Operation Enter the url into a browser: http://cot-itec4339-02.cougarnet.uh.edu/spring10/lastnamef/icnn/firstsvc.svc End of Chapter 6 Services Part 1 Introduction to Services Advanced Programming Using Visual Basic 2008 15