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 http://200.185.23.93:8003/BWS/FlightInformation.asmx 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="http://schemas.xmlsoap.org/soap/envelope/"
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http
+://www.w3.org/2001/XMLSchema">
<soap:Body>
<FlightInformation xmlns="http://bws.voegol.com.br">
<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. Thanks,
Solli Moreira Honorio
Sao Paulo - Brazil
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|