ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » Develop a web based application to read messages

Post new topic  Reply to topic
 Develop a web based application to read messages « View previous topic :: View next topic » 
Author Message
Beaula
PostPosted: Sat Oct 02, 2004 1:05 am    Post subject: Develop a web based application to read messages Reply with quote

Apprentice

Joined: 11 Sep 2002
Posts: 39
Location: Infotech, Madhapur,India

Hi,

I am new to developing web enabled application.

I would like to read messages transmitted by IBM MQSeries server through a web enabled application and format it to a predefined output format.

I have very little about the web servers and can somebody guide me to know the right methodology.

Is that the web enabled application which we develop needs to reside on a web server and the clients can access the application over the URL?.

Do the Client applications require the MQSeries Server or MQSeries Client to be installed on them for reading the message transmitted by the MQSeries server at the other end?

I read somewhere that the MQSeries Internet Gateway support pack only needs to be installed on the web server and the clients can read the message transmitted from the other end server? Is it correct?

Can anyone explain about my query?
Back to top
View user's profile Send private message Send e-mail
siliconfish
PostPosted: Sat Oct 02, 2004 9:50 am    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

If you are using only MQSeries, the application architecture goes like this.
The Web enabled appliaction resides on the app server or if its a simple application it will be deployed on the web server. The client/user sends the request from the URL/webpages to the web server by submitting the request data through the html forms. The request goes to the web/app server and the u can use any component written using MQ API to connect to the server as a client (if the server resides on another machine - u can also connect as client even if the MQ server resides on the same box a web/app server) or in bindings mode to get/put the messages to MQ.

I think MQSeries Internet Gateway is no longer available.
Back to top
View user's profile Send private message
PeterPotkay
PostPosted: Sat Oct 02, 2004 12:12 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

siliconfish wrote:
I think MQSeries Internet Gateway is no longer available.


It is.

http://www-1.ibm.com/support/docview.wss?rs=203&uid=swg24006386&loc=en_US&cs=utf-8&lang=en
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
siliconfish
PostPosted: Sat Oct 02, 2004 2:44 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

Thanks Peter , I didn't know that both of them are same.
Back to top
View user's profile Send private message
EddieA
PostPosted: Mon Oct 04, 2004 9:34 am    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

Peter,

Are you sure. The MQSeries Internet Gateway was a way of creating messages via HTML and POST requests, that was part of 5.1 (at least).

I didn't think that functionality had been added to the Pass Through Support Pac.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0


Last edited by EddieA on Mon Oct 04, 2004 4:42 pm; edited 1 time in total
Back to top
View user's profile Send private message
bower5932
PostPosted: Mon Oct 04, 2004 12:56 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

I think Eddie is right. There was a part of the product called the MQSeries Internet Gateway. I don't believe this exists any more (ie, in 5.3). The WMQ Internet pass-thru is a SupportPac (MS81).
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
PeterPotkay
PostPosted: Mon Oct 04, 2004 7:48 pm    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7722

My apologies. I saw MQSeries Internet Gateway and thought they meant MQSeries Internet Passthru.
_________________
Peter Potkay
Keep Calm and MQ On
Back to top
View user's profile Send private message
Beaula
PostPosted: Tue Oct 05, 2004 8:36 am    Post subject: Develop a web based application to read messages Reply with quote

Apprentice

Joined: 11 Sep 2002
Posts: 39
Location: Infotech, Madhapur,India

siliconfish wrote:
If you are using only MQSeries, the application architecture goes like this.
The Web enabled appliaction resides on the app server or if its a simple application it will be deployed on the web server. The client/user sends the request from the URL/webpages to the web server by submitting the request data through the html forms. The request goes to the web/app server and the u can use any component written using MQ API to connect to the server as a client (if the server resides on another machine - u can also connect as client even if the MQ server resides on the same box a web/app server) or in bindings mode to get/put the messages to MQ.

I think MQSeries Internet Gateway is no longer available.


Thank for explaning the architecture.

I have some more queries regarding the architecture.

If the my web application resides on the web/application server different ftom the MQSeries Server, then I should install MQSeries Server/Client on the Web/Application server to connect to the MQServer located on another machine. Is this correct?

In the case of web enabled application, which one do you prefer ASP/JSP?
Are there any reference samples to help me in programming?

Thanks in advance.
Back to top
View user's profile Send private message Send e-mail
siliconfish
PostPosted: Tue Oct 05, 2004 9:02 am    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

Quote:
If the my web application resides on the web/application server different ftom the MQSeries Server, then I should install MQSeries Server/Client on the Web/Application server to connect to the MQServer located on another machine. Is this correct?


It depends on the application, if your application doesn't need Transaction support u can use MQ Client or else u need MQ Server. Other design factors also needs to be considered when deciding between a client and server - like for exp : if your application is expecting replies and if you are connecting to a third party queue manager, they may not hols your reply messages as they will be servicing other clients also.

