Hi Ian,
Thanks for the response. It is very much appreciated.
I'm actually the developer and the one trying to use SAM. We work for
Sprint and our company uses MQ Series v6.x. I have an application
written in PHP that is trying to connect to the MQ server farm to send/
receive messages for our internal ticketing system. Most of our
applications in Sprint use a Java API but since this application was
written in PHP, we really want to make it work using SAM if possible.
I had my SA install all of the required packages (or at least what we
thought was correct) on our development app server which is a Linux
box. After doing so, he was able to test successfully that the MQ
Client was successfully installed. He was able to connect to the MQ
Mgr and put / get messages on the queue that was set up for us to use.
However, we are unable to get the PHP part working. He installed the
support pac IA94 located here ...
http://www-01.ibm.com/support/docview.wss?uid=swg24007092
as well as the IBM WebShere Client v6.0.2.6 located here ...
http://www-01.ibm.com/support/docview.wss?rs=171&uid=swg24009961&loc=en_US&cs=utf-8&lang=en.
He then set the proper settings to the PHP.ini file as he stated and
even added the following entries ...
[sam]
sam.factory.mqtt=mqtt
sam.factory.wmq=xms
sam.factory.wmq:client=xms
sam.factory.wmq:bindings=xms
sam.factory.wpm=xms
sam.factory.rtt=xms
While stepping through the code and inserting test points, it appears
that when the SAMXMSConnection() is being called from the
sam_factory_xms.php file, it is dying. If I insert an echo "test"
prior to this call, it works but not after.
I tried using the code that is located here
http://cvs.php.net/viewvc.cgi/pecl/sam/tests/sam_test1_wmq_p2p.php?view=markup
... first, changed the connection details, but it didn't work. Then,
to simplify things and only try to establish a connection, I reduced
it to this ...
<?php
//---------------------------------------------------------------
// ERROR CHECKING
//---------------------------------------------------------------
// what messages to report
error_reporting (E_ALL ^ E_NOTICE);
// this function will handle all reported errors
function my_error_handler ($errno, $errstr, $errfile, $errline) {
echo "In $errfile, line: $errline\n<br>$errstr\n<br>";
}
set_error_handler ('my_error_handler');
//---------------------------------------------------------------
echo "Testing MQ Connections<br>";
require_once('/usr/local/lib/php/SAM/php_sam.php');
$conn = new SAMConnection();
$conn->connect(SAM_WMQ, array(SAM_HOST => '
SPBO02DV.test.sprint.com',
SAM_PORT => 1428,
SAM_BROKER => 'SPBO02DV'));
if ($conn->isConnected()) {
echo 'Connection is active.';
} else {
echo 'No active connection!';
}
$msg = new SAMMessage('This is a simple text message');
$msg->header->SAM_REPLY_TO = 'DAN.D1.TRS.REPLY';
$correlid = $conn->send('TRS.MQ_REQUEST_D1', $msg);
if (!$correlid) {
// The Send failed!
echo "Send failed ($conn->errno) $conn->error";
} else {
$resp = $conn->receive('DAN.D1.TRS.REPLY', array(SAM_CORRELID =>
$correlid));
echo $resp;
}
$conn->disconnect();
echo "<br>Done";
?>
If you need to see a copy of our php.ini file or have any other
questions, just let me know. We've spent a great deal of time on this
so far and really hope you can help.
Thank you very much,
Larry