[32419] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 3686 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed May 9 18:09:36 2012

Date: Wed, 9 May 2012 15:09:09 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Wed, 9 May 2012     Volume: 11 Number: 3686

Today's topics:
    Re: modifying dns zone TTL herbert.burnswell@gmail.com
    Re: modifying dns zone TTL <nospam@lisse.NA>
        TIEHANDLE and deep recursion <tw+usenet@dionic.net>
    Re: TIEHANDLE and deep recursion <rweikusat@mssgmbh.com>
    Re: TIEHANDLE and deep recursion <ben@morrow.me.uk>
    Re: TIEHANDLE and deep recursion <tw+usenet@dionic.net>
    Re: TIEHANDLE and deep recursion <tw+usenet@dionic.net>
    Re: TIEHANDLE and deep recursion <ben@morrow.me.uk>
    Re: TIEHANDLE and deep recursion <rweikusat@mssgmbh.com>
        wsdl2perl.pl doesn't completely parse  the WSDL file fo <r.ted.byers@gmail.com>
    Re: wsdl2perl.pl doesn't completely parse  the WSDL fil <glex_no-spam@qwest-spam-no.invalid>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Tue, 8 May 2012 17:03:25 -0700 (PDT)
From: herbert.burnswell@gmail.com
Subject: Re: modifying dns zone TTL
Message-Id: <29883799.1425.1336521805368.JavaMail.geo-discussion-forums@yngt8>

On Friday, May 4, 2012 4:21:12 PM UTC-7, herbert....@gmail.com wrote:
> Hi All,
> 
> I'm looking to write a perl script to edit TTL's in zone files.  Ideally, I'd like to write it as:
> 
> ./script -f <filename> <newTTL>
> 
> and 
> 
> ./script -d <directoryname> <newTTL>
> 
> to either edit just one file or all files in a directory.
> 
> I've installed and read the perldoc information on DNS::ZoneParse but still don't see how to set it up to edit the TTL.
> 
> Questions:
> 
> - Is DNS::ZoneParse indeed the best way to obtain the desired functionality or is there a better way to do this?
> 
> - Does anyone have a code snippet that they've used to edit TTL's?
> 
> Any guidance is greatly appreciated.
> 
> TIA,
> 
> Herb



On Friday, May 4, 2012 4:21:12 PM UTC-7, herbert....@gmail.com wrote:
> Hi All,
> 
> I'm looking to write a perl script to edit TTL's in zone files.  Ideally, I'd like to write it as:
> 
> ./script -f <filename> <newTTL>
> 
> and 
> 
> ./script -d <directoryname> <newTTL>
> 
> to either edit just one file or all files in a directory.
> 
> I've installed and read the perldoc information on DNS::ZoneParse but still don't see how to set it up to edit the TTL.
> 
> Questions:
> 
> - Is DNS::ZoneParse indeed the best way to obtain the desired functionality or is there a better way to do this?
> 
> - Does anyone have a code snippet that they've used to edit TTL's?
> 
> Any guidance is greatly appreciated.
> 
> TIA,
> 
> Herb

Hi,

Thanks for the replies...  I am investigating the suggestions and will have to figure out what works best for my needs.  I was hoping this might be a bit more straight forward than it appears to be.

Thanks again,

Herb 


------------------------------

Date: Wed, 09 May 2012 21:11:31 +0100
From: Dr Eberhard W Lisse <nospam@lisse.NA>
Subject: Re: modifying dns zone TTL
Message-Id: <4FAACF73.5040302@lisse.NA>

Herb,

what is it that you actually want to do?

Incrementing or what?

el


On 2012-05-09 01:03 , herbert.burnswell@gmail.com wrote:
[...]
> 
> Hi,
> 
> Thanks for the replies...  I am investigating the suggestions and will have to figure out what works best for my needs.  I was hoping this might be a bit more straight forward than it appears to be.
> 
> Thanks again,
> 
> Herb 


-- 
If you want to email me, replace nospam with el


------------------------------

Date: Wed, 09 May 2012 19:32:21 +0100
From: Tim Watts <tw+usenet@dionic.net>
Subject: TIEHANDLE and deep recursion
Message-Id: <mqpq79-jjk.ln1@squidward.local.dionic.net>

Hi,

I was wondering of some kind soul could tell me what I am doing wrong in the 
code below (one module, one test file, minimum case)

