26.12.2013 Views

HTTP bindings for imports and exports

HTTP bindings for imports and exports

HTTP bindings for imports and exports

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

© Copyright IBM Corporation 2008 All rights reserved<br />

IBM WebSphere Integration Developer <strong>and</strong> WebSphere Process Server V6.1<br />

Lab exercise<br />

SCA <strong>HTTP</strong> binding lab<br />

Overview of <strong>HTTP</strong> Binding – high level concept................................................................................................... 2<br />

Lab requirements .................................................................................................................................................. 2<br />

What you should be able to do ............................................................................................................................. 3<br />

Introduction to the lab example............................................................................................................................. 3<br />

Exercise instructions ............................................................................................................................................. 4<br />

Part 1: Set up the environment <strong>for</strong> Stock Quote (<strong>HTTP</strong> Binding) project ............................................................. 6<br />

Part 2: Create <strong>HTTP</strong> export <strong>bindings</strong> <strong>for</strong> the service provider ............................................................................ 10<br />

Part 3: Create <strong>HTTP</strong> import <strong>bindings</strong> <strong>for</strong> the client module ................................................................................ 18<br />

Part 4: Deploy the application ............................................................................................................................. 26<br />

Part 5: Test the application from the Web interface............................................................................................ 28<br />

Part 6: View <strong>HTTP</strong> traffic through TCP/IP monitor ............................................................................................. 29<br />

Part 7: Try out different data <strong>bindings</strong>................................................................................................................. 33<br />

Part 8: Try out different function selectors .......................................................................................................... 37<br />

Part 9: Explore <strong>HTTP</strong> binding configurations at runtime..................................................................................... 40<br />

What you did in this exercise .............................................................................................................................. 46<br />

Solution instructions ............................................................................................................................................ 47<br />

Task: Adding remote server to the WebSphere Integration Developer test environment .................................. 50<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 1 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Overview of <strong>HTTP</strong> Binding – high level concept<br />

The objective of this lab is to provide you with an underst<strong>and</strong>ing of how the new <strong>HTTP</strong> Binding works in<br />

WebSphere Integration Developer V6.1 <strong>and</strong> WebSphere Process Server V6.1. The support <strong>for</strong> <strong>HTTP</strong> Binding<br />

is same in WebSphere Enterprise Service Bus V6.1 as in WebSphere Process Server V6.1.<br />

<strong>HTTP</strong> binding allows existing, or newly-developed, <strong>HTTP</strong> applications to participate in a Service Oriented<br />

Architecture (SOA) managed through WebSphere Process Server or WebSphere Enterprise Service Bus, <strong>and</strong><br />

allows a network of SCA runtimes to communicate across an existing <strong>HTTP</strong> infrastructure.<br />

The picture below shows the <strong>HTTP</strong> export used by invoking applications to send requests into a SCA module<br />

using <strong>HTTP</strong>(or <strong>HTTP</strong>S) protocols. The <strong>HTTP</strong> import allows the SCA module to invoke external applications<br />

using <strong>HTTP</strong> (<strong>HTTP</strong>S) protocol<br />

This allows clients to allow their existing <strong>HTTP</strong> application to invoke a SOA application, or allow SOA<br />

application to invoke <strong>HTTP</strong> applications. Many new Web 2.0 applications use <strong>HTTP</strong> as the underlying protocol.<br />

This facilitates tying the Web 2.0 applications in the SOA world.<br />

Lab requirements<br />

List of system <strong>and</strong> software required <strong>for</strong> the student to complete the lab.<br />

• WebSphere Integration Developer V6.1 with the integrated WebSphere Process Server V6.1 as the<br />

unit test server.<br />

• Lab Files – extract the Labfiles61SCA.zip to your C:\ (or any other directory). This archive file<br />

contains the following files:<br />

o<br />

o<br />

LabFiles61\<strong>HTTP</strong>Binding\<strong>HTTP</strong>Binding_SQuote_start_PI.zip - starting Project Interchange<br />

file<br />

LabFiles61\<strong>HTTP</strong>Binding\Solution\<strong>HTTP</strong>Binding_SQuote_Solution_PI.zip - complete lab<br />

solution Project Interchange file – refer to the Solution section at the end of this lab<br />

• Optional: Even though the lab instructions use the integrated unit test server within WebSphere<br />

Integration Developer, you can optionally, chose to use an externally installed WebSphere Process<br />

Server V6.1. You will need to configure <strong>for</strong> a new server in the servers view pointing to the external<br />

WebSphere Process Server V6.1 installation<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 2 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

What you should be able to do<br />

At the end of this lab you should be able to:<br />

• Create <strong>and</strong> configure <strong>HTTP</strong> import <strong>and</strong> export <strong>bindings</strong> in the WebSphere Integration Developer V6.1.<br />

Underst<strong>and</strong> how to set use the different data binding <strong>and</strong> the function selector options<br />

• Run the application <strong>and</strong> navigate through the Administration console to see the <strong>HTTP</strong> binding<br />

configurations. Use TCP/IP monitor view in WebSphere Integration Developer to view the <strong>HTTP</strong> traffic<br />

between the client <strong>and</strong> the provider.<br />

Introduction to the lab example<br />

In this lab, you will import a skeleton of a service provider Stock Quote application <strong>and</strong> a Stock Quote<br />

service client application, into the WebSphere Integration Developer workspace. You will then add <strong>HTTP</strong><br />

<strong>bindings</strong> so that the client can send request <strong>and</strong> receive response from the service provider using <strong>HTTP</strong><br />

application. The complete application looks like the one shown below abstractly.<br />

You will then work through the different configuration options of the <strong>HTTP</strong> <strong>bindings</strong>.<br />

The picture below depicts the structure of the application you work with in this lab:<br />

The Stock quote client module, called SQuoteClient shown on the left side of the picture above, is a simple<br />

SCA module that has a SCA POJO component being called from a JSP page through the st<strong>and</strong>-alone<br />

reference. The SCA POJO is wired to a <strong>HTTP</strong> import, called SQuote<strong>HTTP</strong>.<br />

The <strong>HTTP</strong> request from the client contains the customer ID <strong>and</strong> the stock symbol.<br />

The Stock Quote service provider module, called SQuote, shown on the right side of the picture above is a<br />

simple SCA module receiving <strong>HTTP</strong> request through the <strong>HTTP</strong> export, called SQuote<strong>HTTP</strong>. The service is<br />

provided by a SCA POJO component, called SQuote. The SCA POJO implementation contains some hard<br />

coded values to return as a response. It has been intentionally kept simple to keep the focus on the <strong>HTTP</strong><br />

<strong>bindings</strong>.<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 3 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

The bottom half of the picture shows the actual components in WebSphere Integration Developer. The data<br />

within the module is represented as a Business object. The <strong>HTTP</strong> <strong>bindings</strong> per<strong>for</strong>m the data trans<strong>for</strong>mation<br />

need to convert the BO to <strong>and</strong> from the <strong>HTTP</strong> payload. The diagram shows the BO <strong>and</strong> the <strong>HTTP</strong> payload at<br />

different points within the data flow.<br />

The <strong>HTTP</strong> import binding on the client side requires the URL of the service end point being invoked. In<br />