Quote:
In the case of web enabled application, which one do you prefer ASP/JSP?
Are there any reference samples to help me in programming?


I am not a web programmer - but I prefer JSP as MQSeries has inbuilt support Java/JMS.
_________________
siliconfish
Back to top
View user's profile Send private message
bamboozled_by_MQ
PostPosted: Tue Oct 05, 2004 1:29 pm    Post subject: Reply with quote

Voyager

Joined: 07 Jan 2004
Posts: 75

here is the sample for exactly what you want. it works prefect, there is a VBscript and Javascript example.

Code:
<!DOCTYPE HTML "-//IETF/DTD HTML//EN">
<HTML>
<HEAD><TITLE>WebSphere MQ Automation Classes for ActiveX verification test</TITLE>


<SCRIPT LANGUAGE="VBScript">

<!--
option explicit

sub VB_Click

' This file shows a trivial MQ example,
'   putting a message and getting it back.
'
' The Visual Basic Form handling and error checking is left oversimple
' to emphasize the MQ part of the code.
' We do not even check for 'standard' errors such as MQRC_Q_MGR_NOT_AVAILABLE.
' All checking is left to the 'on error' unit.
'
Dim qm       ' get at the queue manager
Dim q              ' get at the queue
Dim pmsg       ' message for putting
Dim gmsg       ' message for getting
                                ' (could use same one, using two shows the data flowed)
Dim pmo
Dim gmo

Dim ps 'As String                ' put string
Dim gs 'As String                ' string read back

Dim cr  ' carriage return
cr = chr(13)

