Você está na página 1de 16

INT-5: Integrate over the Web with OpenEdge® Web Services

Matt Harrison

Integre pela Internet com os Web


Services OpenEdge®

Luciano Oliveira
Solution Consultant,
Progress OpenEdge

Foco da Sessão
Implementando OpenEdge Web Services

ƒ Entendendo Web Services


ƒ Identificar quando utilizar Web Services
ƒ Implementando um OpenEdge service
consumer
ƒ Implementando um OpenEdge service provider

2 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
1
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Agenda
Integrando via Web com OpenEdge Web Services

ƒ O Valor do Web Services


ƒ OpenEdge Web Service Provider
ƒ Cliente ABL como Consumidor

3 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

O que é Web Services?


Web Services é Definido por Padrões

ƒ Web Services
• Padrões que definem para plataformas como
construir, distribuir e fazer interoperabilidade
entre aplicações
• OpenEdge Web Services utiliza padrões W3C
• Simple Object Access Protocol (SOAP)
• Web Service Definition Language (WSDL)
• XML

W3C = World Wide Web Consortium, http://www.w3.org/

4 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
2
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Padrão: SOAP
Simple Object Access Protocol

ƒ SOAP é o protocolo para troca de


mensagens entre aplicações e;
ƒ SOAP é baseado em XML
ƒ SOAP é independente de Plataforma
ƒ SOAP é independente de Linguagem
ƒ SOAP é simples e extendível

5 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Standards: WSDL
Web Services Description Language

ƒ Específica Interface
• Enlaçamento entre as operações
– SOAP over HTTP
• Métodos de negócios podem ser chamados
(“operations”)
• Estrutura de mensagem para cada método
– Data fields, types
ƒ Identifica na rede o endereço Web service

“Contrato” entre Fornecedor e Consumidor


6 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
3
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Consumidor e Fornecedor

ƒ Fornecedor Web Service


• Desenvolve e Implementa o Web service
• Publica o WSDL
ƒ Consumidor Web Service
• Escreve códigos para acessar os serviços ‘deployed’
baseado no WSDL

Web service SOAP Web service


Consumidor over HTTP Fornecedor
Client

7 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

O Valor do Web Services

ƒ Por que utilizar Web Services


• Aplicações Heterogêneas
• Valores de OpenEdge são disponíveis
• Muitos Consumidores
ƒ Por que não utilizar Web Services
• Aplicações Homogêneas
• Pode não ‘dar conta do recado’

Por que utilizar Progress Web Services?


A Progress faz isso Fácil.

8 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
4
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Web Services

ƒ Heterogêneo
ƒ Distribuído
ƒ Interoperabilidade
ƒ SOAP
ƒ WSDL
ƒ Consumidores
ƒ Fornecedores
Pense nisso!!!

9 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Agenda
Integrate via Web com OpenEdge Web Services

ƒ O Valor do Web Services


ƒ OpenEdge Web Service Provider
ƒ Cliente ABL como Consumidor

10 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
5
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Web Services ABL Client

O que você precisa saber?


• Como utilizar o WSDL Analyzer
• Um AppServer™ com síntaxe de Procedure
Persistente

11 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Web Services ABL Processos do Cliente

ƒ Obter WSDL (ou sua localização)


ƒ Executar o WSDL Analyzer no WSDL
• Gerar o código ABL ‘novo’ no form HTML
ƒ Utilizar WSDL Analyzer para identificar as
chamadas de código para o Web service
ƒ Chamar efetivamente o Web service

12 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
6
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

OpenEdge Client chamando um Web service

Consumidor HTTP
Fornecedor
Web service Client Web service
1 Requisição WSDL
SOAP WSDL 2
Processor
Client ABL 3 Chamada Serviço
Application
Resposta Serviço 4
Code

13 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

WSDL Analyzer (comando bprowsdldoc)

ƒ Input WSDL (obtido via serviço do Fornecedor)


ƒ Output HTML documentação
• ABL novos códigos e exemplos
• SOAP/XML samples
• Informações sobre o serviço

proenv>bprowsdldoc
http://localhost:8080/wsa/wsa1/wsdl?targetURI=u
rn:wsProvider:Emp myOutput
Documentation written to
File:///C:\OpenEdge\WRK\myOutput\index.html

14 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
7
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

The WSDL Analyzer


Output inclui:

ƒ Informações de Conexão
ƒ Como criar uma Port type (Procedure
Persistente)
ƒ Listar todas Operações (Procedures Internas)
ƒ Como chamar cada Operação
• Síntaxe de Procedure e Função
ƒ Formato do tipo de dado
Port type é modelado como uma procedure persistente (embora não seja
persistente)

Operations são modelados como procedures internas


15 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

The WSDL Analyzer


Output limitações:

ƒ Não há nenhuma garantia (é um guideline)