addition, it requires the data binding to per<strong>for</strong>m the data translation.<br />

The <strong>HTTP</strong> export binding on the service provider side needs to expose the URL. In addition it needs the data<br />

binding <strong>for</strong> data trans<strong>for</strong>mation, <strong>and</strong> the function selector to determine the operation to invoke on the Interface<br />

of the service provider.<br />

Exercise instructions<br />

Some instructions in this lab are Windows ® operating-system specific. If you plan on running the lab on an<br />

operating-system other than Windows, you will need to run the appropriate comm<strong>and</strong>s, <strong>and</strong> use appropriate<br />

files (.sh or .bat) <strong>for</strong> your operating system. The directory locations are specified in the lab instructions using<br />

symbolic references, as follows:<br />

Reference variable Windows location AIX ® /UNIX ® location<br />

<br />

<br />

<br />

<br />

C:\IBM\WID61\runtimes\bi_v61<br />

C:\IBM\WID61<br />

C:\Labfiles61<br />

<strong>HTTP</strong>Binding<br />

Note <strong>for</strong> Windows users: When directory locations are passed as parameters to a Java program such as<br />

EJBdeploy or wsadmin, it is necessary to replace the backslashes with <strong>for</strong>ward slashes to follow the Java<br />

convention. For example, replace C:\LabFiles61\ with C:/LabFiles61/<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 4 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Instructions if using a remote server <strong>for</strong> testing<br />

Note that the previous table is relative to where you are running WebSphere Integration Developer. The<br />

following table is related to where you are running the remote test environment:<br />

Reference variable<br />

Example: Remote<br />

Windows test server<br />

location<br />

Example: Remote<br />

z/OS ® test server<br />

location<br />

Input your values <strong>for</strong> the<br />

remote location of the test<br />

server<br />

server1 sssr011<br />

<br />

C:\Program<br />

Files\IBM\WebSphere\AppServer<br />

/etc/sscell/AppServer<br />

localhost mvsxxx.rtp.raleigh.ibm.com<br />

8880 8880<br />

N/A 1023<br />

AppSrv01 default<br />

N/A ssadmin<br />

N/A fr1day<br />

Instructions <strong>for</strong> using a remote testing environment, such as z/OS, AIX ® or Solaris, can be found at the end of<br />

this document, in the section “Task: Adding remote server to the WebSphere Integration Developer test<br />

environment”.<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 5 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 1: Set up the environment <strong>for</strong> Stock Quote (<strong>HTTP</strong> Binding) project<br />

In this part of the lab, you will create a new WebSphere Integration Developer V6.1 workspace <strong>and</strong> import the<br />

<strong>HTTP</strong> Bindings project interchange into the workspace.<br />

____ 1. Start WebSphere Integration Developer V6.1 with a new workspace<br />

__ a. Select Start Programs IBM Software Development Plat<strong>for</strong>m IBM WebSphere<br />

Integration Developer IBM WebSphere Integration Developer from the start menu<br />

__ b. Enter or click the Browse button to set the new ‘Workspace’ location:<br />

\<strong>HTTP</strong>Binding\workspace (Ex: C:\Labfiles61\<strong>HTTP</strong>Binging\workspace)<br />

__ c. Click OK. The WebSphere Integration developer is launched<br />

__ d. Click the curved arrow at the top right to ‘Go to Business Integration perspective’<br />

____ 2. Import the Project Interchange file, <strong>HTTP</strong>Binding_SQuote_start_PI.zip, into the workspace from<br />

directory \<strong>HTTP</strong>Binding.<br />

__ a. Right-click inside Business Integration View (top left view in the Business Integration<br />

Perspective) <strong>and</strong> select Import from the pop-up menu<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 6 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ b. From the ‘Import’ panel, exp<strong>and</strong> ‘Other’ <strong>and</strong> select ‘Project Interchange’<br />

__ c. Click Next<br />

__ d. In the following ‘Import Project Interchange Contents’ panel, click the Browse button <strong>for</strong><br />

“From zip file” <strong>and</strong> navigate to<br />

\<strong>HTTP</strong>Binding\<strong>HTTP</strong>Binding_SQuote_start_PI.zip <strong>and</strong> hit Open<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 7 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Click the Select All button to select all the check boxes <strong>for</strong> the projects listed<br />

__ f. Click Finish button (projects are imported <strong>and</strong> the auto-build will run)<br />

__ g. Verify you have Resources, SQuote, SQuoteClient <strong>and</strong> SQuoteWebClinet modules listed in<br />

the ‘Business Integration’ view<br />

__ h. Exp<strong>and</strong> SQuoteClient module from the Business Integration view, <strong>and</strong> double click on<br />

“Dependencies” to open the Dependency editor. You should see the Resources project as the<br />

dependent library. Later be<strong>for</strong>e publishing the application to the server, you will add the<br />

SQuoteWebClient as the dependent J2EE dependency. The SQuoteWebClient contains<br />

index.jsp file that drives the input parameters to the application.<br />

____ 3. Verify you have WebSphere Process Server V6.1 listed in your ‘Servers’ view. You may or may not<br />

have the WebSphere ESB Server in the view, depending on whether you had selected to create a<br />

WebSphere ESB server profile during the install<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 8 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

____ 4. Ensure the ‘Automatic Publishing’ is in the ‘Never publish automatically’ mode. By default the<br />

option select is ‘Never publish automatically’<br />

__ a. In the ‘Servers’ view, right click on ‘WebSphere Process Server V6.1’ <strong>and</strong> select ‘Open’ from the<br />

pop-up menu. This opens the ‘Server Overview’ panel <strong>for</strong> WebSphere Process Server V6.1<br />

__ b. In the ‘Server Overview’ panel, exp<strong>and</strong> ‘Automatic Publishing’ by clicking on the pull-down<br />

button ( ) <strong>and</strong> ensure the radio button <strong>for</strong> ‘Never publish automatically’ is selected<br />

__ c. Save the server configuration. File Save or Ctrl + S<br />

____ 5. Close the ‘Server Overview’ tab.<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 9 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 2: Create <strong>HTTP</strong> export <strong>bindings</strong> <strong>for</strong> the service provider<br />

In this part of the lab, you will generate <strong>HTTP</strong> export binding <strong>for</strong> the service provider, which is SQuote module;<br />

eventually you will configure <strong>and</strong> export <strong>bindings</strong>.<br />

____ 1. Generate <strong>HTTP</strong> export binding<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuote module <strong>and</strong> double click on Assembly Diagram<br />

( ) to open it in an Assembly Diagram editor<br />

____ 2. Right click on SQuote, that is SCA Java component <strong>and</strong> select Generate Export <strong>HTTP</strong> Binding<br />

from the pop-up menu. This opens the ‘Configure <strong>HTTP</strong> Export Service’ panel<br />

____ 3. To configure the ‘<strong>HTTP</strong> Export Binding’ follow the instructions below:<br />

__ a. Accept the default value /SQuoteExport as the ‘Context Path:’ <strong>for</strong> ‘End-point configuration’.<br />

This is used in building the URL <strong>for</strong> this endpoint <strong>and</strong> later used by the service client<br />

