[AWS] ada2wsdl, wsdl2ada, and packages

Marc Criley mc at mckae.com
Wed Jul 11 14:48:54 CEST 2007


On Wed Jul 11  1:11 , Pascal Obry  sent:

>> I take it, then, that I'm supposed to run EA_Common.ads through ada2wsdl as well?
>>  Even though it's just type definitions?
>
>No. The type definition should be in the schema section of the generated
>WSDL for the main package.

Ok, good, that's what I thought should be happening.

>It would be nice to know which AWS version you are using :-) If possible
> you should try with the latest AWS release (GPL 2007) or with the
>Subversion sources.

I'm using GNAT GPL 2007 on Linux.

As this is a legacy, in-production system that I'm messing with, significant
changes to its code aren't really an option.  I'll probably end up writing some
wrappers that may be more ada2wsdl-friendly, but making do with the code as-is is
what I would like to stick with as much as possible.  At the very least
understanding what exactly is going on with the inter-package references would be
a big help.

Thanks again...

I've stripped down the sources and they follow this, along with the result of
running ada2wsdl:

-- ea_common.ads
-- Yes, they actually did redefine Integer and Natural.  Gah!
package EA_Common is

  type INTEGER is
    range -2 ** 31 .. 2 ** 31 - 1;
    
  subtype NATURAL is
    INTEGER range 0 .. INTEGER'LAST;

end EA_Common;

-- ea_assets.ads
with EA_Common;
package EA_Assets is

  type ASSET is record
     ID : Integer;  -- Dummy, stripped out the real contents
  end record;

  type ASSET_ARRAY is
    array ( EA_Common.NATURAL range <> ) of ASSET;

  type ASSET_ARRAY_ACCESS is
    access ASSET_ARRAY;

end EA_Assets;

-- ea_external_interface.ads
package EA_External_Interface is

   type LOGGING_MODE is (
     NONE,
     APPEND,
     OVERWRITE
   );
end EA_External_Interface;

-- ea_assets_io.ads
with EA_External_Interface;
use EA_External_Interface;
with EA_Assets;
with EADTB_Common;

package EA_Assets_IO is

function Get (
   For_The_Thinker : EADTB_Common.INTEGER;
   Log             : EA_External_Interface.LOGGING_MODE := NONE
) return EA_Assets.ASSET_ARRAY_ACCESS;

end EA_Assets_IO;


I then run:

$ ada2wsdl ea_assets_io.ads -f

which completes with no errors, and the output is:

<?xml version="1.0" encoding="UTF-8"?>
<definitions name="EA_Assets_IO"
   targetNamespace="http://soapaws/EA_Assets_IO_def/"
   xmlns:tns="http://soapaws/EA_Assets_IO_def/"
   xmlns="http://schemas.xmlsoap.org/wsdl/"
   xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
   xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
   xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
   xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
   xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:n2="http://soapaws/EA_External_Interface_pkg/"
   xmlns:n1="http://soapaws/EADTB_Common_pkg/"
   xmlns:n3="http://soapaws/EA_Assets_IO_pkg/">

   <!-- Generated by AWS/Ada2WSDL v1.1
        on Wednesday 11 July 2007 at 07:31:10 -->

   <types>
      <schema xmlns="http://www.w3.org/2000/10/XMLSchema">

         <simpleType name="LOGGING_MODE"
                 targetNamespace="http://soapaws/EA_External_Interface_pkg/">
            <restriction base="xsd:string">
               <enumeration value="NONE"/>
               <enumeration value="APPEND"/>
               <enumeration value="OVERWRITE"/>
            </restriction>
         </simpleType>
      </schema>
   </types>

   <message name="Get_Request">
      <part name="For_The_Thinker" type="n1:EADTB_Common.INTEGER"/>
      <part name="Log" type="n2:LOGGING_MODE"/>
   </message>

   <message name="Get_Response">
      <part name="Result" type="n3:ASSET_ARRAY_ACCESS"/>
   </message>

   <portType name="EA_Assets_IO_PortType">

      <operation name="Get">
         <input message="tns:Get_Request"/>
         <output message="tns:Get_Response"/>
      </operation>
   </portType>

   <binding name="EA_Assets_IO_Binding" type="tns:EA_Assets_IO_PortType">
      <soap:binding style="rpc"
         transport="http://schemas.xmlsoap.org/soap/http"/>

      <operation name="Get">
         <soap:operation soapAction="Get"/>
         <input>
            <soap:body
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               namespace="http://soapaws/EA_Assets_IO_def/"
               use="encoded"/>
         </input>
         <output>
            <soap:body
               encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
               namespace="http://soapaws/EA_Assets_IO_def/"
               use="encoded"/>
         </output>
      </operation>
   </binding>

   <service name="EA_Assets_IO_Service">
      <port name="EA_Assets_IO_Port" binding="tns:EA_Assets_IO_Binding">
         <soap:address location="http://.../"/>
      </port>
   </service>
</definitions>





More information about the AWS mailing list