Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Help with SOAP::Lite client acessing a air company .NET webservices

by shonorio (Hermit)
on Feb 04, 2007 at 12:28 UTC ( #598175=perlquestion: print w/replies, xml ) Need Help??

shonorio has asked for the wisdom of the Perl Monks concerning the following question:

Dear mongers, I got in trouble trying to help a friend of mime with a brazilian air company .NET webservices, because this work is hardest than I could imagine.

Trying to understand the complex wdsl available at I wrote a C# code to access and debug the soap communication with TCPTrace basead on How to Call a .NET-based Web Service Using the SOAP::Lite Perl Library document that get the log bellow.

<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:soap="" +xmlns:xsi="" xmlns:xsd="http +://"> <soap:Body> <FlightInformation xmlns=""> <valor> <header> <CodAgency>BR99076095</CodAgency> </header> <body> <getFlightInfo xmlns="urn:os:flifo"> <input> <CarrierAccount>G3</CarrierAccount> <CarrierCode>G3</CarrierCode> <Origin>CGH</Origin> <Destination>SDU</Destination> <DepartureDate>2007-02-07T00:00:00Z</DepartureDate> </input> </getFlightInfo> </body> </valor> </FlightInformation> </soap:Body> </soap:Envelope>
I couldn't figure out a way to serialize a soap envelope as like above, and now I'm asking to help with this webservices communication.
/* * C# code that access the air company .NET werbservices */ using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using Fly.FlighInformation; namespace Fly { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { Fly.FlighInformation.req_envelope Request = new re +q_envelope (); Fly.FlighInformation.resp_envelope Response = new re +sp_envelope(); Fly.FlighInformation.wsFlightInformation s = new wsFlight +Information(); Fly.FlighInformation.clsFlightInformationRequestHeader hea +der = new clsFlightInformationRequestHeader(); Fly.FlighInformation.clsFlightInfoRequestInput bod +y = new clsFlightInfoRequestInput(); Fly.FlighInformation.clsFlightInformationRequest inf +orequest = new clsFlightInformationRequest (); Fly.FlighInformation.clsFlightInformationRequestBody req +uestbody = new clsFlightInformationRequestBody(); header.CodAgency = "BR99076095"; body.CarrierAccount = "G3"; body.CarrierCode = "G3"; body.DepartureDate = "2007-02-07T00:00:00Z"; body.Origin = "CGH"; body.Destination = "SDU"; inforequest.input = body; requestbody.getFlightInfo = inforequest; Request.header = header; Request.body = requestbody; Response = s.FlightInformation( Request ) +; if (Response.body.getFlightInfoResponse.output.ResultCode +== 0) { label1.Text = "Finish with sucess"; } else { label1.Text = "Failed"; } } } }
I'll appreciate any help with this soap.


Solli Moreira Honorio
Sao Paulo - Brazil

Replies are listed 'Best First'.
Re: Help with SOAP::Lite client acessing a air company .NET webservices
by Herkum (Parson) on Feb 04, 2007 at 13:33 UTC

    You can find good examples Here for how to use Soap::Lite.

    I think the big difference between your C# code and the Perl implementation is that C# is auto encapsulating the data into XML for you. Soap::Lite is middle ware used to send the data to somewhere else. You will probably have to write some code to encapsulate the data yourself.

    You should also consider taking a look at XML::Simple or XML::Twig on how to generate a XML document. Or you can use a template if the document is simple enough.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://598175]
Approved by marto
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2023-01-27 14:43 GMT
Find Nodes?
    Voting Booth?

    No recent polls found