__ b. Click the Browse button <strong>for</strong> ‘Data binding cconfiguration:’ to set the ‘Data <strong>for</strong>mat’. This opens<br />

the ‘Data Binding Selection’ panel. The data binding class selected here will apply to all the<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 10 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Interface operations. If needed, you can override the data binding <strong>for</strong> each operation. Later, you<br />

will see where the data binding <strong>for</strong> each operation can be overridden<br />

1) In the ‘Data Binding Selection’ panel, select the radio button <strong>for</strong> ‘Show Data Binding<br />

classes’ <strong>and</strong> then select the <strong>HTTP</strong>StreamDataBindingXML class when listed. This will<br />

convert the internal Business object into XML data within <strong>HTTP</strong> payload. Later, you will see<br />

other options <strong>and</strong> view the outputs<br />

2) Click OK<br />

__ c. Now, click the Browse button <strong>for</strong> the ‘Function selector class:’ to set the ‘Function Selector’.<br />

This opens the ‘Function Selector Selection’ panel<br />

1) In the ‘Function Selector Selection’ panel, select the radio button <strong>for</strong> ‘Show Function<br />

Selector classes’ <strong>and</strong> then select the UrlMethodFunctionSelector class when listed.<br />

This will use the URL <strong>and</strong> <strong>HTTP</strong> method to build the function selector string. Later, you will<br />

see other options<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 11 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

2) Click OK<br />

__ d. The final ‘Configure <strong>HTTP</strong> Export Service’ panel must look like the picture shown below:<br />

__ e. Click OK on the ‘Configure <strong>HTTP</strong> Export Service’ panel. You will see the SQuoteExport binding<br />

added to the module <strong>and</strong> wired to the SQuote SCA component as shown below:<br />

__ f. Save the Assembly Diagram. File Save or Ctrl + S<br />

____ 4. Configure <strong>and</strong> explore the <strong>HTTP</strong> Export Binding configuration properties<br />

__ a. Select the new SQuoteExport binding in the SQuote ‘Assembly Diagram’ editor, <strong>and</strong> then select<br />

the Properties tab at the bottom of the tool. You can exp<strong>and</strong> the window to full screen of the tool<br />

to see all the options<br />

__ b. Select the Properties Description panel. Here you can see the general attributes of the binding<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 12 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ c. Now, select the Properties Details panel. Here, you can view the export binding interface <strong>and</strong> its<br />

operations. For export, there are no quality of service qualifiers needed<br />

Stop <strong>and</strong> Think: Why can not you specify any quality of service qualifiers on export <strong>bindings</strong>? The qualifiers<br />

are specified on the Interface of the wired SCA component.<br />

__ d. Now, select the Properties Binding panel. Here you will see the values entered when creating<br />

the <strong>HTTP</strong> export binding, namely the context path, Data Binding class <strong>and</strong> the Function selector<br />

class. If needed, you can replace the values here. Later in the lab, you will change some of these<br />

options<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 13 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Select the Properties Advanced configuration panel<br />

1) In the <strong>HTTP</strong> Headers tab of the panel, you can modify or add Transfer encoding, Content<br />

encoding, Media type, character set <strong>and</strong> <strong>HTTP</strong> headers used by the <strong>HTTP</strong> response<br />

generated by the service provider <strong>HTTP</strong> Export.<br />

2) In the <strong>HTTP</strong> Method Settings tab, you can specify Pingable option on any <strong>HTTP</strong> method<br />

along with the status code returned by the ping. Any values specified in the Advanced<br />

configuration applies to all the Interface methods<br />

____ 5. The global values specified in the Bindings panel <strong>and</strong> ‘Advanced configuration’ panel can be<br />

overridden at the Interface operation level. The instructions below will show how to add, modify the<br />

values <strong>for</strong> each operation<br />

__ a. Select the Property ‘Method <strong>bindings</strong>’ panel <strong>and</strong> then select the ‘Generic’ tab <strong>for</strong> the<br />

‘getQuote’ method. Here, you can specify the native method names (used to compare with the<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 14 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

function name returned by function selector class). The default native method name <strong>for</strong> operation<br />

"getQuote" is /SQuoteExport/getQuote@GET. This is returned by URL method function selector<br />

if the input request from /SQuoteExport/getQuote <strong>HTTP</strong> method is GET. However, the client is<br />

using <strong>HTTP</strong> POST method (since the payload as coming as a POST <strong>and</strong> not GET) <strong>and</strong> hence<br />

there will be a mismatch. You need to add the new native method that matches the <strong>HTTP</strong> POST<br />

method<br />

1) Click the ‘Add’ button <strong>for</strong> the ‘Native Method:’ <strong>and</strong> enter<br />

/SQuoteExport/getQuote@POST as a value in the ‘Add’ dialog<br />

2) Click OK. You should see "/SQuoteExport/getQuote@POST" added to the native method<br />

list<br />

3) Now, select /SQuoteExport/getQuote@GET from the native method list <strong>and</strong> then click the<br />

‘Remove’ button as you do not need it<br />

4) Save the Assembly Diagram. File Save or Ctrl + S<br />

__ b. Now, select the Property ‘Method <strong>bindings</strong>’ tab <strong>and</strong> then select the ‘Data Serialization’ tab <strong>for</strong><br />

the ‘getQuote’ method. Here you can override the data binding class, specified during the initial<br />

configuration <strong>and</strong> seen in the Property Binding panel. You can specify separate data binding<br />

classes <strong>for</strong> input <strong>and</strong> output<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 15 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ c. Now, select the ‘<strong>HTTP</strong> Headers’ tab on the Property Method <strong>bindings</strong> panel <strong>for</strong> the ‘getQuote’<br />

method. Here, you can override or add Transfer Encoding, Content Encoding, Media type,<br />

Character set <strong>and</strong> <strong>HTTP</strong> headers value that have been specified <strong>for</strong> all the methods in the<br />

‘Advanced configuration’ panel<br />

__ d. Now, select the "<strong>HTTP</strong> Method Settings" tab on the Property ‘Method <strong>bindings</strong>’ panel <strong>for</strong> the<br />

‘getQuote’ method. Only <strong>HTTP</strong> methods present in this panel are accepted by the service<br />

provider. By default, only “GET” is allowed. If you need to accept other <strong>HTTP</strong> methods, or make<br />

any of them pingable, you will need to add the method here <strong>and</strong> override the Pingable option on<br />

any <strong>HTTP</strong> method along with the status code returned by the ping.<br />

__ e. Click on Add next to the table<br />

__ f. From the Add Pingable <strong>HTTP</strong> Method window, ensure that you have the following options:<br />

1) Method: POST<br />

2) Status Code: 200<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 16 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

3) Click OK from Add Pingable <strong>HTTP</strong> Method window<br />

__ g. Now you should see one more Method Type, POST, added to the table<br />

__ h. Save the Assembly Diagram. File Save or Ctrl + S<br />

____ 6. To review the ‘Binding’ summary, select the Properties Summary panel. You can see the endpoint<br />

URL of the method getQuote as /SQuoteWeb/SQuoteExport/getQuote. The /SQuoteWeb is the<br />

