[AWS] Troble with wsdl2aws
Poul-Erik Andreasen
poulerik at pea.dk
Mon Jul 5 19:57:19 CEST 2004
David Marceau wrote:
> Poul-Erik Andreasen wrote:
>
>> On Fri, 02 Jul 2004 17:27:56 -0400
>> David Marceau <davidmarceau at sympatico.ca> wrote:
>>
>>
>>> Poul-Erik Andreasen wrote:
>>>
>>>> Pascal Obry wrote:
>>>>
>>>>
>>>>> Poul-Erik,
>>>>>
>>>>>
>>>>>> i hope you or someone else can give me some hint.
>>>>>
>>>>>
>>>>> I fear that nobody will be able to help here. You need to provide
>>>>> more
>>>>> information. It will be very great if you could send a small
>>>>> reproducer for
>>>>> this problem.
>>>>>
>>>>>
>>>>>
>>>>
>>>> Hey again
>>>>
>>>> I have now been digging into the problem.
>>>>
>>>> If i take the getLast rutine from the the privius
>>>> wsdl dukument the generated function with
>>>> output of the array image added lookking like this:
>>>>
>>>> pragma Warnings (Off);
>>>>
>>>> with Ada.Exceptions;
>>>>
>>>> with SOAP.Client;
>>>> with SOAP.Message.Payload;
>>>> with SOAP.Message.Response;
>>>> with SOAP.Parameters;
>>>> with SOAP.Utils;
>>>> with Text_IO; use Text_IO; --PEA adding
>>>> with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
>>>>
>>>> .......
>>>>
>>>> function getLast
>>>> (stock : in Integer;
>>>> v_type : in Integer;
>>>> amount : in Integer)
>>>> return getLast_Result
>>>> is
>>>> P_Set : SOAP.Parameters.List;
>>>> Payload : SOAP.Message.Payload.Object;
>>>> begin
>>>> -- Set parameters
>>>> P_Set := +SOAP.Types.I (stock, "stock")
>>>> & SOAP.Types.I (v_type, "type")
>>>> & SOAP.Types.I (amount, "amount");
>>>> Payload := SOAP.Message.Payload.Build
>>>> ("getLast", P_Set, "urn:datafeed.dukascopy.com");
>>>>
>>>> --PEA here a some nessesary adding to get contact to the server.
>>>> declare
>>>> Response : constant SOAP.Message.Response.Object'Class
>>>> := SOAP.Client.Call
>>>>
>>>> ("http://anonymous:anonymous@freeserv.dukascopy.com/axis/services/Datafeed",
>>>>
>>>>
>>>>
>>>> Payload,
>>>> " ",
>>>> "anonymous",
>>>> "anonymous");
>>>>
>>>>
>>>>
>>>> R_Param : constant SOAP.Parameters.List
>>>> := SOAP.Message.Parameters (Response);
>>>> begin
>>>>
>>>> put(Image(SOAP_Array'(SOAP.Parameters.Get (R_Param,
>>>> "getLastReturn")))); -- PEA addition
>>>>
>>>>
>>>> if SOAP.Message.Response.Is_Error (Response) then
>>>> Ada.Exceptions.Raise_Exception
>>>> (SOAP.SOAP_Error'Identity,
>>>> SOAP.Parameters.Get (R_Param, "faultstring"));
>>>> else
>>>> declare
>>>> Result : constant getLast_Result
>>>> := To_ArrayOfCandle_Type
>>>> (V ( SOAP_Record'(SOAP.Parameters.Get (R_Param,
>>>> "getLastReturn"))));
>>>> begin
>>>> return Result;
>>>> end;
>>>> end if;
>>>> end;
>>>> end getLast;
>>>>
>>>> it will then com ut with the following output before the
>>>> contraint error:
>>>> ( 1 =>
>>>
>>>
>>> (
>>>
>>> item => (artificial => ()),
>>> <artificial xsi:type="ns5:boolean"
>>> xmlns:ns5="http://www.w3.org/2001/XMLSchema">false</artificial>
>>>
>>>
>>> item => (closePrice => ()),
>>> <closePrice xsi:type="ns6:double"
>>> xmlns:ns6="http://www.w3.org/2001/XMLSchema">1.7717</closePrice>
>>>
>>> item => (flat => ()),
>>> <flat xsi:type="ns7:boolean"
>>> xmlns:ns7="http://www.w3.org/2001/XMLSchema">false</flat>
>>>
>>> item => (id => ()),
>>> <id xsi:type="ns8:int"
>>> xmlns:ns8="http://www.w3.org/2001/XMLSchema">533</id>
>>>
>>> item => (maxPrice => ()),
>>> <maxPrice xsi:type="ns9:double"
>>> xmlns:ns9="http://www.w3.org/2001/XMLSchema">1.7722</maxPrice>
>>>
>>> item => (minPrice => ()),
>>> <minPrice xsi:type="ns10:double"
>>> xmlns:ns10="http://www.w3.org/2001/XMLSchema">1.7715</minPrice>
>>>
>>> item => (openPrice => ()),
>>> <openPrice xsi:type="ns11:double"
>>> xmlns:ns11="http://www.w3.org/2001/XMLSchema">1.772</openPrice>
>>>
>>> item => (periodType => ()),
>>> <periodType xsi:type="ns12:int"
>>> xmlns:ns12="http://www.w3.org/2001/XMLSchema">0</periodType>
>>>
>>> item => (time => ()),
>>> <time xsi:type="ns13:long"
>>> xmlns:ns13="http://www.w3.org/2001/XMLSchema">1088697610</time>
>>>
>>> item => (timeIndex => ()),
>>> <timeIndex xsi:type="ns14:int"
>>> xmlns:ns14="http://www.w3.org/2001/XMLSchema">108869761</timeIndex>
>>>
>>> item => (volume => ())
>>> <volume xsi:type="ns15:long"
>>> xmlns:ns15="http://www.w3.org/2001/XMLSchema">0</volume>
>>>
>>> ))
>>> <multiRef id="id0" soapenc:root="0"
>>> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
>>> xsi:type="ns4:Candle"
>>> xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xmlns:ns4="urn:datafeed.dukascopy.com">
>>> </multiRef>
>>>
>>> *****
>>> Is SOAP_record = SOAP_Boolean ? NO
>>> Is SOAP_record = ns4:Candle? Maybe???
>>
>>
>>
>> This is not iteresting if it boolean or not
>> the same errot occurs at
>>
>>> Pardon me for budding in but where is your exception handler? What
>>> exactly does the exception handler report?
>>> I see that you are creating a conditional statement for something
>>> that you intentionally raise an exception but I don't see the actual
>>> location where you are confronted with a Constraint exception.
>>> May I suggest you place an exception handler that displays all the
>>> exception information at the level above(surrounding the statement
>>> that calls the get_last) and compile your code in debug stabs in
>>> it. That way you could step through it and find the exact line
>>> where it gets thrown in ddd or gdb.
>>
>>
>>
>> I am fully aware of where it is thrown.
>> The function to_array_of_candle abowe is a gereric funtion from
>> Soap.util witch is instantiated whit a fuction called
>> to_candle a function generated by wsdl2ada. this function is supposed to
>> convert from soap types to ada types
>> but are deleved the wrong object types from
>>
>> V ( SOAP_Record'(SOAP.Parameters.Get (R_Param, "getLastReturn")));
>
> This service "V()"...what is it's spec and .ads and .adb does it
> reside in? Is this stuff in AWS source or ada xml source? I am not
> familiar with the soap stuff but I could take a look at it and we
> could talk about it in order to clarify the situation if you want.
>
>>
>> an proberly alredy from the Call. So it raised a
>> constrint_error tag check error. It is supposed
>> to send a specific SOAP type as e.a. SOAP_Bolean or
>> SOAP_Double or SOAP_integer but it send a SOAP_Rocord. Ther is simply
>> nothing inside the response eksept for the names.
>>
>> I am at home by now so a cannot give you the soucekode.
>> but you can take the previus wsdl ad parse with
>> wsdl2aws to get it.
>>
>>
>>
>>> The other trick is be patient with yourself and the more pairs of
>>> eyes on your problem the better.
>>
Yes , it pay off and i have now found the "error": in SOAP.Message.XML
in the function Parse_Param
it stands derectly as a comment in line 765:
-- Not a known basic type, let's try to parse a
-- record object. This implemtation does not
-- support schema so there is no way to check
-- for the real type here.
her it send back a Record since it not cableble to reconice what it is.
Anyway i am now able able to get the data inside a then i can make my own
parser. I am not really up to making schema-support for SOAP :-)
Best regards
Poul-Erik Andreasen
More information about the AWS
mailing list