(I'm CC'ing this to PLUG because ph-perl gets so little traffic; another 
example of why I think Oracle questions should go to PLUG instead of 
another low-traffic list)

Doing function calls with SOAP is nice with the auto-namespace generator, 
but for some reason I need to give the return values NAMES.

e.g. in a return (my function returns several values)

        return (
                SOAP::Data->name("valid" => "N"),
                SOAP::Data->name("trx_no" => 0),
                SOAP::Data->name("approval_code" => 0),
                SOAP::Data->name("invoice_num" => 0),
                SOAP::Data->name("ref_num" => 0),
                SOAP::Data->name("tr_date" => $tr_date),
                SOAP::Data->name("message" => $msg)
        );

in the function call (I'm not sure if this works because of naming, or 
solely because it's in the right order) (note: don't get too excited by 
the credit card number, it's an invalid number which happens to pass the 
check digit):

$s = SOAP::Lite
        -> uri ("foo")
        -> proxy ("https://foo.foo.foo";)
        -> validate_cc(
                SOAP::Data->name("cartno" => 9999999999),
                SOAP::Data->name("clientcode" => 9999999999),
                SOAP::Data->name("amount" => 9.95),
                SOAP::Data->name("description" => "test payment"),
                SOAP::Data->name("currency" => "P"),
                SOAP::Data->name("crcno" => "5276 4400 6542 1319"),
                SOAP::Data->name("expiry" => "1203")
        );


anyway, in the dispatch function, instead of fetching the variables by 
order; e.g. instead of this..

sub validate_cc {
       # function parameters
       my (undef, $cartno, $clientcode, $amount, $particulars, $currency,
               $crcno, $expiry) = @_;
..

I want something like this:

sub validate_cc {
        # function parameters
        my $cartno = SOAP::Data->name("cartno")->value();
        my $clientcode = SOAP::Data->name("clientcode");
        my $amount = SOAP::Data->name("amount");
        my $particulars = SOAP::Data->name("description");
        my $currency = SOAP::Data->name("currency");
        my $crcno = SOAP::Data->name("crcno");
        my $expiry = SOAP::Data->name("expiry");
..


but the above doesn't work (it returns hashes, crikey).

brainwaves? suggestions?


---
Orlando Andico <[EMAIL PROTECTED]>
Mosaic Communications, Inc.

_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

To subscribe to the Linux Newbies' List: send "subscribe" in the body to 
[EMAIL PROTECTED]

Reply via email to