Web context root of the module. The /SQuoteExport is the context root of the <strong>HTTP</strong> export binding,<br />

specified in the initial configuration panel. The /getQuote is the context root of the Interface method<br />

getQuote. You can now see how the entire end point URL is built. You will need this when configuring<br />

the <strong>HTTP</strong> Import binding on the client side<br />

____ 7. You have now completed creating <strong>and</strong> configuring the <strong>HTTP</strong> export <strong>bindings</strong>; explored the different<br />

configurations as well. You will come back later to explore other data binding <strong>and</strong> function selector<br />

options<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 17 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 3: Create <strong>HTTP</strong> import <strong>bindings</strong> <strong>for</strong> the client module<br />

In this part of the lab, you will generate <strong>HTTP</strong> import binding <strong>for</strong> the client module, which is SQuoteClient;<br />

eventually you will configure <strong>and</strong> import <strong>bindings</strong>.<br />

____ 1. Create <strong>HTTP</strong> import binding<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuoteClient module <strong>and</strong> double click on Assembly<br />

Diagram (<br />

) to open it in an Assembly Diagram editor<br />

__ b. Select an Import from the ‘Palette’ (left side of the Assembly Diagram) <strong>and</strong> click to place it on to<br />

the canvas as shown below:<br />

__ c. Rename the name of the import to SQuote<strong>HTTP</strong> in the properties panel. You will see the display<br />

name of the import change<br />

__ d. Hover over SQuote<strong>HTTP</strong> <strong>and</strong> click the ‘Add Interface’ icon (<br />

interface. The ‘Add Interface’ dialog opens.<br />

) that appears to add an<br />

1) Ensure the radio button next to ‘Show WSDL’ is selected<br />

2) Now, select ‘StockQuoteService’ listed <strong>for</strong>m the matching interfaces<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 18 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

3) Click OK<br />

__ e. From the SQuoteClient; the SCA component output reference, drag a wire <strong>and</strong> connect to the<br />

SQuote<strong>HTTP</strong> import. This will add the wire<br />

__ f. Right click the SQuote<strong>HTTP</strong> import <strong>and</strong> select Generate Binding <strong>HTTP</strong> Binding from the<br />

pop-up menu. This opens the ‘Configure <strong>HTTP</strong> Import Service’ panel<br />

____ 2. To Configure the ‘<strong>HTTP</strong> Import Binding’ follow the instructions below:<br />

__ a. For the ‘End-point configuration’ enter the ‘End-point URL’ as<br />

http://localhost:9080/SQuoteWeb/SQuoteExport/getQuote. This is the endpoint of the keep<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 19 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

the default value <strong>for</strong> the context path of /SQuoteExport. This is used in building the URL <strong>for</strong> this<br />

endpoint <strong>and</strong> later used by the service client<br />

Note: The default <strong>HTTP</strong> port number might be different from 9080 depending on your environment. You might<br />

want to use the correct port number.<br />

__ b. Click the Browse button <strong>for</strong> ‘Data binding configuration:’ to set the ‘Data <strong>for</strong>mat’. This opens<br />

the ‘Data Binding Selection’ panel. The data binding class selected here will apply to all the<br />

Interface operations. If needed, you can override the data binding <strong>for</strong> each operation. Later, you<br />

will see where the data binding <strong>for</strong> each operation can be overridden<br />

1) In the ‘Data Binding Selection’ panel, select the radio button <strong>for</strong> ‘Show Data Binding<br />

classes’ <strong>and</strong> then select the <strong>HTTP</strong>StreamDataBindingXML class when listed. This will<br />

convert the internal Business object into XML data within <strong>HTTP</strong> payload. Later, you will see<br />

other options <strong>and</strong> view the outputs<br />

2) Click OK<br />

__ c. Ensure the check box <strong>for</strong> the ‘Generate TargetFunctionName message header property’ is<br />

selected. This is not currently used, but will be used later when using with<br />

Header<strong>HTTP</strong>FunctionSelector function selector class<br />

__ d. The final ‘Configure <strong>HTTP</strong> Import Service’ panel must look like the picture shown below:<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 20 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Click OK on the ‘Configure <strong>HTTP</strong> Import Service’ panel<br />

__ f. Save the Assembly Diagram. File Save or Ctrl + S. The Assembly diagram must looks like<br />

the picture shown below:<br />

____ 3. Configure <strong>and</strong> explore the <strong>HTTP</strong> Import Binding configuration properties<br />

__ a. Select the new SQoute<strong>HTTP</strong> import binding, <strong>and</strong> then select the Properties tab at the bottom of<br />

the tool. You can exp<strong>and</strong> the window to full screen of the tool to see all the options<br />

__ b. Select the Properties Description panel. Here you can see the general attributes of the binding<br />

__ c. Now, select the Properties Details panel. Here, you can view the import binding Interface <strong>and</strong> its<br />

operations. For the operation getQuote, you can add Quality of service (QOS) qualifiers <strong>and</strong><br />

event monitors. In this lab, you do not add any QOS or events<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 21 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ d. Now, select the Properties Binding panel. Here you will see the values entered when creating<br />

the <strong>HTTP</strong> import binding, namely the endpoint URL of the service provider <strong>and</strong> the data binding<br />

class. In addition, you can specify the <strong>HTTP</strong> version <strong>and</strong> method. You will keep the <strong>HTTP</strong><br />

version of 1.1. For the <strong>HTTP</strong> method, change it to POST (select from the drop down list)<br />

__ e. Save the configuration. File Save or Ctrl + S<br />

__ f. Now, select the Properties Advanced configuration panel. Any values specified in the<br />

Advanced configuration applies to all the Interface methods<br />

1) In the <strong>HTTP</strong> Headers tab of the panel, you can you can modify or add Transfer encoding,<br />

Content encoding, Media type, character set <strong>and</strong> <strong>HTTP</strong> headers used by the <strong>HTTP</strong><br />

response generated by the service provider <strong>HTTP</strong> Export<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 22 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

2) In the <strong>HTTP</strong> Proxy tab, you can specify any Proxy server or SSL proxy server that needs to<br />

be configured to call the service provider<br />

3) In the Security tab, you can specify the SSL or Basic Authentication Alias. These aliases<br />

are configured in the runtime where this application is deployed. Here, you just need to<br />

specify the name of the aliases. The Basic authentication uses username/password to<br />

authenticate the client whereas the SSL authentication uses SSL certificates <strong>and</strong> settings<br />

between the client server <strong>and</strong> the service provider. Setting the security settings is done by<br />

the server administrator; all you need to know is the authentication aliases. In addition, the<br />

administrator can also specify ad override many of the <strong>HTTP</strong> binding attributes in the<br />

runtime<br />

4) In the Per<strong>for</strong>mance tab, you can specify the read timeout <strong>for</strong> the response <strong>and</strong> the number<br />

of retries. Read timeout of 0 indicates that there is no timeout<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 23 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

____ 4. The global values specified in the ‘Bindings’ panel <strong>and</strong> ‘Advanced configuration’ panel can be<br />

overridden at the Interface operation level. The instructions below will show how to add, modify the<br />

values <strong>for</strong> each operation<br />

