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

Ted Byers

Usenet Archive
Joined
Jul 15, 2008
Messages
129
Reaction score
0
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?
 

J. Gleixner

Usenet Archive
Joined
Jun 23, 2003
Messages
1,020
Reaction score
0
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.
 

Ted Byers

Usenet Archive
Joined
Jul 15, 2008
Messages
129
Reaction score
0
On Tuesday, May 8, 2012 5:47:29 PM UTC-4, J. Gleixner wrote:

Hi J.Gleixner

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 ...
:-(

>
> 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'.

...

I looked at that section of the documentation and my first reactions was @#$#@!%^&&

There is lots of info there, but not the detail to make it really useful.

That documentation needs to be fleshed out a bit, perhaps with a short example or three of realistic WSDL files

> 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.

...

Can you flesh this out a bit where, instead of an argument being a simple type, like an integer or string, the argument is a 'class' containing a number of 'data members' which themselves are simple strings or numbers? And if you can accompany that with the corresponding WSDL, then I can reverse engineer what I need from your example and the WSDL file.

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

The service provider provides examples in PHP and C#. What they have against C++ or perl I can't imagine.

Helpful site for using SOAP & SOAP::Lite : http://www.soaplite.com/
That site is interesting, but much of the content is over 10 years old. The mail lists are not very acive, and worse, the list wouldn't let me join using my gmail account, as I wanted to ask for more info about using wsdl2perl and making up the difference with hand-codd classes, with SOAP::lite.

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.

Well, I have been programming Java for twices as long as I have been programming perl, but I shude to thing of the costs of deploying java on a host inthe cloud, configuring it,and getting it to play nicely with the other servers I have deployed already. You wouldn't believe the nightmare associated with getting the security sertificates to work proprly on a machine with multiple NICs, IP addresses, and domain names (or perhaps it seemed so as I am a programmer rather than a sysadmin).

FWIW, Java has come a long way, and has been quite a good language to use for certain kinds of applications (I would use it for certain web applications, but not much else). But for much of what I do, it remains much too slow.

Thanks for your help.

Ted
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,049
Messages
3,104,243
Members
248,133
Latest member
DujonT

Latest Threads

Top