' On Error Goto eee ' not allowed in VBScript.
' We catch the common errors in the AccessQueueManager call,
' but leave the rest to the environment for simplicity.

    ' start with me handling the error checking:
    ' this permits explicity checking for the most common problems
    on error resume next

    ' access the default queue manager
    Set qm = MQAXSession.AccessQueueManager("")

    ' make sure that everything is working as planned
    if err <> 0 then
      if err = 438 then
        msgbox "Cannot run example.  Please check:" _
               & cr & "    security settings (see text of this html page)" _
               & cr & "    proper installation and registration of MQAX."
      elseif err = 32000 then
        msgbox "Cannot access WebSphere MQ queue manager:" _
              & cr & "    " & MQAXSession.reasonName
      else
        msgbox "Unexpected error in sample " & err.description
      end if
      exit sub
    end if

    ' Check that queue manager accessed and connected ok.
    ' (This should have been caught by err=32000, but ???)
    if MQAXSession.reasonCode <> 0 then
      msgbox "BBB Cannot access WebSphere MQ queue manager:" _
           & cr & "    " & MQAXSession.reasonName
      exit sub
    end if

    ' reset the error checking, to save coding error handling
    ' for the remaining (unlikely) errors
    on error goto 0

    ' access a standard queue that should be there
    Set q = qm.AccessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE", 16 or 1) ' MQOO_OUTPUT Or MQOO_INPUT_AS_Q_DEF)

    ' create a new message object
    Set pmsg = MQAXSession.AccessMessage()
     
    ' prepare data and put it into the message
    ps = "12345678 " & Time
    pmsg.writeString ps
   
    ' create a (default) MqPutMessageOptions object
    Set pmo = MQAXSession.AccessPutMessageOptions()

    ' and do the put (explicit putMessageOptions, could default if we wanted)
    q.Put pmsg, pmo

    ' remake the message (prove something reaaly happened)
    Set gmsg = MQAXSession.AccessMessage()
   
    ' Set the messageId to make sure we read back the same message we just wrote
    '   (It would be easier just to reuse the message object for put and get,
    '   but then you might not believe that the message had really flowed.
    '   And anyway,  even trivial WebSphere MQ applications should be careful
    '   with messageId and correlationId,  so get in the habit.)
    gmsg.MessageId = pmsg.MessageId
   
    ' create a (default) MqGetMessageOptions object
    Set gmo = MQAXSession.AccessGetMessageOptions()

    ' and do the get (explicit getMessageOptions, could default if we wanted)
    q.Get gmsg, gmo

    ' now read the data from the input message
    gs = gmsg.ReadString(gmsg.MessageLength)
   
    ' confirm what went on
    If gs = ps Then
      msgbox "Test completed." & cr & _
             "Data read back: """ & gs & """" & cr & _
             "All went well.",, "MQAX Test for VBScript"
      'document.formtest.bvb.value = "Test completed." & cr & _
      '       "Data read back: """ & gs & """" & cr & _
      '       "All went well."
    Else
      msgbox "Data read back not equal to data put"  & cr & _
             "  data put:       """ & ps & """"  & cr & _
             "  data read back: """ & gs & """",, "MQAX test for VBScript"
    End If
   
    ' leave, no need to clean up - all necessary closes, disconnects etc are automatic
end sub
-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">

function Java_Click()
{

// This file shows a trivial MQ example,
//   putting a message and getting it back.
//
// The JavaScript Form handling and error checking is left oversimple
// to emphasize the MQ part of the code.
// We do not even check for //standard// errors such as MQRC_Q_MGR_NOT_AVAILABLE.
// All checking is left to the 'on error' unit.
//

    // access the default queue manager
    // (I do not know how to do error checking here.)
    qm = MQAXSession.AccessQueueManager("")

    // access a standard queue that should be there
    q = qm.AccessQueue("SYSTEM.DEFAULT.LOCAL.QUEUE", 16 | 1) // MQOO_OUTPUT Or MQOO_INPUT_AS_Q_DEF)

    // create a new message object
    pmsg = MQAXSession.AccessMessage()
     
    // prepare data and put it into the message
    ps = "12345678 is my JavaScript test"
    pmsg.writeString(ps)
   
    // and do the put (default putMessageOptions)
    q.Put(pmsg)

    // remake the message (prove something reaaly happened)
    gmsg = MQAXSession.AccessMessage()
   
    // Set the messageId to make sure we read back the same message we just wrote
    //   (It would be easier just to reuse the message object for put and get,
    //   but then you might not believe that the message had really flowed.
    //   And anyway,  even trivial WebSphere MQ applications should be careful
    //   with messageId and correlationId,  so get in the habit.)
    gmsg.MessageId = pmsg.MessageId
   
    // and do the get (default getMessageOptions)
    q.Get(gmsg)

    // now read the data from the input message
    gs = gmsg.ReadString(gmsg.MessageLength)
   
    // confirm what went on
    if (gs == ps) {
      m = "Test completed."
      m = m + "     " + "Data read back: '" + gs + "'"
      m = m + "     " + "All went well."
      alert(m)
    } else {
      m = "Data read back not equal to data put" 
      m = m + "     " + "  data put:       '" + ps + "'"
      m = m + "     " + "  data read back: '" + gs + "'"
      alert(m)
    }
   
    // leave, no need to clean up - all necessary closes, disconnects etc are automatic
}

</SCRIPT>

</HEAD>
<BODY>

<!-- my test Mq object (guid for MQAXSessionession) -->
<OBJECT
   classid="clsid:00290471-B893-11CF-A5F7-444553540000"
   id=MQAXSession
>
</OBJECT>
<P>

<H3>Installation Verification Test for VBScript and JavaScript</H3><HR>

<form name="Formtest">
  <input type="button" name="bvb" value="VBScript" onClick="VB_Click" language="VBScript">
  <input type="button" name="bjava" value="JavaScript" onClick="Java_Click()" language="JavaScript">
</form>

<p>This sample demonstrates the use of the WebSphere MQ Automation Classes for ActiveX
to call WebSphere MQ from an HTML page,
using code written in VBScript or JavaScript.
Click on either button above to send a predefined message to WebSphere MQ
and immediately retrieve it.
<em>
Under normal circumstances the WebSphere MQ Java client is recommended for use
with World Wide Web applications.
</em>
<p>
There are several limitations to the use of the
WebSphere MQ Automation Classes for ActiveX:
<UL>
<LI>Use a web browser that supports ActiveX controls;
for example Microsoft Internet Explorer 3 (preferably 3.02).
Note that NetScape Navigator may not be used.
<LI>This product is not signed as safe to operate from an arbitrary script.
This is because WebSphere MQ may be used to send data to outside the machine
on which it is executed.
A script could take advantage of this and cause security problems.
<P>A browser that is set up with default security options
will not execute any Automation Classes scripts.
To resolve this in Microsoft Internet Explorer,  choose menu item "view-options".
Select the "security" tab,  and the "safety level" button under "Active content".
<P>
In the "safety level" dialog select "Medium".
You will then be required to confirm the use of Automation Classes scripts each time you enter a
page that uses the Automation Classes.
<P>
The alternative is to use "Low" safety level:  this is not recommended for obvious reasons.
<P>
In the "security" page of the "options" dialog you must also select
"Enable ActiveX controls and plug-ins" and "Run ActiveX scripts".
It is not necessary to select "Enable Java programs" to run JavaScript programs.
<LI>
This product has not been certified or packed ready for automatic downloading into a Web browser.
<LI>
The Automation Classes constants are not available to VBScript and JavaScript programs.
If you look at the source of this page you will see that it has been necessary to hard code
constants such as MQOO_OUTPUT.  They may be looked up in "cmqc.h" provided with WebSphere MQ products.
<LI>Having changed any of the security settings for your web browser,
re-access this page.
</UL>
</FONT>
</BODY>
</HTML>




enjoy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Develop a web based application to read messages
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.