__ a. Select the Property ‘Method <strong>bindings</strong>’ panel <strong>and</strong> then select the ‘Generic’ tab <strong>for</strong> the<br />

‘getQuote’ method. For the <strong>HTTP</strong> method, select POST <strong>and</strong> accept defaults <strong>for</strong> the other values<br />

__ b. Now, select the Property ‘Method <strong>bindings</strong>’ tab <strong>and</strong> then select the ‘Data Serialization’ tab <strong>for</strong><br />

the ‘getQuote’ method. Here you can override the data binding class, specified during the initial<br />

configuration <strong>and</strong> seen in the Property Binding panel. You can specify separate data binding<br />

classes <strong>for</strong> input <strong>and</strong> output<br />

__ c. Now, select the ‘<strong>HTTP</strong> Headers’ tab on the Property Method <strong>bindings</strong> panel <strong>for</strong> the ‘getQuote’<br />

method. Here, you can override or add Transfer encoding, Content encoding, Media type,<br />

character set <strong>and</strong> <strong>HTTP</strong> headers value that have been specified <strong>for</strong> all the methods in the<br />

"Advanced configuration" panel<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 24 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ d. Select the "<strong>HTTP</strong> Proxy" tab on the Property ‘Method <strong>bindings</strong>’ panel of method "getQuote".<br />

Here, you can override the proxy settings<br />

__ e. Select the "Security" tab on the Property ‘Method <strong>bindings</strong>’ panel of method "getQuote".<br />

Here, you can override the SSL <strong>and</strong> Basic authentication aliases<br />

__ f. Select the "Per<strong>for</strong>mance" tab on the Property ‘Method <strong>bindings</strong>’ panel of method "getQuote".<br />

Here, you can override the per<strong>for</strong>mance attributes<br />

____ 5. To review the ‘Binding’ summary, select the Properties Summary panel. You can see the endpoint<br />

URL of the service provider that is invoked. This is the one you had used during the initial configuration<br />

of the <strong>HTTP</strong> import binding<br />

____ 6. Save the configuration. File Save or Ctrl + S<br />

.<br />

.<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 25 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 4: Deploy the application<br />

In this part of the lab, you will add the SQuoteWebClient module as a J2EE dependency to SQuoteClient<br />

module <strong>and</strong> deploy the J2EE project to the WebSphere Process Server test environment.<br />

____ 1. In Business Integration view, exp<strong>and</strong> on SQuoteClient module <strong>and</strong> double click on ‘Dependencies’<br />

( ) to open the Dependency Editor<br />

__ a. In the Dependency Editor, exp<strong>and</strong> J2EE <strong>and</strong> click the Add button to add SQuoteWebClient as<br />

J2EE dependent project<br />

__ b. From the J2EE Project Selection panel, select SQuoteWebClient listed <strong>and</strong> click OK<br />

__ c. Ensure that the check box next to Deploy with Module is selected by selecting the<br />

SQuoteWebClient module. This module contains the index.jsp page that is used to drive the<br />

input to the application.<br />

__ d. Save the dependency editor. File Save or Ctrl + S<br />

____ 2. Start the WebSphere Process Server<br />

__ a. If using a remote testing environment, follow the directions provided in Task: Adding Remote<br />

Server to WebSphere Integration Developer Test Environment at the end of this document<br />

to add a server to the WebSphere Integration Developer test environment <strong>and</strong> start it. This is<br />

especially true <strong>for</strong> z/OS, AIX, Solaris remote test environment, where the WebSphere Integration<br />

Developer is remote to the test environment<br />

__ b. If using a local test environment ,right click on WebSphere Process Server V6.1 <strong>and</strong> select<br />

‘Start’ ( )from the pop-up menu<br />

__ c. Wait until the sever status is indicated as Started<br />

____ 3. Add the J2EE project to the configured projects on the server<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 26 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ a. From the ‘Servers’ view, right click on WebSphere Process Server V6.1 <strong>and</strong> select Add <strong>and</strong><br />

Remove projects… from the pop-up menu. The ‘Add <strong>and</strong> Remove Projects’ panel opens<br />

__ b. From the ‘Add <strong>and</strong> Remove Projects’ panel, click the ‘Add All’ button to add the available<br />

projects to the configured projects<br />

__ c. Click Finish<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 27 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 5: Test the application from the Web interface<br />

In this part of the lab, you will test the SQuote application by accessing the SQuoteClient module though the<br />

Web interface.<br />

____ 1. In the Business Integration view, exp<strong>and</strong> ‘SQuoteClientWeb Web Content’, right click the<br />

‘index.jsp’ file <strong>and</strong> select ‘Run as Run on Server’ from the pop-up menu. Select ‘WebSphere<br />

Process Server V6.1’ listed from the ’New Server’ panel. This opens an embedded browser as shown<br />

below:<br />

Note: Alternatively, you can open the embedded browser within WebSphere Integration Developer V6.1. Click<br />

the Web browser icon ( ) located on the toolbar to open the embedded Web browser <strong>and</strong> enter the URL:<br />

http://localhost:9080/SQuoteWebClient/index.jsp where as 9080 is the default <strong>HTTP</strong> port bound to the<br />

application.<br />

To find the default <strong>HTTP</strong> port, right click on the ‘WebSphere Process Server V6.1’ in the ‘Servers’ view <strong>and</strong><br />

select the ‘Run administrative console’ from the pop-up menu. In the administrative console, exp<strong>and</strong> ‘Servers’<br />

in the left navigation pane <strong>and</strong> click on the ‘Application servers’ link. In the right pane, click the ‘server1’ link. In<br />

the following page, exp<strong>and</strong> ‘Ports’ under the ‘Communications’ category <strong>and</strong> locate the entry corresponding to<br />

‘WC_defaulthost’.<br />

____ 2. Enter the following values an click the ‘Submit’ button<br />

• Enter Stock Symbol : ibm<br />

• Enter Customer ID : 123<br />

____ 3. You must expect the following result:<br />

• Stock value is : 20.0<br />

• Customer’s service level is : Silver<br />

____ 4. Continue playing with a different customer ID. The symbol does not play any role, except it cannot be<br />

null<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 28 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 6: View <strong>HTTP</strong> traffic through TCP/IP monitor<br />

In this part of the lab, you will see the <strong>HTTP</strong> payload between the service client <strong>and</strong> provider, using the<br />

built-in TCPIP monitor. This is useful to see how the data <strong>bindings</strong> convert the internal representation of data<br />

as Business objects to the actual <strong>HTTP</strong> payload as XML or SOAP or any custom <strong>bindings</strong>. For the TCPIP<br />

monitor to view the traffic, the service clients will need to send the data to a port that TCP/IP monitor is<br />

listening, which will then <strong>for</strong>ward the request to the service provider.<br />

____ 1. Open the TCP/IP monitor view<br />

__ a. From the main menu, select ‘Window Show View Other’. This opens the ‘Show View ’<br />

panel<br />

__ b. In the ‘Show View’ panel, exp<strong>and</strong> ‘Debug’ <strong>and</strong> then select ‘TCP/IP Monitor’<br />

__ c. Click OK. The TCP/IP Monitor view is opens <strong>and</strong> is shown at the bottom frame of the<br />

