Matthew, sorry i didn't realise that SAM extension cannot be built
without XMS, I thought it was two separate libraries as 'sam' and
'sam_xms'. but in fact, I've just checked the SAM documentation, they
both require XMS as a prerequisite.
However, you also reminded me that the support of Stomp protocol may
work without building the extension. All you need to do is to include
once 'php_sam.php' somewhere in your php script. So for the message
binding, change would made to the if statements, that checks for
existence of SAM, appeared as
in file 'SCA/Bindings/message/Proxy.php' line 46
and in file 'SCA/Bindings/message/RequestTester.php' line 45
replace them with the following code
if ( ! (in_array('sam', get_loaded_extensions())) ) {
if (! include_once('SAM/php_sam.php') )
throw new SCA_RuntimeException("The SAM extension must be
installed");
}
Make sure you copied and replaced all the php files and sub
directories that contains php files, from the zip to where the old SAM
php files were located(e.g. c:\php\pear\SAM or /usr/local/libb/php/
SAM).
And another thing is I found there should be a close bracket '}' in
line 437 of the file 'php_sam.php' which I provided. I've created a
new zip, that may be the source for the segmentation fault. Sorry for
the mistake, I hope that works now.
Jack
On Mar 14, 10:56 am, Matthew Peters <matthew.f.pet...-gM/Ye1E23mwN+***@public.gmane.org>
wrote:
> OK, my first attempt failed at the first hurdle. The command "pecl
> install sam" failed during the phpize step, complaining because I did
> not have XMS present. Yet the documentation says XMS is optional. Do
> you have XMS on your system?
>
> I have raised this as a pecl bug also.
>
> Matthew
>
> On 11 Mar, 15:37, jpuerta <jbpuer...-***@public.gmane.org> wrote:
>
> > Ok....
>
> > Looking forward to the results of your test...
>
> > Thanks...
> > jpuerta
>
> > On 10 Mar, 13:50, Matthew Peters <matthew.f.pet...-gM/Ye1E23mwN+***@public.gmane.org>
> > wrote:
>
> > > Jack, jpuerta,
> > > I will do as Jack suggests and have a go with this on Linux myself. It
> > > will have to wait for a few days however, I am sorry to say, as I have
> > > a busy few days coming up. If anyone else has time to have a go,
> > > please be my guest.
>
> > > Matthew
>
> > > On Mar 10, 6:41 am, Jack Zai <za...-***@public.gmane.org> wrote:
>
> > > > Hello,
>
> > > > Oh, that doesn't looks good. well, be honest i never tested it on
> > > > Linux, but I 'm surprised you got a segmentation fault. The most of
> > > > changes I made to sam were on php files, those shouldn't affect the
> > > > binary you built. The only change I made to C files was the following
> > > > two lines which were added to php_sam.c.
>
> > > > REGISTER_STRING_CONSTANT(SAM_CONSTANT_PRIORITY, SAM_CONSTANT_PRIORITY,
> > > > CONST_CS | CONST_PERSISTENT);
> > > > REGISTER_STRING_CONSTANT(SAM_CONSTANT_TIMETOLIVE,
> > > > SAM_CONSTANT_TIMETOLIVE, CONST_CS | CONST_PERSISTENT);
>
> > > > And those are just for registering two constants "SAM_PRIORITY" and
> > > > "SAM_TIMETOLIVE". If you had no problem with the original sam, I don't
> > > > see how those two lines would cause a segmentation fault when loading
> > > > the extension.
>
> > > > Unfortunately, I am currently working on some other project, so I
> > > > don't have a running php environment right now, cannot help you out
> > > > there. I don't know if Matthew can confirm that my version of sam
> > > > works on Linux?
>
> > > > Jack
>
> > > > P.S. Changelog for sam:
>
> > > > 1. php_sam.c
> > > > - two lines added for registering constants SAM_CONSTANT_PRIORITY
> > > > and SAM_CONSTANT_TIMETOLIVE
> > > > 2. php_sam.php
> > > > - slightly changed the if statement in the create() method, for
> > > > handling stomp protocol.
> > > > - Fixed PECL bug #11034, deleted the carriage return at the end of
> > > > the file
> > > > 3. added file sam_factory_stomp.php
> > > > 4. created new folder Stomp
> > > > 5. added file Stomp/Stomp.php
> > > > 6. added file Stomp/sam_stomp.php
> > > > 7. added three testcases
>
> > > > On 6 Mar, 18:16, jpuerta <jbpuer...-***@public.gmane.org> wrote:
>
> > > > > Hello Jack, Matthew...
>
> > > > > I downloaded the zipfile, and successfully compiled Jack's version of
> > > > > the sam extension...
> > > > > But after loading the extension, php no longer works and we see a
> > > > > segmentation fault in the logs, so I was unable to test the example...
>
> > > > > I am testing all this on Linux...
> > > > > We have
> > > > > php 5.2.5
> > > > > apache 2.2.6
> > > > > activemq 5.0.0
>
> > > > > Thanks
> > > > > jpuerta
>
> > > > > On 6 Mar, 07:28, Matthew Peters <matthew.f.pet...-gM/Ye1E23mwN+***@public.gmane.org>
> > > > > wrote:
>
> > > > > > Jack, thanks for this very timely and authoritative reposnse.
>
> > > > > > jp, if you want, I can try and build the version of the zip file that
> > > > > > Jack's posting refers to and make sure that our samples run with that
> > > > > > precise level. Or you can try it first. Let me know what you would
> > > > > > like. And...are you on Windows or Linux or something else?
>
> > > > > > Matthew
>
> > > > > > On Mar 5, 4:05 am, Jack Zai <za...-***@public.gmane.org> wrote:
>
> > > > > > > Hello,
>
> > > > > > > The blank line in the WSDL may be caused by the carriage return at the
> > > > > > > end of file 'php_sam.php' (PECL bug #11034).
>
> > > > > > > In that case, i think you have used the current releases (1.1.0) of
> > > > > > > SAM, and I am afeard this version does NOT support some features of
> > > > > > > the message binding ( including the STOMP protocol ). Unfortunately,
> > > > > > > i've no idea when the next release of SAM becomes available. in the
> > > > > > > mean time, you may wish to try a patch file[1] and rebuild SAM
> > > > > > > extension yourself. Good luck!
>
> > > > > > > Jack
>
> > > > > > > [1] the patch file can be found at this linkhttp://groups.google.co.uk/group/phpsam/files
> > > > > > > (named sam_patch.txt), there is also a zip file contains the whole sam
> > > > > > > folder with the latest sources code.
>
> > > > > > > On 4 Mar, 23:04, jpuerta <jbpuer...-***@public.gmane.org> wrote:
>
> > > > > > > > Hi Matthew...
>
> > > > > > > > Unfortunately, we have still been unable to run a successful test with
> > > > > > > > the message binding...
> > > > > > > > The fatal error complaining about the class with "ms" in the name,
> > > > > > > > disappeared... creating the msd file works now, but trying with the
> > > > > > > > example you provided... we run the ReceivingService in one window, and
> > > > > > > > get the following output:
>
> > > > > > > > [***@was6testserver activemqtest]# /usr/local/php/bin/php
> > > > > > > > ReceivingService.php
>
> > > > > > > > Listener for queue://receiver has been started. To exit, press <Ctrl>
> > > > > > > > + <C> ...
>
> > > > > > > > Activemq is running on another window...
> > > > > > > > But when we run the test client it still fails displaying the
> > > > > > > > following error:
>
> > > > > > > > Fatal error: Uncaught SCA_RuntimeException: Send Request Failed thrown
> > > > > > > > in /usr/local/php/lib/SCA_SDO/SCA/Bindings/message/Proxy.php on line
> > > > > > > > 120
>
> > > > > > > > At this point we really don't know what we are doing wrong...
> > > > > > > > We installed activemq 5.0.0 on the localhost and on some other
> > > > > > > > server... but it made no difference
>
> > > > > > > > We are also still getting the blank line generating WSDLs and any
> > > > > > > > other XML file generated by sca, including the msd file... we still
> > > > > > > > don't know why this happens... but this behaviour only occurs, when
> > > > > > > > the sam extension is loaded... without it, all the wsdls are generated
> > > > > > > > fine...
>
> > > > > > > > We are using SCA_SDO version 1.2.4 now...
>
> > > > > > > > Any suggestion will be appreciated...
> > > > > > > > Thank you very much
>
> > > > > > > > jpuerta...
>
> > > > > > > > On 4 Mar, 07:06, Matthew Peters <***@googlemail.com>
> > > > > > > > wrote:
>
> > > > > > > > > Good, that sounds as if that has fixed the problem for you. How about
> > > > > > > > > the second one - a blank line in the wsdl? Did you find the source of
> > > > > > > > > the problem for that too?
>
> > > > > > > > > You'll see I have just released 1.2.4, by the way.
>
> > > > > > > > > Matthew
>
> > > > > > > > > On Mar 3, 4:06 pm, jpuerta <jbpuer...-***@public.gmane.org> wrote:
>
> > > > > > > > > > Hello Matthew...
>
> > > > > > > > > > Thank you very much for your help...
> > > > > > > > > > I tried the example you provided, but i was unable to get it to
> > > > > > > > > > work...
> > > > > > > > > > I still get the same error when I try this:
>
> > > > > > > > > >http://yummyphpprojjpuerta/services/activemqtest/ReceivingService.php...
>
> > > > > > > > > > Fatal error: Class 'SCA_Bindings_ms_ServiceDescriptionGenerator' not
> > > > > > > > > > found in /usr/local/php/lib/SCA_SDO-1.2.3/SCA/Bindings/message/
> > > > > > > > > > ServiceRequestHandler.php on line 49
>
> > > > > > > > > > I checked the line 49 in this file, and it looks like this:
> > > > > > > > > > SCA_Bindings_ms_ServiceDescriptionGenerator::generateMPD($service_description));
>
> > > > > > > > > > After that I browsed for the same file in the FULMAR branch you were
> > > > > > > > > > referring to (http://cvs.php.net/viewvc.cgi/pecl/sdo/SCA/Bindings/
> > > > > > > > > > message/ServiceRequestHandler.php?
> > > > > > > > > > hideattic=1&view=markup&pathrev=FULMAR), and found that the same line
> > > > > > > > > > looks different than the one in the SCA version we downloaded:
>
> > > > > > > > > > SCA_Bindings_message_ServiceDescriptionGenerator::generateMSD($service_description));
>
> > > > > > > > > > we downloaded the SCA_SDO stable version 1.2.3 from here:http://pecl.php.net/package/SCA_SDO/
>
> > > > > > > > > > Again... thank you for your help
> > > > > > > > > > jpuerta
>
> > > > > > > > > > On 3 Mar, 07:04, Matthew Peters <***@googlemail.com>
> > > > > > > > > > wrote:
>
> > > > > > > > > > > Hi, sorry to hear you are having problems.
>
> > > > > > > > > > > The Fatal error you are seeing looks odd: the _ms_ in the middle of
> > > > > > > > > > > the name looks like something somewhere is looking for a binding.ms
> > > > > > > > > > > rather than binding.message. I propose we try with an exaple that I
> > > > > > > > > > > know works - I show below a simple example that I have just tried out
> > > > > > > > > > > on my machine with ActiveMQ 5.0. I am running with the FULMAR branch
> > > > > > > > > > > of SCA but I don't think that should make any difference.
>
> > > > > > > > > > > As for the second error you report, the empty line, one reason for
> > > > > > > > > > > that can be a blank line in the php script on the receiving end - the
> > > > > > > > > > > one that is supposed to generate the wsdl. If there is a blank line
> > > > > > > > > > > before the first <?php, it comes out in the wsdl. In fact if any of
> > > > > > > > > > > the scripts that are involved in generating the wsdl emit anything
> > > > > > > > > > > before the <?xml declaration we get trouble - but I hope that the SCA
> > > > > > > > > > > scripts never do that.
>
> > > > > > > > > > > Here is my working example. See if it works for you. It's three files
> > > > > > > > > > > which for me are all in C:\Program Files\Apache Group\Apache2\htdocs
> > > > > > > > > > > \Frankfurt\Message
> > > > > > > > > > > where htdocs is of course the document root for my
>
> ...
>
> read more »