wsdl2perl.pl doesn't completely parse the WSDL file for all its types

Discussion in 'Perl Misc' started by Ted Byers, May 8, 2012.

  1. Ted Byers

    Ted Byers Guest

    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?
     
    Ted Byers, May 8, 2012
    #1
    1. Advertising

  2. Ted Byers

    J. Gleixner Guest

    Re: wsdl2perl.pl doesn't completely parse the WSDL file for allits types

    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.
     
    J. Gleixner, May 8, 2012
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    7
    Views:
    284
  2. thunk
    Replies:
    1
    Views:
    315
    thunk
    Mar 30, 2010
  3. thunk
    Replies:
    0
    Views:
    489
    thunk
    Apr 1, 2010
  4. thunk
    Replies:
    14
    Views:
    628
    thunk
    Apr 3, 2010
  5. Me
    Replies:
    2
    Views:
    433
Loading...

Share This Page