workbench<br />

__ d. You can change the position of the TCP/IP monitor or maximize it if you find you need more<br />

space to work within the monitor view<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 29 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

____ 2. Configure TCP/IP monitor to listen on port 9079 (you can use any unused port besides 9079)<br />

__ a. In the TCP/IP monitor view, click on the pull-down button ( ), located on the top right corner of<br />

the monitor view panel <strong>and</strong> select ‘Properties’. The ‘Preferences’ panel <strong>for</strong> the TCP/IP Monitor<br />

opens<br />

__ b. Remove or stop any existing defined monitors by selecting them <strong>and</strong> then clicking the ‘Remove’<br />

button<br />

__ c. On the TCP/IP Monitor preferences panel, click the Click Add button to enter a new monitor. The<br />

‘New Monitor’ panel opens. Enter the following entries, keeping the rest of the defaults:<br />

• Local monitoring port: 9079<br />

• Host name : localhost<br />

• Port : 9080<br />

• Click OK<br />

__ d. Select the newly added monitor <strong>and</strong> click the Start button to the start monitoring port 9079<br />

__ e. Click OK over the ‘TCP/IP Monitor’ preferences panel<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 30 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

____ 3. On the TCP/IP monitor view, click on the pull-down button ( ) located on the top right corner of the<br />

panel <strong>and</strong> enable ‘Show Header’ option. This will show the <strong>HTTP</strong> headers within the traffic<br />

____ 4.<br />

On the request side <strong>and</strong> response side of the monitor view, change the data to be shown from Byte<br />

to XML. This can be done by the selecting drop down list on both the request <strong>and</strong> response side<br />

____ 5. You are now ready to view the <strong>HTTP</strong> traffic. However, the service client is sending the request on<br />

port 9080. It needs to be modified to use port 9079 on which the monitor is listening. Modify the ports<br />

<strong>for</strong> the service client, SQuoteClient<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuoteClient module <strong>and</strong> double click on Assembly<br />

Diagram (<br />

) to open it in an Assembly Diagram editor<br />

__ b. Select SQuote<strong>HTTP</strong> import component <strong>and</strong> select the Properties view<br />

__ c. In the Properties view, select ‘Method Binding’, exp<strong>and</strong> "Bound Methods" in the Import section<br />

of the view, <strong>and</strong> then select getQuote operation<br />

__ d. Click on the Generic tab <strong>and</strong> change the endpoint URL port from 9080 to 9079. The final<br />

endpoint URL should look like ‘http://localhost:9079/SQuoteWeb/SQuoteExport/getQuote’<br />

__ e. Save the configuration. File Save or Ctrl + S<br />

____ 6. You are now ready to republish, run the application <strong>and</strong> view the <strong>HTTP</strong> traffic. Republish the<br />

application on the server<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 31 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ a. In the ‘Servers’ view, right click on the WebSphere Process Server V6.1 <strong>and</strong> then select<br />

‘Publish’ from the pop-up menu. This should update the SQuoteClient application on the server<br />

__ b. In the Business Integration view, exp<strong>and</strong> ‘SQuoteClientWeb Web Content’, right click the<br />

‘index.jsp’ file <strong>and</strong> select ‘Run as Run on Server’ from the pop-up menu. Select ‘WebSphere<br />

Process Server V6.1’ listed from the ’New Server’ panel. This opens the embedded browser.<br />

__ c. Enter the values <strong>and</strong> click the ‘Submit’ button. (Refer Part 5 of this lab)<br />

__ d. View the <strong>HTTP</strong> payload in the ‘TCP/IP Monitor’ view. You can see the headers <strong>and</strong> the XML<br />

payload (since the data binding used is <strong>HTTP</strong>StreamDataBindingXML)<br />

:<br />

.<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 32 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 7: Try out different data <strong>bindings</strong><br />

So far, you have used <strong>HTTP</strong>StreamDataBindingXML <strong>for</strong> the input <strong>and</strong> the output. Hence the <strong>HTTP</strong><br />

request <strong>and</strong> response contain the data payload as XML. Here, you will use XML payload on the <strong>HTTP</strong> request<br />

but receive the <strong>HTTP</strong> response as SOAP payload.<br />

____ 1.<br />

Modify the data <strong>bindings</strong> <strong>for</strong> the <strong>HTTP</strong> Import on the client side:<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuoteClient module <strong>and</strong> double click on Assembly<br />

Diagram (<br />

) to open it in an Assembly Diagram editor<br />

__ b. Select the SQoute<strong>HTTP</strong> import binding, <strong>and</strong> then select the Properties tab at the bottom of the<br />

tool<br />

__ c. In the Properties view, select Method <strong>bindings</strong> <strong>and</strong> then select the ‘Data Serialization’ <strong>for</strong> the<br />

getQuote method<br />

__ d. Click the Browse button <strong>for</strong> the Input data binding. On the ‘Data Binding Selection’ panel, select<br />

the radio button next to ‘Show Data binding class’ <strong>and</strong> then select<br />

‘<strong>HTTP</strong>StreamDataBindingXML’<br />

__ e. Click OK<br />

__ f. Click the Browse button <strong>for</strong> the ‘Output data binding’. On the ‘Data Binding Selection’ panel,<br />

select the radio button <strong>for</strong> ‘Show Data binding class’ <strong>and</strong> then select<br />

‘<strong>HTTP</strong>StreamDataBindingSOAP’<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 33 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ g. Click OK<br />

__ h. Save the configuration. File Save or Ctrl + S<br />

____ 2. Modify the data <strong>bindings</strong> <strong>for</strong> the <strong>HTTP</strong> Export on the service provider side<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuote module <strong>and</strong> double click on Assembly Diagram<br />

( ) to open it in an Assembly Diagram editor<br />

__ b. Select the SQouteExport export binding, <strong>and</strong> then select the Properties tab at the bottom of the<br />

tool<br />

__ c. In the Properties view, select Method <strong>bindings</strong> <strong>and</strong> then select the ‘Data Serialization’ <strong>for</strong> the<br />

getQuote method<br />

__ d. Click the Browse button <strong>for</strong> the ‘Input data binding’. On the ‘Data Binding Selection’ panel, select<br />

the radio button next to ‘Show Data binding class’ <strong>and</strong> then select<br />

‘<strong>HTTP</strong>StreamDataBindingXML’<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 34 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Click OK<br />

__ f. Click the Browse button <strong>for</strong> the ‘Output data binding’. On the ‘Data Binding Selection’ panel,<br />

select the radio button <strong>for</strong> ‘Show Data binding class’ <strong>and</strong> then select<br />

‘<strong>HTTP</strong>StreamDataBindingSOAP’<br />

__ g. Click OK<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 35 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

____ 3. Save the configuration. File Save or Ctrl + S<br />

____ 4. You are now ready to republish, run the application <strong>and</strong> test the new function selector. Republish the<br />

application on the server<br />

__ a. In the ‘Servers’ view, right click on the WebSphere Process Server V6.1 <strong>and</strong> then select<br />

‘Publish’ from the pop-up menu<br />

__ b. In the Business Integration view, exp<strong>and</strong> ‘SQuoteClientWeb Web Content’, right click the<br />