ƒ Sem informações da desconexão e do
cleanup:
DELETE OBJECT hPortType.
hWebService:DISCONNECT().
DELETE OBJECT hWebService.

16 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
8
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Demonstração: Chamando um Web service

17 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Agenda
Integrando via Web com OpenEdge Web Services

ƒ O Valor do Web Services


ƒ OpenEdge Web Service Provider
ƒ Cliente ABL como Consumidor

18 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
9
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

OpenEdge Web Service Fornecedor


Componentes necessários

ƒ Sua Aplicação
• Quebrado em serviços
ƒ Application Server
• Códigos hospedados expostos como serviços
• Fornecer acesso ao Banco de Dados
ƒ ProxyGen
• Gerar os arquivos intermediários usados para o
deployment (incluindo o mapeamento wsdl)
ƒ Progress Explorer ou wsaman
• Manage Web service (deployment)

19 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

OpenEdge Web Service Fornecedor


Componentes Necessários

ƒ WSA Servlet
• Interface entre o Web Service Consumidor e o
OpenEdge AppServer™
ƒ Produtos de Terceiros
• Java Servlet Engine (JSE)
– Fornece o ambiente para execura o WSA servlet
• Web Server
– Fornece suporte HTTP
– Hosts JSE

WSA = Web Services Adapter

20 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
10
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Deploying do OpenEdge Web Service

OpenEdge AppServer 4 Web Server


1 Aplicação
Java Servlet Engine
OpenEdge
Lógica de Negócio WSA Servlet
r-code

WSDL WSAD WSM

3
2
ProxyGen WSM Progress Explorer
Arquivo ou
intermediário
para fazer o wsaman
Deploy do Web
21 INT-5: Integrate over the Web with OpenEdge® WebService
Services © 2007 Progress Software Corporation

Acessando o OpenEdge Web Service

8 7 HTTP Web
Web service
Listener/ Server
Consumidor 1 2 Sender
Java Servlet Engine
WSA Servlet
WSAD
3 6
SOAP Processor

OpenEdge
4 5
AppServer
ABL Business
Logic

22 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
11
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Demonstration: Deploying a Web service

23 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Web Services Troubleshooting


ABL SOAP Fault

Envelope
fault code fault actor
Body
fault string
Body Entry
<fault detail>

24 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
12
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

SOAP Faults
RUN operationName IN hPortType (INPUT value1, OUTPUT value2) NO-ERROR.

IF ERROR-STATUS:ERROR THEN DO:


DO iCnt = 1 TO ERROR-STATUS:NUM-MESSAGES:
MESSAGE ERROR-STATUS:GET-MESSAGE(iCnt) VIEW-AS ALERT-BOX.
END.

IF VALID-HANDLE(ERROR-STATUS:ERROR-OBJECT-DETAIL) THEN DO:


MESSAGE
"Fault Code:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-CODE
SKIP
"Fault Actor: " ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-ACTOR
SKIP
"Fault String:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-STRING
SKIP
"Fault Detail:" ERROR-STATUS:ERROR-OBJECT-DETAIL:SOAP-FAULT-DETAIL
VIEW-AS ALERT-BOX.
END.
END.

25 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

SOAP Viewers (prosoapview)

C:\Progress\OpenEdge\bin\prowin32.exe
-proxyhost localhost -proxyport 4444

26 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
13
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Em Resumo
Implementando OpenEdge Web Services

ƒ Entender o Web Services


ƒ Identificar quando utilizar o Web Services
ƒ Progress faz isso de maneira fácil

Web service SOAP


Web service
Consumidor over HTTP Fornecedor
Cliente

27 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Para mais informações Progress…

ƒ Progress Treinamentos e eLearning :


• WSDL for OpenEdge Developers
• Consuming Web Services from OpenEdge
• Opening 4GL Applications to Web Services
Clients

ƒ Documentação:
• 10.1B Web Services (Manual)
• ProxyGen mudanças do Web Services na
OpenEdge 10.1A

28 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
14
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Para mais informações sobre Web Services…

ƒ The World Wide Web Consortium (W3C)


• http://www.w3.org/
ƒ Web Services Interoperability Organization
• http://www.ws-i.org/Default.aspx
• WS-I Basic Profile:
– http://www.ws-i.org/Profiles/BasicProfile-1.0-
2004-04-16.html
ƒ W3 Schools
• http://www.w3schools.com/

29 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Questões?

30 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
15
INT-5: Integrate over the Web with OpenEdge® Web Services
Matt Harrison

Pela Atenção,
Obrigado!!!

31 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

32 INT-5: Integrate over the Web with OpenEdge® Web Services © 2007 Progress Software Corporation

Progress Exchange 2007


10-13 June, Phoenix, AZ, USA
16

Você também pode gostar