Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > document/literal style SOAP:Lite service

Reply
Thread Tools

document/literal style SOAP:Lite service

 
 
Fima Furman
Guest
Posts: n/a
 
      05-09-2007
Folks, this seems like a pretty basic question, but I couldn't find a
direct answer, only hints in documentation and other people's article.
Can Soap:Lite implement a service which would work with Document/
literal requests? In my testing I was only able to get it to work with
rpc/encoded style. I would very much appreciate if someone could shed
some light on this.

If Soap:lite is incompatible with document/literal, are there
alternatives out there which would allow to implement document/literal
SOAP service in Pearl? I've asked the same question in Soap:Lite yahoo
group and total silence was my answer.

Thanks!

 
Reply With Quote
 
 
 
 
Ian Wilson
Guest
Posts: n/a
 
      05-09-2007
Fima Furman wrote:
> Folks, this seems like a pretty basic question, but I couldn't find a
> direct answer, only hints in documentation and other people's article.
> Can Soap:Lite implement a service which would work with Document/
> literal requests? In my testing I was only able to get it to work with
> rpc/encoded style. I would very much appreciate if someone could shed
> some light on this.


SOAP::Lite really only supports RPC/Encoded. The SOAP::Lite
documentation mentions partial support for Doc/Literal but I believe
this never advanced beyond some rudimentary and partial support.

> If Soap:lite is incompatible with document/literal, are there
> alternatives out there which would allow to implement document/literal
> SOAP service in Pearl? I've asked the same question in Soap:Lite yahoo
> group and total silence was my answer.


AFAIK There are no alternative modules that do what you want.

I'd love to hear if I am wrong about either of the above!


The good news is that the following process works beautifully:

* Create a SOAP::Lite service in the usual way.

* If you receive or send complex data structures,
Use Perl objects
Return references to arrays instead of arrays
Do not use perl data structures like HoH
Do not use SOAP:ata to construct params or return values.

* Mark up your Perl objects following the instructions
in the POD::WSDL documentation

* Use POD::WSDL to create WSDL for the service

* Use that WSDL to create stubs in technologies that
normally only like Doc/Literal
e.g. C# .NET
I downloaded mono and used it's wsdl.exe to create a
C# stub from the WSDL created by POD::WSDL

* Use those stubs in the normal way.
I could write normal C# code, constructing C# objects and passing
them as params to Perl SOAP::Lite services via methods of a stub
service object. Perl objects emerge as C# objects and vice-versa.

* The receiving Perl service receives full Perl objects
and you can invoke instance methods using those
objects!

I have done this with moderately complex parameters such as an array of
objects where each object contains various fields and an array of
another type of object.

Note that the C# programmer does not have to even know about the
distinction between RPC/Encoded and Doc/Literal. Everything just works.

I haven't tried this with Perl's inside-out objects, just the original
traditional hash based objects. The C# classes created in the stub for
the parameter and return objects obviously lack methods and accessors,
you just refer to public variables (fields) using object.field notation

Perl service

my @things;
my $thing = new Thing(1,99.9,"aha");
$thing->addWhatsit("foo", 23.3); # inner array of Whatsit objects
$thing->addWhatist("bar", 23.3);
push @things $thing;
$thing = new Thing(2,34.2,"oho");
return \@things;

C# client

// stub gen from WSDL defines ThingService, Thing and Whatsit.
ThingService service = new ThingService();
Thing[] things = service.method(params);
for (int i = 0; i < things.Length; i++) {
Whatsit[] whatsits = things[i].whatsits;
for (int j = 0; j < whatsits.Length; j++) {
Console.WriteLine("This Things contains a Whatsit with name "
+ whatsits[j].name);
}
}

No hint of RPC/Encoded or Doc/Literal anywhere in the code you have to
write.
 
Reply With Quote
 
 
 
 
Fima Furman
Guest
Posts: n/a
 
      05-09-2007
Ian,

Thank you so much for such a detailed reply! It's amazing this
information isn't really out there. Can you recommend a Soap::Lite
version I should use? The latest non-experimental version is 0.60a,
however there are versions up to .69 available.

Thanks, again

Fima.

On May 9, 10:28 am, Ian Wilson <(E-Mail Removed)> wrote:
> SOAP::Lite really only supports RPC/Encoded. The SOAP::Lite
> documentation mentions partial support for Doc/Literal but I believe
> this never advanced beyond some rudimentary and partial support.




 
Reply With Quote
 
Ian Wilson
Guest
Posts: n/a
 
      05-09-2007
Fima Furman wrote:
>
> On May 9, 10:28 am, Ian Wilson <(E-Mail Removed)> wrote:
>
>> SOAP::Lite really only supports RPC/Encoded. The SOAP::Lite
>> documentation mentions partial support for Doc/Literal but I
>> believe this never advanced beyond some rudimentary and partial
>> support.

>
> Thank you so much for such a detailed reply! It's amazing this
> information isn't really out there.


Yes, I spent *many* days struggling with this issue and explored many
dead ends. Useful tools included SOAP::Lite's +trace option, Wireshark
and an XML prettyprinter/indenter.


> Can you recommend a Soap::Lite version I should use? The latest
> non-experimental version is 0.60a, however there are versions up to
> .69 available.


Here's what I am using ...

Unix Server:
$ perl -MSOAP::Lite -e 'print "$SOAP::Lite::VERSION\n"'
0.55

Development PC (WinXP):
C:\> perl -MSOAP::Lite -e "print qq($SOAP::Lite::VERSION\n)"
0.55

Looks like I'm using rather old versions

I recommend you use whatever comes as standard on your platform. If it
doesn't work, I'd upgrade to the latest stable version available.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM
DataGrid header style inconsistent with sortable column style cedoucette@alum.rpi.edu ASP .Net 0 10-14-2005 12:13 AM
All style tags after the first 30 style tags on an HTML page are not applied in Internet Explorer Rob Nicholson ASP .Net 3 05-28-2005 03:11 PM
Need help with Style conversion from Style object to Style key/value collection. Ken Varn ASP .Net Building Controls 0 04-26-2004 07:06 PM
Style sheets, include one style within another (not inheritance) foldface@yahoo.co.uk HTML 1 11-24-2003 01:37 PM



Advertisments