‘index.jsp’ file <strong>and</strong> select ‘Run as Run on Server’ from the pop-up menu. Select ‘WebSphere<br />

Process Server V6.1’ listed from the ’New Server’ panel. This opens the embedded browser.<br />

__ c. Enter the values <strong>and</strong> click the ‘Submit’ button. (Refer Part 5 of this lab)<br />

____ 5. View the <strong>HTTP</strong> payload in the ‘TCP/IP Monitor’ view. The <strong>HTTP</strong> request has a payload of XML data<br />

where as the <strong>HTTP</strong> response sends back payload as SOAP data<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 36 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 8: Try out different function selectors<br />

Function selector determines the method to invoke on the <strong>HTTP</strong> export of the service provider. In this part,<br />

you will explore the use of Header<strong>HTTP</strong>FunctionSelector as the Function selector <strong>for</strong> the service provider.<br />

This Function selector uses the value of the <strong>HTTP</strong> header property "TargetFunctionName" as the returned<br />

function name. The input <strong>HTTP</strong> request must contain the "TargetFunctionName" header property.<br />

If you recall during the creation of the <strong>HTTP</strong> import binding on the SQuoteClient module, you had selected<br />

the option to generate "TargetFunctionName" message header property. This adds the<br />

TargetFunctionName with a value of getQuote (uses method name as the value)<br />

____ 1.<br />

In Business Integration view, exp<strong>and</strong> SQuoteClient module <strong>and</strong> double click on Assembly Diagram<br />

( ) to open it in an Assembly Diagram editor<br />

__ a. Select the SQoute<strong>HTTP</strong> import binding, <strong>and</strong> then select the Properties tab at the bottom of the<br />

tool<br />

__ b. In the Properties view, select Method <strong>bindings</strong> tab <strong>and</strong> then select the ‘<strong>HTTP</strong> Headers’ tab <strong>for</strong><br />

the getQuote method. You should see the property TargetFunctionName with value getQuote.<br />

If you had created the import without generating the TargetFunctionName property, you can<br />

add the property in this panel<br />

____ 2. Set up the function selector on the <strong>HTTP</strong> export on the service provider<br />

__ a. In Business Integration view, exp<strong>and</strong> SQuote module <strong>and</strong> double click on Assembly Diagram<br />

( ) to open it in an Assembly Diagram editor<br />

__ b. Select the SQouteExport export binding, <strong>and</strong> select the Properties view at the bottom of the<br />

tool<br />

__ c. In the Properties view, select Binding tab<br />

__ d. Click Browse <strong>for</strong> the Function Selector. On the Function Selector Selection panel, select the<br />

radio button <strong>for</strong> ‘Show Function Selector class’ <strong>and</strong> then select<br />

‘Header<strong>HTTP</strong>FunctionSelector’ listed,<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 37 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Click OK<br />

__ f. In the Properties view, select Method <strong>bindings</strong> <strong>and</strong> then select the ‘Generic’ tab <strong>for</strong> the<br />

getQuote method<br />

__ g. For the Native method, click Add. Enter getQuote in the text entry panel<br />

__ h. Click OK. The client adds TargetFunctionName property with the value of getQuote<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 38 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ i. Save the Assembly Diagram. File Save or Ctrl + S<br />

____ 3. You are now ready to republish, run the application <strong>and</strong> test the new function selector. Republish the<br />

application on the server<br />

__ a. In the ‘Servers’ view, right click on the WebSphere Process Server V6.1 <strong>and</strong> then select<br />

‘Publish’ from the pop-up menu<br />

__ b. In the Business Integration view, exp<strong>and</strong> ‘SQuoteClientWeb Web Content’, right click the<br />

‘index.jsp’ file <strong>and</strong> select ‘Run as Run on Server’ from the pop-up menu. Select ‘WebSphere<br />

Process Server V6.1’ listed from the ’New Server’ panel. This opens the embedded browser.<br />

__ c. Enter the values <strong>and</strong> click the ‘Submit’ button. (Refer Part 5 of this lab)<br />

____ 4. View the <strong>HTTP</strong> payload in the TCP/IP Monitor view. Notice that the <strong>HTTP</strong> request contains<br />

TargetFunctionName header property with the value of getQuote, This is used by<br />

Header<strong>HTTP</strong>FunctionSelector to return the native method on the service provider<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 39 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Part 9: Explore <strong>HTTP</strong> binding configurations at runtime<br />

In this part of the lab, you will explore the <strong>HTTP</strong> binding configurations in the WebSphere Process Server<br />

runtime environment. You will navigate the administrative console <strong>and</strong> see what <strong>HTTP</strong> binding attributes can<br />

be modified <strong>and</strong> where within the console you can work with the attributes.<br />

____ 1.<br />

Open administrative console <strong>and</strong> explore the SCA modules<br />

__ a. In the ‘Servers’ view, right click the ‘WebSphere Process Server V6.1’ <strong>and</strong> select ‘Run<br />

administrative console’ from the pop-up menu. This opens the WebSphere Process Server’s<br />

administrative console<br />

__ b. Log in by providing the username <strong>and</strong> password values ( default username: admin, default<br />

password: admin)<br />

__ c. In the left navigation pane of the administrative console, exp<strong>and</strong> ‘Applications’ <strong>and</strong> click on<br />

‘SCA modules’. You should see your SCA modules, SQuote <strong>and</strong> SQuoteClient. You may see<br />

other SCA modules that come with the Process Server. In this SCA modules panel, you can see<br />

the containing application <strong>and</strong> its status (running, stopped, <strong>and</strong> so on.). You can also start or<br />

stop the application running those SCA modules from this panel<br />

____ 2. Explore <strong>HTTP</strong> import binding<br />

__ a. Click on SQuoteClient SCA module. In the following panel, exp<strong>and</strong> the Module components;<br />

Imports <strong>and</strong> Exports. There are no <strong>exports</strong> in this module. Exp<strong>and</strong> on the SQuote<strong>HTTP</strong> import<br />

<strong>and</strong> then exp<strong>and</strong> on the Interface <strong>and</strong> Bindings<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 40 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ b. Click on <strong>HTTP</strong> binding. In the following binding panel, you can modify the binding attributes. The<br />

panel has two tabs, "Binding Scope" <strong>and</strong> "Method Scope". The Binding scope applies to all the<br />

methods of the Interface, whereas the Method Scope applies to a selected method on the<br />

Interface<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 41 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ c. In the binding panel’s Binding scope tab, you can modify the target service endpoint URL, the<br />

<strong>HTTP</strong> method, version, authentication, encodings, proxy settings <strong>and</strong> response timeout<br />

__ d. Now, click on the ‘Method Scope’ tab. Here you can select the method <strong>and</strong> then enable the<br />

method scope to modify the attributes at the method level. Once the method scope is enabled,<br />

you can change the attributes of the target service endpoint URL, the <strong>HTTP</strong> method, version,<br />

authentication, encodings, proxy settings <strong>and</strong> response timeout.<br />

__ e. Return back to SCA module panel by click on the SCA modules on the top of the panel<br />

____ 3. Explore <strong>HTTP</strong> export binding<br />