I can see why calling print $fh in "sub PRINT" is recursing - but I cannot 
find out how to stop it!! Even copying the filehandle (a suggestion via 
Google) seems to not work. I've played with "tied" and do not seem to be 
able to find the magic to obtain the underlying filehandle so that calling 
print() does not immediately redirect to sub PRINT() and thus recurse.



#### SafeFile.pm #####
package SafeFile;
use warnings;

sub TIEHANDLE
{
    my ($self, $fh, @options) = @_;
    my $data = {
        fh => $fh,
        @options,
    };
    return bless $data, $self;
}

sub FETCH {
    my ($self) = @_;
    return $self->{fh};
}


sub PRINT {
    my $self = shift;
    my $fh = *{$self->{fh}};
    print $fh @_;
}

sub CLOSE
{
    my ($self) = @_;
    close $self->{fh};
}

sub safewrite {
    my $path = shift;
    open my $fh, '>', ;
    tie *$fh, __PACKAGE__, *$fh,
    (
        path => $path,
    );
    return $fh;
}

1;
#### END SafeFile.pm #####

#### test #####
#!/usr/bin/perl
use warnings;

use SafeFile;

my $fh = SafeFile->safewrite('/tmp/wibble');
print $fh "Hello\n";
print $fh "World\n";
close $fh;
#### END test #####


% perl test
#### Result #####
Deep recursion on subroutine "SafeFile::PRINT" at SafeFile.pm line 23.
/bin/bash: line 1: 21037 Segmentation fault      perl test

shell returned 139

Press ENTER or type command to continue

#### END Result #####


The purpose of this is to redirect a request to open ...., ">somefile"; to 
open ..., ">somefile.tmp";

The filehandle $fh should be usuable normally with print etc.

On close($fh), somefile.tmp is closed, and rename()'d (an atomic operation 
on Linux) to "somefile" - thus the target file is never in a half written 
state at any point.

Any thoughts would be most welcome :)

Cheers,

Tim



-- 
Tim Watts


------------------------------

Date: Wed, 09 May 2012 20:04:44 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <87ipg5i3ar.fsf@sapphire.mobileactivedefense.com>

Tim Watts <tw+usenet@dionic.net> writes:
> I was wondering of some kind soul could tell me what I am doing wrong in the 
> code below (one module, one test file, minimum case)
>
> I can see why calling print $fh in "sub PRINT" is recursing - but I cannot 
> find out how to stop it!! Even copying the filehandle (a suggestion via 
> Google) seems to not work.

It works fine:

sub TIEHANDLE
{
    my ($self, $fh, @options) = @_;
    my $outfh;

    open($outfh, '>&', $fh);
    
    my $data = {
        fh => $outfh,
        @options,
    };
    return bless $data, $self;
}

you just really need to make a 'deep' copy of the file handle.
I think you also shouldn't store a reference to the tied thing in the
'tie object' itself. That will likely result in each of them referring
to the other. I didn't test this, though.



------------------------------

Date: Wed, 9 May 2012 20:17:40 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <kfsq79-97k2.ln1@anubis.morrow.me.uk>


Quoth Tim Watts <tw+usenet@dionic.net>:
> 
> I can see why calling print $fh in "sub PRINT" is recursing - but I cannot 
> find out how to stop it!! Even copying the filehandle (a suggestion via 
> Google) seems to not work.

