php-general Digest 26 Sep 2007 13:01:12 -0000 Issue 5039
Topics (messages 262462 through 262478):
Re: Data request
262462 by: tedd
262463 by: Steve Edberg
262464 by: Robert Cummings
262465 by: Børge Holen
262478 by: David Robley
Re: Strategy for Secure File Storage
262466 by: Colin Guthrie
SFTP connections via PHP
262467 by: Cameron Just
SOAP in PHP on very restricted host?
262468 by: David Zentgraf
262469 by: mike
262470 by: David Zentgraf
262471 by: Nathan Nobbe
262472 by: mike
262473 by: David Zentgraf
262474 by: David Zentgraf
262475 by: Nathan Nobbe
262477 by: David Zentgraf
Extract SOAP Request Data
262476 by: Jeffery Fernandez
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[EMAIL PROTECTED]
----------------------------------------------------------------------
--- Begin Message ---
At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > Heck, I am turning 30 at the end of next month :o( Quit talking about age
> > *big grin*
30 ?!
I got underwear older than that.
Cheers,
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
At 4:57 PM -0400 9/25/07, tedd <[EMAIL PROTECTED]> wrote:
At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > Heck, I am turning 30 at the end of next month :o( Quit
talking about age
> > *big grin*
30 ?!
I got underwear older than that.
...I've got some card decks from my first programming job (on a
computer that had *actual* core memory) that are almost that old
(totters off to get some Geritol and scream at the kids on my lawn)
steve
--
+--------------- my people are the people of the dessert, ---------------+
| Steve Edberg http://pgfsun.ucdavis.edu/ |
| UC Davis Genome Center [EMAIL PROTECTED] |
| Bioinformatics programming/database/sysadmin (530)754-9127 |
+---------------- said t e lawrence, picking up his fork ----------------+
--- End Message ---
--- Begin Message ---
On Tue, 2007-09-25 at 16:57 -0400, tedd wrote:
> At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
> >On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
> >> On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> >
> > > > Heck, I am turning 30 at the end of next month :o( Quit talking about
> > age
> > > > *big grin*
>
> 30 ?!
>
> I got underwear older than that.
Ted, what's you're PayPal addie, I'm gonna send you some cash for new
underwear :B
Cheers,
Rob.
--
...........................................................
SwarmBuy.com - http://www.swarmbuy.com
Leveraging the buying power of the masses!
...........................................................
--- End Message ---
--- Begin Message ---
On Tuesday 25 September 2007 16:10:47 Robert Cummings wrote:
> On Tue, 2007-09-25 at 16:57 -0400, tedd wrote:
> > At 9:17 AM -0400 9/25/07, Robert Cummings wrote:
> > >On Tue, 2007-09-25 at 10:44 -0600, Børge Holen wrote:
> > >> On Tuesday 25 September 2007 03:27:25 Christian Hänsel wrote:
> > > > > "Colin Guthrie" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> > > > >
> > > > > Heck, I am turning 30 at the end of next month :o( Quit talking
> > > > > about age *big grin*
> >
> > 30 ?!
> >
> > I got underwear older than that.
>
> Ted, what's you're PayPal addie, I'm gonna send you some cash for new
> underwear :B
just my thoughts to
>
> Cheers,
> Rob.
> --
> ...........................................................
> SwarmBuy.com - http://www.swarmbuy.com
>
> Leveraging the buying power of the masses!
> ...........................................................
--- End Message ---
--- Begin Message ---
Paul Scott wrote:
>
> On Tue, 2007-09-25 at 09:17 -0400, Robert Cummings wrote:
>> Oh sure, and now when I'm searching for "shit" I'll get all these
>> Henry's cat references *bleh*.
>>
> Well then why not tie in "coprophilia" as well?
>
> ugh.
>
> --Paul
You gotta love that shit... oh wait, that's what you said :-)
Cheers
--
David Robley
A cat is a four footed allergen.
Today is Prickle-Prickle, the 50th day of Bureaucracy in the YOLD 3173.
Celebrate Bureflux
--- End Message ---
--- Begin Message ---
Kevin Murphy wrote:
> $ext = explode(".",$file);
>
> $extension = $mimetypes["$ext[1]"];
Other people have provided answers so I'll just make a quick comment on
this bit.
It's not ideal but if you only upload a subset of file types then I
guess it's OK.
Also if the file has more than a single "dot" in it (e.g. my.image.jpg)
which is perfectly valid, then $ext[1] will contain ("image") which
isn't right.
If possible use e.g.
http://www.php.net/manual/en/function.mime-content-type.php or Example
606 here http://www.php.net/manual/en/function.finfo-file.php but these
may not be available on your PHP install.
You should probably check more thoroughly:
e.g.
$mimetype = 'application/octet-stream'; // default
$ext = array_pop($dummy = explode('.', $file));
if (!empty($mimetypes[$ext]))
$mimetype = $mimetypes[$ext];
or something similar.... (not tested above!)
Hope this helps ya.
Col
--- End Message ---
--- Begin Message ---
Hi All,
Just wondering if anyone has had any success getting a connection
working with PHP via SFTP.
I am running
Win 2003 Server
PHP Version 5.1.6
Win32 OpenSSL v0.9.8e Light is installed
PECL module for SSH2 is installed
The following code
-----------------------------
// create connetion to remote server
if (!$sftpConnection = ssh2_connect(DNCR_SERVERNAME, 22)) {
echo 'ERROR: Server connection failed.' . "\n";
exit;
}
// check fingerprint of remote server matches what we expect
$dncrFingerprint = ssh2_fingerprint($sftpConnection,
SSH2_FINGERPRINT_MD5 | SSH2_FINGERPRINT_HEX);
if ($dncrFingerprint != DNCR_FINGERPRINT && FALSE) {
echo 'ERROR: Hostkey mismatch.' . "\n";
exit;
}
// ensure that authentication methods allowed
$sshAcceptedAuthenticationMethods =
ssh2_auth_none($sftpConnection,DNCR_USERNAME);
echo "\n" . 'Accepted authentication methods:' . "\n";
for ($i = 0; $i < count($sshAcceptedAuthenticationMethods); $i++)
echo $sshAcceptedAuthenticationMethods[$i] . "\n";
echo "\n";
$sshNegotiatedMethods = ssh2_methods_negotiated($sftpConnection);
echo 'Encryption keys were negotiated using: {' .
$sshNegotiatedMethods['kex'] . '}' . "\n";
echo 'Server identified using an {' .
$sshNegotiatedMethods['hostkey'] . '} with ';
echo 'fingerprint: ' . ssh2_fingerprint($sftpConnection) . "\n";
echo 'Client to Server packets will use methods:' . "\n";
echo 'Crypt: {' . $sshNegotiatedMethods['client_to_server']['crypt']
. '}' . "\n";
echo 'Comp: {' . $sshNegotiatedMethods['client_to_server']['comp'] .
'}' . "\n";
echo 'MAC: {' . $sshNegotiatedMethods['client_to_server']['mac'] .
'}' . "\n";
echo 'Server to Client packets will use methods:' . "\n";
echo 'Crypt: {' . $sshNegotiatedMethods['server_to_client']['crypt']
. '}' . "\n";
echo 'Comp: {' . $sshNegotiatedMethods['server_to_client']['comp'] .
'}' . "\n";
echo 'MAC: {' . $sshNegotiatedMethods['server_to_client']['mac'] .
'}' . "\n";
if (!ssh2_auth_password($sftpConnection, DNCR_USERNAME ,
DNCR_PASSWORD)) {
echo 'ERROR: Cannot authenticate to remote server.' . "\n";
exit;
}
-----------------------------
produces the following result
-----------------------------
Accepted authentication methods:
publickey
keyboard-interactive
Encryption keys were negotiated using: {diffie-hellman-group14-sha1}
Server identified using an {ssh-dss} with fingerprint:
F4EE0910B0C6BA932908320145F87790
Client to Server packets will use methods:
Crypt: {aes256-cbc}
Comp: {none}
MAC: {hmac-sha1}
Server to Client packets will use methods:
Crypt: {aes256-cbc}
Comp: {none}
MAC: {hmac-sha1}
*Warning*: ssh2_auth_password() [function.ssh2-auth-password
<http://vesd.rd.cx/phoenix/function.ssh2-auth-password>]: Authentication
failed for myusername using password in
*c:\Inetpub\wwwroot\VESD\phoenix\composer-stage1-wash-file-submission.php*
on line *67*
ERROR: Cannot authenticate to remote server.
-----------------------------
I can connect to this remote server via SFTP using Filezilla so there is
no firewall issues.
I also did a bit of reading on the accepted authentication method of
keyboard-interactive and it states that password should be allowed to be
sent
http://www.ssh.com/support/documentation/online/ssh/winhelp/32/overview.html
Any help would be greatly appreciated.
Thankyou
PS: I am sorry for the double post but noone has responded to this email
on the windows list so I thought I would try my luck here...
--- End Message ---
--- Begin Message ---
Hi,
We need to work with a credit card checking company for an online
store. The one we're looking at only offers an API implementation via
PHP modules, or via SOAP protocol. Unfortunately our host is
extremely restrictive right now and did not --enable-soap and even
did a --without-pear, so we can't even use the PEAR::SOAP package. Is
there another implementation of SOAP or another way to possibly get
SOAP going in such a restrictive environment?
If not we'll have to switch either the host or the CC company...
Best Regards,
Dav
--- End Message ---
--- Begin Message ---
On 9/25/07, David Zentgraf <[EMAIL PROTECTED]> wrote:
> Hi,
>
> We need to work with a credit card checking company for an online
> store. The one we're looking at only offers an API implementation via
> PHP modules, or via SOAP protocol. Unfortunately our host is
> extremely restrictive right now and did not --enable-soap and even
> did a --without-pear, so we can't even use the PEAR::SOAP package. Is
> there another implementation of SOAP or another way to possibly get
> SOAP going in such a restrictive environment?
i've downloaded PEAR packages before and used them manually.
all PEAR is is PHP object code modules in a central place. nothing
special, really.
you just have to tweak some script paths and you can use
include/require on the files like normal.
--- End Message ---
--- Begin Message ---
On 26. Sep 2007, at 13:19, mike wrote:
i've downloaded PEAR packages before and used them manually.
all PEAR is is PHP object code modules in a central place. nothing
special, really.
you just have to tweak some script paths and you can use
include/require on the files like normal.
That's what I thought, but PEAR::SOAP seems to depend on the PEAR
base package. ...which I could probably install manually as well, I
know.
But I just found out about NuSOAP (http://dietrich.ganx4.com/
nusoap/), which seems to be what I'm looking for, a no-strings-
attached SOAP implementation. I'm trying my luck with this one for
now. :)
Cheers,
Dav
--- End Message ---
--- Begin Message ---
i just read the first message in this thread and NuSoap immediately came to
mind.
though it will solve your problem you may end up like me, hating to use
NuSoap
under duress. i think it was really popular back in th php4 days when there
was
nothing solid that could be built right into php. anyway in my experience
its a
relic and i try to stay away from it if i can.
-nathan
On 9/26/07, David Christopher Zentgraf <[EMAIL PROTECTED]> wrote:
>
> On 26. Sep 2007, at 13:19, mike wrote:
>
> > i've downloaded PEAR packages before and used them manually.
> >
> > all PEAR is is PHP object code modules in a central place. nothing
> > special, really.
> >
> > you just have to tweak some script paths and you can use
> > include/require on the files like normal.
>
> That's what I thought, but PEAR::SOAP seems to depend on the PEAR
> base package. ...which I could probably install manually as well, I
> know.
>
> But I just found out about NuSOAP (http://dietrich.ganx4.com/
> nusoap/), which seems to be what I'm looking for, a no-strings-
> attached SOAP implementation. I'm trying my luck with this one for
> now. :)
>
> Cheers,
> Dav
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--- End Message ---
--- Begin Message ---
On 9/25/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
> i try to stay away from it if i can.
i think the same of SOAP. in my opinion a shower is the only place for soap.
simple XML, REST, JSON, lighter weight things are what i prefer. even
XML-RPC i can live without.
my $0.02
--- End Message ---
--- Begin Message ---
On 26. Sep 2007, at 15:26, Nathan Nobbe wrote:
i just read the first message in this thread and NuSoap immediately
came to
mind. though it will solve your problem you may end up like me,
hating to use
NuSoap under duress. i think it was really popular back in th php4
days when there
was nothing solid that could be built right into php. anyway in my
experience
its a relic and i try to stay away from it if i can.
I already see what you mean.
A big bummer is that even though it uses the same class name as the
default PHP SOAP module, it uses a totally different syntax/method
calls etc, which all seem slightly queer to me. Which is terrible
since the library the gateway provides wants to call (and extend)
SoapClient() in very specific ways.
I don't think I wanna go down this road very far...
--- End Message ---
--- Begin Message ---
On 26. Sep 2007, at 16:14, mike wrote:
On 9/25/07, Nathan Nobbe <[EMAIL PROTECTED]> wrote:
i try to stay away from it if i can.
i think the same of SOAP. in my opinion a shower is the only place
for soap.
Well put. :-D
I, too, fail to see what's so terribly special about it.
--- End Message ---
--- Begin Message ---
as i said, its a relic. i started using it where i work because we are
still on php4 (dont ask)
and was dismayed. i looked around at some articles online and thats where i
got the impression
it was the defacto standard back in php4 when java already had a robust soap
api (and probly .net too).
im sure it was great in its hey-day.
the real problem using it anymore is, as you observed, you have to acquaint
yourself w/ a totally new (to use
SoapClient folks) API. and at this point (w/ SoapClient out there) i beg
the question, why bother.
i hate to suggest it, but you might want to take a little time and
investigate what other
restrictions you host has. if the list is long you may want to consider a
move.
it may seem arduous now, but the longer you wait the more arduous it will
become.
-nathan
On 9/26/07, David Christopher Zentgraf <[EMAIL PROTECTED]> wrote:
>
> On 26. Sep 2007, at 15:26, Nathan Nobbe wrote:
>
> > i just read the first message in this thread and NuSoap immediately
> > came to
> > mind. though it will solve your problem you may end up like me,
> > hating to use
> > NuSoap under duress. i think it was really popular back in th php4
> > days when there
> > was nothing solid that could be built right into php. anyway in my
> > experience
> > its a relic and i try to stay away from it if i can.
>
> I already see what you mean.
> A big bummer is that even though it uses the same class name as the
> default PHP SOAP module, it uses a totally different syntax/method
> calls etc, which all seem slightly queer to me. Which is terrible
> since the library the gateway provides wants to call (and extend)
> SoapClient() in very specific ways.
>
> I don't think I wanna go down this road very far...
>
--- End Message ---
--- Begin Message ---
On 26. Sep 2007, at 16:45, Nathan Nobbe wrote:
i hate to suggest it, but you might want to take a little time and
investigate what other restrictions you host has. if the list is
long you may want to consider a
move. it may seem arduous now, but the longer you wait the more
arduous it will
become.
Oh, we know our host sucks major [primate] [primate][bodypart].
The plan is to eventually have our own servers in-house, but until
then, there really isn't that much choice unfortunately. As far as we
observed all of the major hosts in Tokyo (Hi from Japan!) are pretty
much the same. And hosting abroad is out of the question, since
latency goes right up and throughput down with every inch off the
Japanese coast. Unless somebody has a good tip for a good host...
still on php4 (dont ask)
Ditto.
--- End Message ---
--- Begin Message ---
I have a SOAP request logger which logs all SOAP requests/responses being made
on the system. What I want to do is extract the function name being called and
the params passed to it. The following is an example XML Request:
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope
xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns1="urn:Gateway_Proxy"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
<env:Body>
<ns1:make_proxy_payment
env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<payment_id>61ecc268-1cd0-f468</payment_id>
<payment_amount>15495</payment_amount>
<callback_query_string>&payment_id=61ecc268-1cd0-f468</callback_query_string>
<transaction_note>Order from Student Library Fees with Payment Id:
61ecc268-1cd0-f468</transaction_note>
</ns1:make_proxy_payment>
</env:Body>
</env:Envelope>
What I want to do is extract the function name and the parameter names and its
values.
I have done the folloing so far:
$soap_request_string = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<env:Envelope xmlns:env="http://www.w3.org/2003/05/soap-envelope"
xmlns:ns1="urn:Gateway_Proxy" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://www.w3.org/2003/05/soap-encoding">
<env:Body>
<ns1:make_proxy_payment
env:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
<payment_id>61ecc268-1cd0-f468</payment_id>
<payment_amount>15495</payment_amount>
<callback_query_string>&payment_id=61ecc268-1cd0-f468</callback_query_string>
<transaction_note>Order from Student Library Fees with Payment Id:
61ecc268-1cd0-f468</transaction_note>
</ns1:make_proxy_payment>
</env:Body>
</env:Envelope>
XML;
$xml = new SimpleXMLElement($soap_request_string, NULL, false);
print_r($xml);
$ns = $xml->getNamespaces(true);
print_r($ns);
foreach ($xml->xpath('//env:Body') as $body)
{
//print_r($body);
foreach ($body->children($ns['env'], true) as $child)
{
print_r($child);
}
}
which does not return any SimpleXMLElements Objects. I can't figure out how to
extract the values which are tied to the Name Space.
A description of the problem is in detail here:
http://www.devnetwork.net/forums/viewtopic.php?t=74161
regards,
Jeffery
--
Internet Vision Technologies
Level 1, 520 Dorset Road
Croydon
Victoria - 3136
Australia
pgpgpymiuPQ6K.pgp
Description: PGP signature
--- End Message ---