__ a. Click on SQuote SCA module. In the following panel, exp<strong>and</strong> the Module components Imports<br />

<strong>and</strong> Exports. There are no <strong>imports</strong> in this module. Exp<strong>and</strong> on the SQuoteExport export <strong>and</strong> then<br />

exp<strong>and</strong> on the Interface <strong>and</strong> Bindings<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 42 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ b. Click on <strong>HTTP</strong> binding. In the following binding panel, you can modify the binding attributes. The<br />

panel has two tabs, "Binding Scope" <strong>and</strong> "Method Scope". The Binding scope applies to all the<br />

methods of the Interface, whereas the Method Scope applies to a selected method on the<br />

Interface<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 43 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ c. In the binding panel Binding scope tab, you can view the context path <strong>and</strong> modify ‘Pingable<br />

<strong>HTTP</strong>’ methods <strong>and</strong> encodings<br />

__ d. Click on the ‘Method Scope’ tab. Here you can select the method <strong>and</strong> then enable the method<br />

scope to modify the attributes at the method level. Once the method scope is enabled, you can<br />

view the context path <strong>and</strong> modify ‘Pingable <strong>HTTP</strong>’ methods <strong>and</strong> encodings.<br />

____ 4. Close the administrative console<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 44 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 45 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

What you did in this exercise<br />

You have imported the ‘<strong>HTTP</strong>Binding_SQuote_start_PI.zip’ project interchange file to a new workspace.<br />

Created <strong>and</strong> configured <strong>HTTP</strong> import <strong>and</strong> export <strong>bindings</strong> in the WebSphere Integration Developer V6.1.<br />

Explored how to set use the different data binding <strong>and</strong> the function selector options<br />

Deployed the application <strong>and</strong> navigated through the administrative console to see the <strong>HTTP</strong> binding<br />

configurations.<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 46 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Solution instructions<br />

If you want to directly see the solution, there is a complete solution Project Interchange file available <strong>for</strong><br />

you.<br />

____ 1.<br />

Start WebSphere Integration Developer V6.1 with a new workspace<br />

__ a. Select Start Programs IBM Software Development Plat<strong>for</strong>m IBM WebSphere<br />

Integration Developer IBM WebSphere Integration Developer from the start menu<br />

__ b. Enter or click the Browse button to set the new ‘Workspace’ location:<br />

\\solution_workspace (Ex:<br />

C:\Labfiles61\<strong>HTTP</strong>Binding\solution_workspace)<br />

____ 2. Import the Project Interchange file, <strong>HTTP</strong>Binding_SQuote_Solution_PI.zip, into the workspace from<br />

directory \<strong>HTTP</strong>Binding\Solution<br />

__ a. Right-click inside Business Integration View (top left view in the Business Integration<br />

Perspective) <strong>and</strong> select Import from the pop-up menu<br />

__ b. From the ‘Import’ panel, exp<strong>and</strong> ‘Other’ <strong>and</strong> select ‘Project Interchange’<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 47 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ c. Click Next<br />

__ d. In the following ‘Import Project Interchange Contents’ panel, click the Browse button <strong>for</strong><br />

“From zip file” <strong>and</strong> navigate to<br />

\<strong>HTTP</strong>Binding\Solution\<strong>HTTP</strong>Binding_SQuote_Solution_PI.zip <strong>and</strong> hit Open<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 48 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ e. Click the Select All button to select all the check boxes <strong>for</strong> the projects listed<br />

__ f. Click Finish button (projects are imported <strong>and</strong> the auto-build will run)<br />

__ g. Verify you have Resources, SQuote, SQuoteClient <strong>and</strong> SQuoteWebClinet modules listed in<br />

the ‘Business Integration’ view<br />

____ 3. Verify you have WebSphere Process Server V6.1 listed in your ‘Servers’ view<br />

____ 4. Ensure the ‘Automatic Publishing’ is in the ‘Never publish automatically’ mode. By default the<br />

option select is ‘Never publish automatically’<br />

__ a. In the ‘Servers’ view, right click on ‘WebSphere Process Server V6.1’ <strong>and</strong> select ‘Open’ from the<br />

pop-up menu. This opens the ‘Server Overview’ panel <strong>for</strong> WebSphere Process Server V6.1<br />

__ b. In the ‘Server Overview’ panel, exp<strong>and</strong> ‘Automatic Publishing’ by clicking on the pull-down<br />

button ( ) <strong>and</strong> ensure the radio button <strong>for</strong> ‘Never publish automatically’ is selected<br />

__ c. Save the server configuration. File Save or Ctrl + S<br />

____ 5. Close the ‘Server Overview’ tab<br />

____ 6.<br />

Repeat all the steps of Part 4 (Deploying application) <strong>and</strong> Part 5 (Testing application). You can<br />

optionally, also per<strong>for</strong>m Part 6 (View <strong>HTTP</strong> traffic through TCP/IP monitor)<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 49 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

Task: Adding remote server to the WebSphere Integration Developer test<br />

environment<br />

This task describes how to add a remote server to the WebSphere Integration Developer test environment.<br />

This example uses a z/OS machine.<br />

____ 1.<br />

Define a new remote server to WebSphere Integration Developer.<br />

__ a. Right click on the background of the Servers view to access the pop-up menu.<br />

__ b. Select New Server.<br />

__ c. In the New Server dialog, specify the remote server’s host name, .<br />

__ d. Ensure that the appropriate server type, ‘WebSphere Process V6.1 Server’ or ‘WebSphere<br />

ESB v6.1 Server’, is highlighted in the server type list<br />

__ e. Click Next.<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 50 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

__ f. On the WebSphere Server Settings page, leave the radio button <strong>for</strong> SOAP selected, changing the<br />

SOAP connector port to the correct setting (). If security is on in your server,<br />

check the box <strong>for</strong> ‘Security is enabled on this server’ <strong>and</strong> input <strong>for</strong> the user ID <strong>and</strong><br />

<strong>for</strong> the password.<br />

__ g. Click Finish.<br />

__ h. The new server should be seen in the Server view.<br />

____ 2.<br />

Start the remote server if it is not already started. WebSphere Integration Developer does not<br />

support starting remote servers from the Server View.<br />

__ a. From a comm<strong>and</strong> prompt, telnet to the remote system if needed:<br />

2008 August, 19 IBM WebSphere V 6.1 – Lab exercise Page 51 of 52<br />

SCA <strong>HTTP</strong> binding


© Copyright IBM Corporation 2008. All rights reserved<br />

‘telnet ’<br />

User ID : <br />

Password : <br />

__ b. Navigate to the bin directory <strong>for</strong> the profile being used:<br />

cd /profiles//bin<br />

__ c. Run the comm<strong>and</strong> file to start the server: ./startServer.sh <br />

__ d. Wait <strong>for</strong> status message indicating server has started:<br />

ADMU3200I: Server launched. Waiting <strong>for</strong> initialization status<br />

ADMU3000I: Server sssr01 open <strong>for</strong> e-business; process id is 0000012000000002<br />

2008 August, 19 IBM WebSphere V6.1 – Lab exercise Page 52 of 52<br />

SCA <strong>HTTP</strong> binding

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!