> sub safewrite {
>     my $path = shift;
>     open my $fh, '>', ;
>     tie *$fh, __PACKAGE__, *$fh,
>     (
>         path => $path,
>     );

Don't do that. Use a new filehandle:

    use Symbol qw/gensym/;

    my $tied = gensym;
    tie *$tied, __PACKAGE__, *$fh, ...;
    return $tied;

Also, you don't need all those * derefs all over the place, and the code
would be safer without them. Stuffing a bare glob into a scalar variable
is a bit of a hack, and you're better off sticking to globrefs
throughout. I think the only place you need to deref is the first
argument of 'tie'.

Ben



------------------------------

Date: Wed, 09 May 2012 21:25:19 +0100
From: Tim Watts <tw+usenet@dionic.net>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <fe0r79-1hm.ln1@squidward.local.dionic.net>

Ben Morrow wrote:

> 
> Quoth Tim Watts <tw+usenet@dionic.net>:
>> 
>> I can see why calling print $fh in "sub PRINT" is recursing - but I
>> cannot find out how to stop it!! Even copying the filehandle (a
>> suggestion via Google) seems to not work.
> 
>> sub safewrite {
>>     my $path = shift;
>>     open my $fh, '>', ;
>>     tie *$fh, __PACKAGE__, *$fh,
>>     (
>>         path => $path,
>>     );
> 
> Don't do that. Use a new filehandle:
> 
>     use Symbol qw/gensym/;
> 
>     my $tied = gensym;
>     tie *$tied, __PACKAGE__, *$fh, ...;
>     return $tied;
> 
> Also, you don't need all those * derefs all over the place, and the code
> would be safer without them. Stuffing a bare glob into a scalar variable
> is a bit of a hack, and you're better off sticking to globrefs
> throughout. I think the only place you need to deref is the first
> argument of 'tie'.
> 
> Ben

Awesome! Thanks Ben. I did come across one google result with gensym - but 
for some reason it failed when I adapted it (the example was long and 
structurally different) - guess I cocked it up.

I have implemented your method and it does the job just right. And I can see 
the logic.

Initially, it seemed "wrong" to not tie to the actual filehandle, and I 
assumed there must be a way to request the filehandle without triggering the 
magic - but I guess not.

Many many thanks - I've been on this for a day and a half...

Cheers,

Tim
-- 
Tim Watts


------------------------------

Date: Wed, 09 May 2012 21:33:02 +0100
From: Tim Watts <tw+usenet@dionic.net>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <vs0r79-9lm.ln1@squidward.local.dionic.net>

Rainer Weikusat wrote:

> my $outfh;
> 
> open($outfh, '>&', $fh);

Hi Rainer,

I tried Ben's method and it worked.

I also tried yours and, again, big thanks - that worked too, for me...

Saved me much hair pulling :)

I spent some time trying to decouple the tie with "tied" but as you say, 
pulling the internal reference of the tie'd filehandle just brings the tie 
magic back into play.

Cheers,

Tim
-- 
Tim Watts


------------------------------

Date: Wed, 9 May 2012 22:09:19 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <v03r79-g7l2.ln1@anubis.morrow.me.uk>


Quoth Tim Watts <tw+usenet@dionic.net>:
> Ben Morrow wrote:
> > Quoth Tim Watts <tw+usenet@dionic.net>:
> >> 
> >> I can see why calling print $fh in "sub PRINT" is recursing - but I
> >> cannot find out how to stop it!! Even copying the filehandle (a
> >> suggestion via Google) seems to not work.
> > 
> >> sub safewrite {
> >>     my $path = shift;
> >>     open my $fh, '>', ;
> >>     tie *$fh, __PACKAGE__, *$fh,
> >>     (
> >>         path => $path,
> >>     );
> > 
> > Don't do that. Use a new filehandle:
> > 
> >     use Symbol qw/gensym/;
> > 
> >     my $tied = gensym;
> >     tie *$tied, __PACKAGE__, *$fh, ...;
> >     return $tied;
> 
> Awesome! Thanks Ben. I did come across one google result with gensym - but 
> for some reason it failed when I adapted it (the example was long and 
> structurally different) - guess I cocked it up.

All gensym does is give you a new filehandle. The only reason you need
it is because, unlike open, tie won't create one for you if you pass it
an empty scalar.

> Initially, it seemed "wrong" to not tie to the actual filehandle, and I 
> assumed there must be a way to request the filehandle without triggering the 
> magic - but I guess not.

Conceptually the tied filehandle points to a different 'file' from the
non-tied one: a tied filehandle doesn't need a real file behind it at
all, and as far as Perl is concerned the object it's tied to is 'the
file'. So you have one filehandle pointing to a real file, and another
pointing to an object, and the fact that object copies data into the
file is just a coincidence.

In principle you *could* use just one filehandle, by untying it and
then retying afterwards, but it would be pretty awkward. For one thing,
you'd need to set up your TIEHANDLE method so that if you passed it an
already-constructed object it used that rather than constructing a new
one. For another, as Rainer pointed out, you'd've just created a
reference loop, and you'd need to explicitly break it before the object
would be destroyed.

Ben



------------------------------

Date: Wed, 09 May 2012 22:59:32 +0100
From: Rainer Weikusat <rweikusat@mssgmbh.com>
Subject: Re: TIEHANDLE and deep recursion
Message-Id: <878vh1hv7f.fsf@sapphire.mobileactivedefense.com>

Tim Watts <tw+usenet@dionic.net> writes:

[...]

> The purpose of this is to redirect a request to open ...., ">somefile"; to 
> open ..., ">somefile.tmp";
>
> The filehandle $fh should be usuable normally with print etc.
>
> On close($fh), somefile.tmp is closed, and rename()'d (an atomic operation 
> on Linux) to "somefile" - thus the target file is never in a half written 
> state at any point.

An entirely different approach to accomplish this:

---------------
package SafeFile;

sub new
{
    my ($class, $name) = @_;
    my $fh;

    open($fh, '>', $name.'.tmp')
	or die("open: $name.tmp: $!");
        
    ${*$fh{SCALAR}} = $name;
    return bless($fh, $class);
}

sub DESTROY
{
    my $fh = $_[0];
    my $name;

    close($fh);

    $name = ${*$fh{SCALAR}};
    rename($name.'.tmp', $name);
}

package main;

{
    my $fh = SafeFile->new('/tmp/ziegenwurst');

    print $fh ("Ziege\n");
    print $fh ("Salz\n");
}
---------------

This doesn't work with explicit close calls, a user is expected to let
the filehandle go out-of-scope once he is done creating the contents.
It also relies on the feature that the SCALAR slot of a glob
autovivifies like any other 'real reference', something which is
documented as

	This might change in a future release.
        (perlref)
        


------------------------------

Date: Tue, 8 May 2012 13:12:36 -0700 (PDT)
From: Ted Byers <r.ted.byers@gmail.com>
Subject: wsdl2perl.pl doesn't completely parse  the WSDL file for all its types
Message-Id: <fe415bfc-213a-4e21-9165-9919a87e3b5b@s10g2000pbc.googlegroups.com>

I don't have an option here as the web service is created using a SOAP
server.  I would have preferred a normal form based submission
service, but the service provider insists on SOAP.

NB: This is Activestate perl 5.12, on Windows 7 (but when I finish my
tests it will be deployed on a web version of Windows server).

Here is what I ran to get the types I need in order to use their
service, and the output I received:

C:\Projects\SOAP>perl wsdl2perl.pl https://merchant.paytoo.info/api/merchant/?wsdl
found unrecognised attribute {http://schemas.xmlsoap.org/wsdl/}
arrayType (ignored) at C:/Perl64/site/lib/SOAP/WSDL/Base.pm line 130.
Creating complexType class MyTypes/PaytooTransactionType.pm
Creating complexType class MyTypes/PaytooRequestType.pm
Creating complexType class MyTypes/PaytooDocumentType.pm
Creating complexType class MyTypes/PaytooAccountType.pm
Creating complexType class MyTypes/MerchantApiResponse.pm
Creating complexType class MyTypes/PaytooRequestSearchCriterias.pm
Creating complexType class MyTypes/ArrayOfPaytooRequestType.pm
C:/Perl64/site/lib/SOAP/WSDL/Generator/Template/XSD\complexType.tt
undef error - no node  at C:/Perl64/site/lib/SOAP/WSDL/Generator/
Template/Plugin/XSD.pm line 55
 
SOAP::WSDL::Generator::Template::Plugin::XSD::create_xsd_name('SOAP::WSDL::Generator::Template::Plugin::XSD=SCALAR(0x4de64b0)',
'') called at C:\Perl64\site\lib\SOAP\WSDL\Generator\Template\XS
D\complexType\attributeSet.tt line 42
        eval {...} called at C:\Perl64\site\lib\SOAP\WSDL\Generator
\Template\XSD\complexType\attributeSet.tt line 42
        eval {...} called at C:\Perl64\site\lib\SOAP\WSDL\Generator
\Template\XSD\complexType\attributeSet.tt line 6
        eval {...} called at C:\Perl64\site\lib\SOAP\WSDL\Generator
\Template\XSD\complexType\attributeSet.tt line 7
 
Template::Document::__ANON__('Template::Context=HASH(0x4f9a838)')
called at C:/Perl64/site/lib/Template/Document.pm line 151
        eval {...} called at C:/Perl64/site/lib/Template/Document.pm
line 149
 
Template::Document::process('Template::Document=HASH(0x4f98d30)',
'Template::Context=HASH(0x4f9a838)') called at C:/Perl64/site/lib/
Template/Context.pm line 347
        eval {...} called at C:/Perl64/site/lib/Template/Context.pm
line 321
 
Template::Context::process('Template::Context=HASH(0x4f9a838)',
'complexType/attributeSet.tt', undef, 'localize me!') called at C:/
Perl64/site/lib/Template/Context.pm line 409
 
Template::Context::include('Template::Context=HASH(0x4f9a838)',
'complexType/attributeSet.tt') called at C:\Perl64\site\lib\SOAP\WSDL
\Generator\Template\XSD\complexType\contentModel.tt line 19

        eval {...} called at C:\Perl64\site\lib\SOAP\WSDL\Generator
\Template\XSD\complexType\contentModel.tt line 7
 
Template::Document::__ANON__('Template::Context=HASH(0x4f9a838)')
called at C:/Perl64/site/lib/Template/Document.pm line 151
        eval {...} called at C:/Perl64/site/lib/Template/Document.pm
line 149
 
Template::Document::process('Template::Document=HASH(0x4fa00b8)',
'Template::Context=HASH(0x4f9a838)') called at C:/Perl64/site/lib/
Template/Context.pm line 347
        eval {...} called at C:/Perl64/site/lib/Template/Context.pm
line 321
 
Template::Context::process('Template::Context=HASH(0x4f9a838)',
'complexType/contentModel.tt', undef, 'localize me!') called at C:/
Perl64/site/lib/Template/Context.pm line 409
 
Template::Context::include('Template::Context=HASH(0x4f9a838)',
'complexType/contentModel.tt') called at C:\Perl64\site\lib\SOAP\WSDL
\Generator\Template\XSD\complexType.tt line 18
        eval {...} called at C:\Perl64\site\lib\SOAP\WSDL\Generator
\Template\XSD\complexType.tt line 7
 
Template::Document::__ANON__('Template::Context=HASH(0x4f9a838)')
called at C:/Perl64/site/lib/Template/Document.pm line 151
        eval {...} called at C:/Perl64/site/lib/Template/Document.pm
line 149
 
Template::Document::process('Template::Document=HASH(0x4fb9140)',
'Template::Context=HASH(0x4f9a838)') called at C:/Perl64/site/lib/
Template/Context.pm line 347
        eval {...} called at C:/Perl64/site/lib/Template/Context.pm
line 321
 
Template::Context::process('Template::Context=HASH(0x4f9a838)',
'Template::Document=HASH(0x4fb9140)') called at C:/Perl64/site/lib/
Template/Service.pm line 94
        eval {...} called at C:/Perl64/site/lib/Template/Service.pm
line 91
 
Template::Service::process('Template::Service=HASH(0x4fb9cb8)',
'complexType.tt', 'HASH(0x4f985a8)') called at C:/Perl64/site/lib/
Template.pm line 66
        Template::process('Template=HASH(0x4f9d400)',
'complexType.tt', 'HASH(0x4f985a8)', 'MyTypes/
ArrayOfPaytooRequestType.pm') called at C:/Perl64/site/lib/SOAP/WSDL/
Generator/Template.pm line 66
 
SOAP::WSDL::Generator::Template::_process('SOAP::WSDL::Generator::Template::XSD=SCALAR(0x4471b48)',
'complexType.tt', 'HASH(0x4dbcac8)', 'MyTypes/
ArrayOfPaytooRequestType.pm') called at C:/Per
l64/site/lib/SOAP/WSDL/Generator/Template/XSD.pm line 232
 
SOAP::WSDL::Generator::Template::XSD::visit_XSD_ComplexType('SOAP::WSDL::Generator::Template::XSD=SCALAR(0x4471b48)',
'SOAP::WSDL::XSD::ComplexType=SCALAR(0x49d77a8)') called at C:/Perl64/
site
/lib/SOAP/WSDL/Base.pm line 62
 
SOAP::WSDL::Base::_accept('SOAP::WSDL::XSD::ComplexType=SCALAR(0x49d77a8)',
'SOAP::WSDL::Generator::Template::XSD=SCALAR(0x4471b48)') called at C:/
Perl64/site/lib/SOAP/WSDL/Generator/Template/
XSD.pm line 90
 
SOAP::WSDL::Generator::Template::XSD::generate_typelib('SOAP::WSDL::Generator::Template::XSD=SCALAR(0x4471b48)',
undef) called at :/Perl64/site/lib/SOAP/WSDL/Generator/Template/XSD.pm
line 76

 
SOAP::WSDL::Generator::Template::XSD::generate('SOAP::WSDL::Generator::Template::XSD=SCALAR(0x4471b48)')
called at wsdl2perl.pl line 148 at C:/Perl64/site/lib/SOAP/WSDL/
Base.pm line 62


Sorry about the messy format of the output.  I just copied and pasted
from the console I ran the command in.  I have no idea what most of
that output means, except it is clear that wsdl2perl.pl properly
processed the first half dozen classes defined in that wsdl file and
then died a nasty death.

I appear to be able to function using SOAP::Lite, at least with the
functin calls that take only simple strings.  But I do not know how to
proceed in order to pass data to those functions that take complex
data types.

I have never worked with SOAP or WSDL before, so forgive me if this
seems a bit simple.  I guess there's a couple questions to ask that
would get me functional.

1) can you point your browser to that wsdl file specified on the
command I show above and tell me if there is a simple way to get
wsdl2perl.pl to parse it completely and correctly?
2) failing that, on looking at the files it did create, it looks like
those classes are primarily hashes (sometimes with certain values
being hashes themselves).  Hence the question: If I can infer the
structure of the hash required, can I simply create a hash, with all
the keys expected for the type in question, and then just pass a
reference to that hash as the argument for it in the functions I
access through SOAP::Lite?


------------------------------

Date: Tue, 08 May 2012 16:47:29 -0500
From: "J. Gleixner" <glex_no-spam@qwest-spam-no.invalid>
Subject: Re: wsdl2perl.pl doesn't completely parse  the WSDL file for all its types
Message-Id: <4fa99471$0$73605$815e3792@news.qwest.net>

On 05/08/12 15:12, Ted Byers wrote:
> I don't have an option here as the web service is created using a SOAP
> server.  I would have preferred a normal form based submission
> service, but the service provider insists on SOAP.
>
> NB: This is Activestate perl 5.12, on Windows 7 (but when I finish my
> tests it will be deployed on a web version of Windows server).
>
> Here is what I ran to get the types I need in order to use their
> service, and the output I received:
>
> C:\Projects\SOAP>perl wsdl2perl.pl https://merchant.paytoo.info/api/merchant/?wsdl
> found unrecognised attribute {http://schemas.xmlsoap.org/wsdl/}
> arrayType (ignored) at C:/Perl64/site/lib/SOAP/WSDL/Base.pm line 130.


[...]
>
> Sorry about the messy format of the output.  I just copied and pasted
> from the console I ran the command in.  I have no idea what most of
> that output means, except it is clear that wsdl2perl.pl properly
> processed the first half dozen classes defined in that wsdl file and
> then died a nasty death.
>
> I appear to be able to function using SOAP::Lite, at least with the
> functin calls that take only simple strings.  But I do not know how to
> proceed in order to pass data to those functions that take complex
> data types.
>
> I have never worked with SOAP or WSDL before, so forgive me if this
> seems a bit simple.  I guess there's a couple questions to ask that
> would get me functional.

Working with WSDL's usually ends up to not be simple.. unfortunately.

>
> 1) can you point your browser to that wsdl file specified on the
> command I show above and tell me if there is a simple way to get
> wsdl2perl.pl to parse it completely and correctly?

Looks like the line causing the problem is:

<xsd:attribute ref="soap-enc:arrayType" 
wsdl:arrayType="tns:PaytooRequestType[]"/>

Specifically the type of 'wsdl:arrayType'.

Possibly the 'Adding missing information' in SOAP::WSDL::Manual might
help.

> 2) failing that, on looking at the files it did create, it looks like
> those classes are primarily hashes (sometimes with certain values
> being hashes themselves).  Hence the question: If I can infer the
> structure of the hash required, can I simply create a hash, with all
> the keys expected for the type in question, and then just pass a
> reference to that hash as the argument for it in the functions I
> access through SOAP::Lite?

It generates a lot of helpful classes which makes coding and using
the SOAP services much easier.  I've only used it on one project,
however I didn't run into any parsing problems.

Possibly you can avoid using it and do everything yourself.  Looks like
'void' is a method that can be called.. something like this might
work for that method

my $s = SOAP::Lite
     -> service( 'https://merchant.paytoo.info/api/merchant/?wsdl' );
my $elem = SOAP::Data->name( 'request_id' => 12345 )->type( 'xsd:int' );
my $som = $s->void( $elem);

If you're able to see example envelope information, it makes it
easier to build your request.

Helpful site for using SOAP & SOAP::Lite : http://www.soaplite.com/

FWIW: I avoid Java at all costs, however using Eclipse's Web Service
features, it correctly creates the methods, in Java, based on a
WSDL, after entering very minimal information (e.g. URL). Possibly
that might be much less work.



------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

Back issues are available via anonymous ftp from
ftp://cil-www.oce.orst.edu/pub/perl/old-digests. 

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 3686
***************************************


home help back first fref pref prev next nref lref last post