[Phpwm] RE: Phpwm Digest, Vol 37, Issue 4

Chris Allen pickledegg at hotmail.co.uk
Thu Oct 5 12:31:25 BST 2006


I'm just wondering how people regard UML, do you think it is a tool and 
worth learning or do you see it as unnecessary in practice? I ask as I'm 
designing a codeigniter application and have been reading up on UML.

Chris


>From: phpwm-request at mailman.lug.org.uk
>Reply-To: phpwm at mailman.lug.org.uk
>To: phpwm at mailman.lug.org.uk
>Subject: Phpwm Digest, Vol 37, Issue 4
>Date: Thu, 05 Oct 2006 11:50:39 +0100
>
>Send Phpwm mailing list submissions to
>	phpwm at mailman.lug.org.uk
>
>To subscribe or unsubscribe via the World Wide Web, visit
>	https://mailman.lug.org.uk/mailman/listinfo/phpwm
>or, via email, send a message with subject or body 'help' to
>	phpwm-request at mailman.lug.org.uk
>
>You can reach the person managing the list at
>	phpwm-owner at mailman.lug.org.uk
>
>When replying, please edit your Subject line so it is more specific
>than "Re: Contents of Phpwm digest..."
>
>
>Today's Topics:
>
>    1. Re: Next Meeting (Peter Crouch)
>    2. nuSoap question (Ray Masa)
>    3. Re: nuSoap question (Jon Spriggs)
>    4. Re: nuSoap question (Ray Masa)
>    5. RE: nuSoap question (Phil Beynon)
>    6. RE: nuSoap question (Ray Masa)
>
>
>----------------------------------------------------------------------
>
>Message: 1
>Date: Wed, 04 Oct 2006 23:29:14 +0100
>From: Peter Crouch <pccrouch at bcs.org.uk>
>Subject: Re: [Phpwm] Next Meeting
>To: West Midlands PHP User Group <phpwm at mailman.lug.org.uk>
>Message-ID: <452435BA.306 at bcs.org.uk>
>Content-Type: text/plain; charset=us-ascii; format=flowed
>
>The 12th is OK for me but I still need to know if you can get to Binley
>Business Park by public transport from either Pool Meadow or the railway
>station.
>
>Best wishes
>
>Peter Crouch
>-------------------------------------------------
>Tel: 0121 523 6756
>Fax: 0121 523 6756 with prior arrangement
>E-mail: pccrouch at bcs.org.uk
>
>**********************************************************************
>This email and any files transmitted with it are confidential and
>intended solely for the use of the individual or entity to whom they
>are addressed. If you have received this email in error please notify
>the system manager.
>**********************************************************************
>
>
>Katherine Goodwin wrote:
> > Hi,
> > David Goodwin wrote :
> >
> >>> As a follow up to the meetings page on the wiki, I vote for the next
> >>> meeting to be in Coventry (I wonder why?!).
> >>>
> >>>
> >> Jake, when you decide upon a time/date etc, could you also publish it 
>to
> >> php.net? I've updated the wiki to say the next talk will be in Coventry
> >> in October
> >>
> >>
> > As we've had no other suggestions so far, can I put forward Thursday 12
> > October as a potential date, just to get the ball rolling...
> >
> > Kat
> >
> > _______________________________________________
> > Phpwm mailing list
> > Phpwm at mailman.lug.org.uk
> > https://mailman.lug.org.uk/mailman/listinfo/phpwm
> > Wiki: http://wiki.phpwm.org
> >
> >
> >
>
>
>
>------------------------------
>
>Message: 2
>Date: Thu, 05 Oct 2006 01:35:17 -0700
>From: "Ray Masa" <raymasa at hotmail.com>
>Subject: [Phpwm] nuSoap question
>To: phpwm at mailman.lug.org.uk
>Message-ID: <BAY114-F17D659D2E5513EFC091453BB120 at phx.gbl>
>Content-Type: text/plain; format=flowed
>
>Hi all,
>
>Not sure if this is a relevant question for this forum, since I think the
>issue is more to do with nuSoap rather than PHP or mySQL, but I figured I
>ask any way.  I am getting by feet wet on web services and found nuSoap,
>which seems like a very cool tool. I followed an example at codewalkers.com
>(http://codewalkers.com/tutorials/74/1.html) which worked very well. I then
>proceed to modify that example a bit further to retrieve data from the
>database dynamically (you enter information in the form on the soap client
>and get the result back based on the parameter you entered). I was able to
>retrieve a single record from the database, but not multiple records. When 
>I
>tried the php code (without soap) to retrieve data from the database, I was
>able to retrieve multiple records, so it seems like the SQL statement is
>correct. If so, why is it not working with nuSoap? Any suggestions on what 
>I
>am doing wrong?
>
>The soap server is as follows:
>
>Code:
>
><?php
>function getStockQuote($id) {
>
>     mysql_connect('host','username','password');
>     mysql_select_db('db');
>     $query = "SELECT * FROM table "
>            . "WHERE id = '$id' ";
>     $result = mysql_query($query);
>
>     while ($row = mysql_fetch_assoc($result)){
>     return $row['stock'];
>     }
>}
>
>require('lib/nusoap.php');
>
>$server = new soap_server();
>
>$server->configureWSDL('server', 'urn:stockquote');
>
>$server->register("getStockQuote",
>                 array('symbol' => 'xsd:string'),
>                 array('return' => 'xsd:string'),
>                 'urn:stockquote',
>                 'urn:stockquote#getStockQuote');
>
>$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
>                       ? $HTTP_RAW_POST_DATA : '';
>$server->service($HTTP_RAW_POST_DATA);
>?>
>
>
>What I am trying to do is retrieve all stocks associated with the id that 
>is
>entered in the form on the soap client. But it is only returning the first
>record in the table.
>
>If I try just the following SQL statement in a php file, it return all
>records:
>
>Code:
>
>    mysql_connect('host','username','password');
>     mysql_select_db('db');
>     $query = "SELECT * FROM table "
>            . "WHERE id = '$id' ";
>     $result = mysql_query($query);
>
>     while ($row = mysql_fetch_assoc($result)){
>     echo $row['stock'];
>     }
>
>
>
>The soap client for the above server is:
>
>Code:
>
><html>
><body>
>
><form method="get" action="client.php">
>   ID: <input name="symbol" type="text" value="">
>   <br>
>   <br>
>   <input type="submit">
></form>
>
><?php
>
>$symbol = $_GET['symbol'];
>
>if ($symbol) {
>
>require_once('lib/nusoap.php');
>
>//we create an array with the element name that has the form value of name
>
>//now we must create a soapclient object
>$c = new soapclient('http://domain.com/server.php');
>//now we call the server.
>
>$stockprice = $c->call('getStockQuote',
>               array('symbol' => $symbol));
>
>echo "Information for $symbol is $stockprice.";
>
>
>}
>
>?>
>
>
></body>
></html>
>
>
>
>So, it seems that I am doing something incorrectly in the soap server.
>
>Thanks for your help.
>
>Ray
>
>
>
>
>
>------------------------------
>
>Message: 3
>Date: Thu, 5 Oct 2006 09:42:49 +0100
>From: "Jon Spriggs" <jon at spriggs.org.uk>
>Subject: Re: [Phpwm] nuSoap question
>To: "West Midlands PHP User Group" <phpwm at mailman.lug.org.uk>
>Message-ID:
>	<96df2e0b0610050142t6f7482e8g7eeaffea71b34da4 at mail.gmail.com>
>Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
>To be honest Ray, I've never had it returning array values properly -
>I've even got to the point where I build a string array first (using
>symbols outside the expected range) and then split it at the far end.
>
>It is possible to return an array, but I think you need to create a
>new "array" type, which specifies the number of entries in the array
>(so for $Key=>$Value, that'd be 2 I think, unless
>$Var['fred']="twist"; $var['george']="stick"; is 2... I'm not sure.)
>But even then, I'm not sure. If you figure it out, can you let me know
>how you did it :)
>
>Regards,
>
>Jon
>
>On 05/10/06, Ray Masa <raymasa at hotmail.com> wrote:
> > Hi all,
> >
> > Not sure if this is a relevant question for this forum, since I think 
>the
> > issue is more to do with nuSoap rather than PHP or mySQL, but I figured 
>I
> > ask any way.  I am getting by feet wet on web services and found nuSoap,
> > which seems like a very cool tool. I followed an example at 
>codewalkers.com
> > (http://codewalkers.com/tutorials/74/1.html) which worked very well. I 
>then
> > proceed to modify that example a bit further to retrieve data from the
> > database dynamically (you enter information in the form on the soap 
>client
> > and get the result back based on the parameter you entered). I was able 
>to
> > retrieve a single record from the database, but not multiple records. 
>When I
> > tried the php code (without soap) to retrieve data from the database, I 
>was
> > able to retrieve multiple records, so it seems like the SQL statement is
> > correct. If so, why is it not working with nuSoap? Any suggestions on 
>what I
> > am doing wrong?
> >
> > The soap server is as follows:
> >
> > Code:
> >
> > <?php
> > function getStockQuote($id) {
> >
> >     mysql_connect('host','username','password');
> >     mysql_select_db('db');
> >     $query = "SELECT * FROM table "
> >            . "WHERE id = '$id' ";
> >     $result = mysql_query($query);
> >
> >     while ($row = mysql_fetch_assoc($result)){
> >     return $row['stock'];
> >     }
> > }
> >
> > require('lib/nusoap.php');
> >
> > $server = new soap_server();
> >
> > $server->configureWSDL('server', 'urn:stockquote');
> >
> > $server->register("getStockQuote",
> >                 array('symbol' => 'xsd:string'),
> >                 array('return' => 'xsd:string'),
> >                 'urn:stockquote',
> >                 'urn:stockquote#getStockQuote');
> >
> > $HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
> >                       ? $HTTP_RAW_POST_DATA : '';
> > $server->service($HTTP_RAW_POST_DATA);
> > ?>
> >
> >
> > What I am trying to do is retrieve all stocks associated with the id 
>that is
> > entered in the form on the soap client. But it is only returning the 
>first
> > record in the table.
> >
> > If I try just the following SQL statement in a php file, it return all
> > records:
> >
> > Code:
> >
> >    mysql_connect('host','username','password');
> >     mysql_select_db('db');
> >     $query = "SELECT * FROM table "
> >            . "WHERE id = '$id' ";
> >     $result = mysql_query($query);
> >
> >     while ($row = mysql_fetch_assoc($result)){
> >     echo $row['stock'];
> >     }
> >
> >
> >
> > The soap client for the above server is:
> >
> > Code:
> >
> > <html>
> > <body>
> >
> > <form method="get" action="client.php">
> >   ID: <input name="symbol" type="text" value="">
> >   <br>
> >   <br>
> >   <input type="submit">
> > </form>
> >
> > <?php
> >
> > $symbol = $_GET['symbol'];
> >
> > if ($symbol) {
> >
> > require_once('lib/nusoap.php');
> >
> > //we create an array with the element name that has the form value of 
>name
> >
> > //now we must create a soapclient object
> > $c = new soapclient('http://domain.com/server.php');
> > //now we call the server.
> >
> > $stockprice = $c->call('getStockQuote',
> >               array('symbol' => $symbol));
> >
> > echo "Information for $symbol is $stockprice.";
> >
> >
> > }
> >
> > ?>
> >
> >
> > </body>
> > </html>
> >
> >
> >
> > So, it seems that I am doing something incorrectly in the soap server.
> >
> > Thanks for your help.
> >
> > Ray
> >
> >
> >
> > _______________________________________________
> > Phpwm mailing list
> > Phpwm at mailman.lug.org.uk
> > https://mailman.lug.org.uk/mailman/listinfo/phpwm
> >
>
>
>
>------------------------------
>
>Message: 4
>Date: Thu, 05 Oct 2006 02:18:33 -0700
>From: "Ray Masa" <raymasa at hotmail.com>
>Subject: Re: [Phpwm] nuSoap question
>To: phpwm at mailman.lug.org.uk
>Message-ID: <BAY114-F14E0C152B57BA979F54786BB120 at phx.gbl>
>Content-Type: text/plain; format=flowed
>
>Hi jon,
>
>Thanks for the pointers.  Will let you know if I figure it out...:).
>
>Ray
>
>
> >From: "Jon Spriggs" <jon at spriggs.org.uk>
> >Reply-To: West Midlands PHP User Group <phpwm at mailman.lug.org.uk>
> >To: "West Midlands PHP User Group" <phpwm at mailman.lug.org.uk>
> >Subject: Re: [Phpwm] nuSoap question
> >Date: Thu, 5 Oct 2006 09:42:49 +0100
> >
> >To be honest Ray, I've never had it returning array values properly -
> >I've even got to the point where I build a string array first (using
> >symbols outside the expected range) and then split it at the far end.
> >
> >It is possible to return an array, but I think you need to create a
> >new "array" type, which specifies the number of entries in the array
> >(so for $Key=>$Value, that'd be 2 I think, unless
> >$Var['fred']="twist"; $var['george']="stick"; is 2... I'm not sure.)
> >But even then, I'm not sure. If you figure it out, can you let me know
> >how you did it :)
> >
> >Regards,
> >
> >Jon
> >
> >On 05/10/06, Ray Masa <raymasa at hotmail.com> wrote:
> >>Hi all,
> >>
> >>Not sure if this is a relevant question for this forum, since I think 
>the
> >>issue is more to do with nuSoap rather than PHP or mySQL, but I figured 
>I
> >>ask any way.  I am getting by feet wet on web services and found nuSoap,
> >>which seems like a very cool tool. I followed an example at
> >>codewalkers.com
> >>(http://codewalkers.com/tutorials/74/1.html) which worked very well. I
> >>then
> >>proceed to modify that example a bit further to retrieve data from the
> >>database dynamically (you enter information in the form on the soap 
>client
> >>and get the result back based on the parameter you entered). I was able 
>to
> >>retrieve a single record from the database, but not multiple records. 
>When
> >>I
> >>tried the php code (without soap) to retrieve data from the database, I
> >>was
> >>able to retrieve multiple records, so it seems like the SQL statement is
> >>correct. If so, why is it not working with nuSoap? Any suggestions on 
>what
> >>I
> >>am doing wrong?
> >>
> >>The soap server is as follows:
> >>
> >>Code:
> >>
> >><?php
> >>function getStockQuote($id) {
> >>
> >>     mysql_connect('host','username','password');
> >>     mysql_select_db('db');
> >>     $query = "SELECT * FROM table "
> >>            . "WHERE id = '$id' ";
> >>     $result = mysql_query($query);
> >>
> >>     while ($row = mysql_fetch_assoc($result)){
> >>     return $row['stock'];
> >>     }
> >>}
> >>
> >>require('lib/nusoap.php');
> >>
> >>$server = new soap_server();
> >>
> >>$server->configureWSDL('server', 'urn:stockquote');
> >>
> >>$server->register("getStockQuote",
> >>                 array('symbol' => 'xsd:string'),
> >>                 array('return' => 'xsd:string'),
> >>                 'urn:stockquote',
> >>                 'urn:stockquote#getStockQuote');
> >>
> >>$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA)
> >>                       ? $HTTP_RAW_POST_DATA : '';
> >>$server->service($HTTP_RAW_POST_DATA);
> >>?>
> >>
> >>
> >>What I am trying to do is retrieve all stocks associated with the id 
>that
> >>is
> >>entered in the form on the soap client. But it is only returning the 
>first
> >>record in the table.
> >>
> >>If I try just the following SQL statement in a php file, it return all
> >>records:
> >>
> >>Code:
> >>
> >>    mysql_connect('host','username','password');
> >>     mysql_select_db('db');
> >>     $query = "SELECT * FROM table "
> >>            . "WHERE id = '$id' ";
> >>     $result = mysql_query($query);
> >>
> >>     while ($row = mysql_fetch_assoc($result)){
> >>     echo $row['stock'];
> >>     }
> >>
> >>
> >>
> >>The soap client for the above server is:
> >>
> >>Code:
> >>
> >><html>
> >><body>
> >>
> >><form method="get" action="client.php">
> >>   ID: <input name="symbol" type="text" value="">
> >>   <br>
> >>   <br>
> >>   <input type="submit">
> >></form>
> >>
> >><?php
> >>
> >>$symbol = $_GET['symbol'];
> >>
> >>if ($symbol) {
> >>
> >>require_once('lib/nusoap.php');
> >>
> >>//we create an array with the element name that has the form value of 
>name
> >>
> >>//now we must create a soapclient object
> >>$c = new soapclient('http://domain.com/server.php');
> >>//now we call the server.
> >>
> >>$stockprice = $c->call('getStockQuote',
> >>               array('symbol' => $symbol));
> >>
> >>echo "Information for $symbol is $stockprice.";
> >>
> >>
> >>}
> >>
> >>?>
> >>
> >>
> >></body>
> >></html>
> >>
> >>
> >>
> >>So, it seems that I am doing something incorrectly in the soap server.
> >>
> >>Thanks for your help.
> >>
> >>Ray
> >>
> >>
> >>
> >>_______________________________________________
> >>Phpwm mailing list
> >>Phpwm at mailman.lug.org.uk
> >>https://mailman.lug.org.uk/mailman/listinfo/phpwm
> >>
> >
> >_______________________________________________
> >Phpwm mailing list
> >Phpwm at mailman.lug.org.uk
> >https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>
>
>
>
>------------------------------
>
>Message: 5
>Date: Thu, 5 Oct 2006 11:11:43 +0100
>From: "Phil Beynon" <phil at infolinkelectronics.co.uk>
>Subject: RE: [Phpwm] nuSoap question
>To: "West Midlands PHP User Group" <phpwm at mailman.lug.org.uk>
>Message-ID:
>	<MDBBIMBGKCJEJKIHMENGEEOHKLAA.phil at infolinkelectronics.co.uk>
>Content-Type: text/plain;	charset="iso-8859-1"
>
>
> > <?php
> > function getStockQuote($id) {
> >
> >     mysql_connect('host','username','password');
> >     mysql_select_db('db');
> >     $query = "SELECT * FROM table "
> >            . "WHERE id = '$id' ";
> >     $result = mysql_query($query);
> >
> >     while ($row = mysql_fetch_assoc($result)){
> >     return $row['stock'];
> >     }
> > }
>
>Thats not going to work. Its starting a loop then dropping straight out of
>it with a return, it doesnt go anywhere else.
>It should be 'return array' as well.
>Plus if it didn't get a result and returned with no data wouldn't that
>effectively unset() your variable when it returned with nothing?
>
> > What I am trying to do is retrieve all stocks associated with the
> > id that is
> > entered in the form on the soap client. But it is only returning
> > the first
> > record in the table.
> >
> > If I try just the following SQL statement in a php file, it return all
> > records:
> >
> > Code:
> >
> >    mysql_connect('host','username','password');
> >     mysql_select_db('db');
> >     $query = "SELECT * FROM table "
> >            . "WHERE id = '$id' ";
> >     $result = mysql_query($query);
> >
> >     while ($row = mysql_fetch_assoc($result)){
> >     echo $row['stock'];
> >     }
> >
>
>That works because the While loop gets a chance to finish, i.e. its parsed
>the entire array.
>
>Put PHPMyAdim on the server. It works! :-)
>
>Regards,
>
>Phil
>
>
>
>
>------------------------------
>
>Message: 6
>Date: Thu, 05 Oct 2006 03:50:21 -0700
>From: "Ray Masa" <raymasa at hotmail.com>
>Subject: RE: [Phpwm] nuSoap question
>To: phpwm at mailman.lug.org.uk
>Message-ID: <BAY114-F37DDD26971486C1C967FF2BB120 at phx.gbl>
>Content-Type: text/plain; format=flowed
>
>Ah, so what’s the difference between the two while loop statements (sorry, 
>I
>am a newbie..:) ).  And what would be a better SQL statement to display all
>the records?
>
>Thanks,
>
>Ray
>
>
>
> > > <?php
> > > function getStockQuote($id) {
> > >
> > >     mysql_connect('host','username','password');
> > >     mysql_select_db('db');
> > >     $query = "SELECT * FROM table "
> > >            . "WHERE id = '$id' ";
> > >     $result = mysql_query($query);
> > >
> > >     while ($row = mysql_fetch_assoc($result)){
> > >     return $row['stock'];
> > >     }
> > > }
> >
> >Thats not going to work. Its starting a loop then dropping straight out 
>of
> >it with a return, it doesnt go anywhere else.
> >It should be 'return array' as well.
> >Plus if it didn't get a result and returned with no data wouldn't that
> >effectively unset() your variable when it returned with nothing?
>
> > > Code:
> > >
> > >    mysql_connect('host','username','password');
> > >     mysql_select_db('db');
> > >     $query = "SELECT * FROM table "
> > >            . "WHERE id = '$id' ";
> > >     $result = mysql_query($query);
> > >
> > >     while ($row = mysql_fetch_assoc($result)){
> > >     echo $row['stock'];
> > >     }
> > >
> >
> >That works because the While loop gets a chance to finish, i.e. its 
>parsed
> >the entire array.
> >
> >
> >Phil
> >
> >
> >_______________________________________________
> >Phpwm mailing list
> >Phpwm at mailman.lug.org.uk
> >https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>
>
>
>
>------------------------------
>
>_______________________________________________
>Phpwm mailing list
>Phpwm at mailman.lug.org.uk
>https://mailman.lug.org.uk/mailman/listinfo/phpwm
>
>
>End of Phpwm Digest, Vol 37, Issue 4
>************************************

_________________________________________________________________
Windows Live™ Messenger has arrived. Click here to download it for free! 
http://imagine-msn.com/messenger/launch80/?locale=en-gb




More information about the Phpwm mailing list