Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SOAP Runtime/Importer Updates

323 views
Skip to first unread message

Jean-Marie Babet

unread,
Mar 16, 2007, 8:43:49 PM3/16/07
to
Hello,

I just finished merging the D2007 changes in the D7/D2005 SOAP sources. This
came up in the CodeRage session this week as some users would like to talk
to MapPoint/eBay/Amazon/etc but are still working on a project that cannot
upgrade to D2007. If anyone is interested in trying the changes, please let
me know. I've emailed the runtime and importer updates to people who have
contacted me via email but if there are others would not mind trying out, I
would be happy to send out the updates and get some feedback. Thank you.

Cheers,

Bruneau.

PS: Note the update can work in either interface-breaking or
interface-compatible mode. With the latter, you won't get all
fixes/enhancements but any components/dcu that you have that relies on the
shipping interface will still work. In the former mode, you'll have to
rebuild any unit that uses soap units but you'll get all D2007 goodies -
such as support for unqualified/unbounded/optional elements. The former mode
will be interesting to those dealing with issues such as DEP, failure to map
renamed XML names, memory leaks on WSDL publish or dynamic arrays, etc.

Robert Loof

unread,
Mar 16, 2007, 10:09:26 PM3/16/07
to
Hi Bruneau,

Much appreciated if you could send the updates to me. Just inherited a
D7 based project.

Cheers,

Robert

Jean-Marie Babet

unread,
Mar 17, 2007, 2:15:03 AM3/17/07
to
Hello,

I've email you the updates. Please post (or email me) any feedback. Thank
you.

Cheers,

Bruneau.


SRV

unread,
Mar 17, 2007, 3:40:17 AM3/17/07
to
Hi Bruneau,

I'd like to try the updates.

Saludos
Francisco

Jeferson Oliveira

unread,
Mar 18, 2007, 11:26:06 AM3/18/07
to
Hello,

An AV happens when I attempt to import a WSDL of an IAppServerSOAP
interface, as already reported at QC #8275
(http://qc.codegear.com/qc/wc/qcmain.aspx?d=8275).
I have noticed that when the SoapDataModule has only one method the
error doesn't occur, but if it has none or more than one the AV happens.
I have done my tests using D7 and BDS2006 and both result in the same error.

When trying to import the XML file using the updated WSDLImporter
command line tool (WSDLImp.exe 16-mar-2007 4:58pm) I got the message
"*Error*: Privileged instruction" and the .pas file was not generated.
The WSDL I'm trying to import is available at:
http://jfo.no-ip.info/WebServices/WSDLTest.dll/wsdl/IDados

I would appreciate any suggestions on how to workaround this problem.


Regards,

Jeferson Oliveira
Brazil

Jean-Marie Babet

unread,
Mar 18, 2007, 3:22:56 PM3/18/07
to
Hello Jeferson,

Someone at CodeGear contacted me about a similar (same?) issue on Friday.
The issue is that this will happen for any WebService that exposes no
methods from the importer's point of view. The WSDL of a SoapModule that
exposes IAppServer has 7 methods in it. The importer has some logic that
basically says if the first 7 methods of a WebService matches those of
IAppServer, I'll skip them and simply make the interface derive from
IAppServerSOAP instead of IInvokable.

So in the case of IAppServer-based WebServices, you'll get something along
the lines of:

IDados = interface(IAppServerSOAP)
['{C5DE1E6B-D896-C265-5E75-AD96B12103FE}']
end;

That's all good except later there's logic that attempts to register the
SOAPAction header f each of the 7 methods found. That logic has a bug in it
in that it does not check if the methods found earlier were axed.

I have a quick fix that simply checks if the method count on the interface
is zero before proceeding. If you'd like I'd be happy to forward you a copy
of that importer. Sometime next week I'll add some tests to our unit test to
catch this case. While perusing that area I also noticed that the code would
fail also for services that want empty SOAPAction headers. I'll address this
and add unit-tests for these cases too.

Let me know if you'd like me to forward you a copy of the updated importer.

Cheers,

Bruneau.


Jeferson Oliveira

unread,
Mar 18, 2007, 4:28:31 PM3/18/07
to
Jean-Marie Babet escreveu:

> Someone at CodeGear contacted me about a similar (same?)

Yes. The same.


> The issue is that this will happen for any WebService that exposes no
> methods

It's true. And also is true that if I add one (and just one) method to
the SoapDataModule, the importer can create the .pas file without any
problems, but if I add a second method (as in this case
http://jfo.no-ip.info/WebServices/WSDLTest.dll/wsdl/IDados) the AV
happens again.


> Let me know if you'd like me to forward you a copy of the updated importer.

A newest than that one that I had already tested (WSDLImp.exe
16-mar-2007 4:58pm)? If so, I would appreciate so much. Send me please.

Thanks for your answer.


Regards,

Jeferson Oliveira
Brazil

Message has been deleted

Jean-Marie Babet

unread,
Mar 18, 2007, 5:59:31 PM3/18/07
to
Hello Jeferson,

> A newest than that one that I had already tested (WSDLImp.exe
> 16-mar-2007 4:58pm)? If so, I would appreciate so much. Send me please.

Yes, the version is '5534'. You can see that at the top of the generated
file - as in:

// ************************************************************************
//
// The types declared in this file were generated from data read from the
{ .... }
// (3/18/2007 2:54:00 PM - - $Rev: 5534 $) <<<=========== REV#
// ************************************************************************
//

unit IDados2;
{ .... }

IDados = interface(IAppServerSOAP)
['{C5DE1E6B-D896-C265-5E75-AD96B12103FE}']
procedure Test1; stdcall;
function Test2: WideString; stdcall;
end;
{ .... }


I'm emailing you a copy. Please let me know if this does not solve the
problem.

Cheers,

Bruneau.


Jeferson Oliveira

unread,
Mar 18, 2007, 6:12:51 PM3/18/07
to
Jean-Marie Babet escreveu:

> Yes, the version is '5534'. You can see that at the top of the generated
> file - as in:

Pretty good Bruneau!

Now I could import without any errors.
I hope this importer could be available as an update for Delphi 7,
BDS2006 and/or Delphi2007 linked to QC 8275.

Thank you so much for your help.


Regards,

Jeferson Oliveira
Brazil

J.L.Rocha

unread,
Mar 19, 2007, 4:39:32 AM3/19/07
to
Hi Bruneau,

I'd like to try the updates for D2006, too.

Thanks in advance,

--
Jose Luis Rocha

Örjan

unread,
Mar 19, 2007, 10:38:47 AM3/19/07
to
I would like to try the updates as we are having a problem with our
current version of Delphi in BDS 2006.

Regards,
Örjan Jämte

Jean-Marie Babet

unread,
Mar 19, 2007, 1:12:29 PM3/19/07
to
Hello Örjan,

I've sent you the updates. Please let me know if you run into any
difficulties using the files. Thank you.

Cheers,

Bruneau.

Change Log
The following is not an exhaustive list of the changes. It's a list of the
ones I could easily spot by running through recent check-in logs:

QC#7954 Memory leak in WSDL publishing logic for complex types
QC#9550 Handle '0' and '1' as valid boolean values
QC#9547 Support for time-zones with no transition dates
QC#15336 SOAP runtime modifies 'DecimalSeparator' global (Also #QC#5636,
#30095, #20405)
QC#38057 Dynamic array serialization mishandles ref-count (Also QC#21223)
QC#38709 Support for polymorphic types (illustrated using MapPoint.NET) -
(Also QC#32718)
QC#28012 Bug in TXSDuration.GetDecimalSecond
QC#28003 Incorrect namespace on element nodes (Also QC#31185)
QC#8397 OnBeforeExecute ignores changes to SOAPRequest variable
QC#31556 AV on deserializing empty string as dateTime.
QC#10969 Handle XML attributes that map to TXSxxxx types
QC#26063 Fix performance when handling multiref nodes and arrays
QC#26373 Remove unnecessary formatting of XML
QC#15331 Delphi-generated WSDLs are rejected by Java WSDL importers
QC#22485 Array Deserialization logic does not handle non-ntElement (such as
comment) nodes
QC#3980 Logic that serializes array properties AV when a setter is used
QC#33205 Importer mishandles cases where wrapper element does not match
operation name (NOTE: We won't unwrap anymore).

Importer issues:
(a) Various issues QC#31143, for Amazon'
(b) Incorrect code generated Amazon's Alex (QC#11920)
(c) Incorrect code generated for Inline enumerations (QC#9309),
(d) No Unbounded element support (QC#240056, 28062, 30712)
(e) AV on GoogleSearch
(f) Need to check Assigned(X) before invoking X.Free.
(g) Incorrect code for Complex type with simple content (Amazon's "Creator"
for example)
(h) Incorrect code gen. for eBay's WSDL
(i) Does not properly decide when to unwrap doc|lit services
(j) Does not support imported or included schemas

Misc:
Serialization of zeroed-out array of bytes fixed
Now sets utf-8 in HTTP content-type header to support international
characters (XML is already utf-8 encoded)
TXSxxxx types have sensible defaults. For example, TXSDateTime defaults to
"0001-01-01T00:00:00" instead of "1899-12-30T00:00:00.000".

Jean-Marie Babet

unread,
Mar 19, 2007, 1:23:38 PM3/19/07
to
Here's a list of the changes in the update that I spotted going through
recent check-in logs. If you're using D7 or D2005 you'll also get changes
made in later versions. If there's a particular issue that you'd like to
know about, please feel free to post here or email me and I'll relay the
status. Also note that we've started work on the next patch/update.

Couple of the items mentioned below were in HOTFIX10 of BDS2006. They were
reworked to use a helper-class in order to be interface-compatible with
shipping BDS2006. So you no longer have to have special conditional defines
to enable the fixes if you're BDS2006.

Cheers,

Bruneau.

Jean-Marie Babet

unread,
Mar 19, 2007, 1:15:00 PM3/19/07
to
Hello Jose,

I've sent you the files. Please let meknow if you run into any difficulties
using the files. Thanks for trying this out.

Cheers,

Bruneau.


Change Log
The following is not an exhaustive list of the changes. It's a list of the
ones I could easily spot by running through recent check-in logs:

Hans-Georg Rickers

unread,
Mar 22, 2007, 8:40:56 AM3/22/07
to
Hi Bruneau,

fantastic! Can you send me the Updates too. I will use them for our D7
Projects.

Thank you very much for your work
Huggy Rickers

Jean-Marie Babet

unread,
Mar 22, 2007, 2:35:52 PM3/22/07
to
Hello,

I've emailed you a copy of the update. Please do post (or email) about any
difficulties using the files.

Cheers,

Bruneau.


ser...@controlmax.com.br

unread,
Apr 5, 2007, 9:21:44 AM4/5/07
to
Hi Bruneau,

I have problems to import WSDL with unbounded parameters.

Can you send me the Updates too, I am using D6 and D7.

Thank you,

Sérgio Ricardo

Robert Wagner

unread,
Apr 5, 2007, 12:23:27 PM4/5/07
to
Dear Bruneau,

I would be very glad if you would send me the update, too.

I work with D2005 and I am having difficulties to import one special
WSDL file.

Tanks in advance!


Regards,

Robert Wagner

Jean-Marie Babet

unread,
Apr 5, 2007, 10:17:38 PM4/5/07
to
Hello Robert,

I've posted the update on CodeCentral (since Nick posted the MapPoint/Amazon
samples there). You can find the runtime/importer updates at the following
link:

http://cc.codegear.com/Item/24535

Please let me know if the importer does not solve the problem (*)

Cheers,

Bruneau.

(*) There are a few post-D2007 items that I've been working on related to

#1 Multiple compositor nodes
#2 More xsi:nillable="true" support.
#3 Support for mixed="true" complex types (ones that pass raw XML)

These are not included in the items I've uploaded but if any of these match
your WSDL, I'd love to make them available. Once QA gives me the thumbs up,
I'll upload these to CC as well.


Jean-Marie Babet

unread,
Apr 5, 2007, 10:13:47 PM4/5/07
to
Hello Sergio,

I've posted the updates on CodeCentral (since Nick posted the


MapPoint/Amazon samples there). You can find the runtime/importer updates at
the following link:

http://cc.codegear.com/Item/24535

Please let me know if somehow that does not work for you.

Cheers,

Bruneau.

<ser...@controlmax.com.br> wrote in message
news:1175779303.9...@d57g2000hsg.googlegroups.com...

Robert Wagner

unread,
Apr 10, 2007, 10:32:59 AM4/10/07
to
Dear Bruneau,

thank you very much for the new Importer. It imports the wsdl file but
the generated pas file does not compile :-(

The compiler (D2005) complains a missing '[' after the keyword 'Array'.


Part of the generated code:

type
Array_ = Array; {
"http://schemas.xmlsoap.org/soap/encoding/"[GblElm] }

AType = interface(IInvokable)
['{X}']
function getInfos: Array_; stdcall;
end;


initialization
RemClassRegistry.RegisterXSInfo(TypeInfo(Array_),
'http://schemas.xmlsoap.org/soap/encoding/', 'Array_', 'Array');


I believe the type 'Array_' was defined because of the following line in
the wsdl file (wrapped to improve readability):

<wsdl:types>
<schema targetNamespace="http://schemas.xmlsoap.org/soap/encoding/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="Array" nillable="true" type="soapenc:Array"/>
</schema>
</wsdl:types>


Any further hints how to import the file and make the generated file
compilable?

Thanks in advance,

Robert

Jean-Marie Babet schrieb:

Jean-Marie Babet

unread,
Apr 10, 2007, 11:46:34 PM4/10/07
to
Hello,

Thanks for the report. Any possibility you could send me a copy of the WSDL?
With doc|lit services, one does not see much of the older soap array
declarations and the one you posted does not look like what I would
xpect - i.e.

Something more like:

<xsd:complexType name="AName">
<xsd:complexContent>
<xsd:restriction base="SOAP-ENC:Array">
<xsd:sequence>


Cheers,

Bruneau.


Robert Wagner

unread,
Apr 11, 2007, 4:44:24 AM4/11/07
to
Dear Bruneau,

I've sent you a copy of the WSDL via private mail.

Thank you for looking into this issue.

Cheers,

Robert


Jean-Marie Babet schrieb:

Jean-Marie Babet

unread,
Apr 11, 2007, 5:26:32 PM4/11/07
to
Thank you.

I'll relay my findings as soon as I can find some time from the hectic
craziness going here currently [another deadline:(].

Cheers,

Bruneau.


Jean-Marie Babet

unread,
Apr 12, 2007, 10:31:10 PM4/12/07
to
Hello,

A quick message to mention that after seeing the schema declaration, I was a
little at a lost:

<wsdl:types>
<schema targetNamespace="http://schemas.xmlsoap.org/soap/encoding/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/"/>
<element name="Array" nillable="true" type="soapenc:Array"/>
</schema>
</wsdl:types>

I ran .NET's wsdl.exe on the WSDL and it did not llike it.

.NET's importer generates the following message:

- Unable to import operation 'getDocumentInfos'.
- The datatype 'http://schemas.xmlsoap.org/soap/encoding/:Array' is
missing.


But then I ran Axis (predecessor of Apache SOAP) on the WSDL and it's happy.
I also noticed that the WSDL contains the apachesoap namespace declared
(xmlns:apachesoap="http://xml.apache.org/xml-soap).

The Axis importer generates the following for the method that returns this
'Array' type:

public java.lang.Object[] getDocumentInfos() throws
java.rmi.RemoteException;

That's rather puzzling as I've never seen Axis expose raw Object[].

At this point I'd like to talk to the JBuilder folks to see if I can find
out more: JBuilder uses Axis for its soap support.

Also, it's very crazy/hectic here currently - another deadline approaching.
So I might not be online every day but as soon as I find out more I'll post
a message.

Cheers,

Bruneau.

PS: Unless I find a better match I'll probably update the importer to treat
type "soapenc:Array" as raw XML. I'd rather expose something less generic
but Object[] is also very generic. IOW, the method in question will end up
reading as follows in Delphi:

function getDocumentInfos: TXMLData; stdcall;

For more information on TXMLData, see the following link:


http://groups.google.com/group/borland.public.delphi.webservices.soap/msg/a35af927671d6823?


Sérgio Ricardo

unread,
Jun 4, 2007, 10:53:48 PM6/4/07
to
Hello Bruneau,

Thank you for your support, however the problem persists:

SOAP Request generated is like this:

<field_widestr>
<string>AAABBBCCC</string>
<string>CCCDDDEEE</string>
<string>FFFGGGHHH</string>
</field_widestr>

And it should be:
<field_widestr>AAABBBCCC</field_widestr>
<field_widestr>CCCDDDEEE</field_widestr>
<field_widestr>FFFGGGHHH</field_widestr>

In the import of WSDL that element is declared like this:

field_widestr: Array_Of_string

In WSDL it is like this:

- <element name="someFunction">
- <complexType>
- <sequence>
<element name="user" type="xsd:string" />
<element name="pass" type="xsd:string" />
<element name="id" type="xsd:long" />
<element name="field_widestr" type="xsd:string" maxOccurs="unbounded"
/>
</sequence>
</complexType>
</element>

Some suggestion?

Best regards,

Sergio Ricardo
Brazil

"Jean-Marie Babet" <bba...@borland.com> escreveu na mensagem
news:4615acdd$1...@newsgroups.borland.com...

Jean-Marie Babet

unread,
Jun 6, 2007, 2:15:27 PM6/6/07
to
Hello Sérgio,

Can you post what the importer generated for the type that contains the
'field_widestr' property? Basically, the runtime relies on a flag to tell it
whether an array should be treated as a pure collection or an unbounded
element. And starting with D2007 there are two ways to flag 'unbounded': A
property can be flagged as unbounded (without affecting other instances of
the type); or a type can be flagged as 'always' unbounded.

Given the following declaration

Array_Of_string = array of WideString; {
"http://www.w3.org/2001/XMLSchema"[GblUbnd] }


The property 'IsValid' in the object 'Request' below will be unbounded (see
the IS_UNBD flag on the Index).

Request = class(TRemotable)
published
property IsValid: Array_Of_string Index (IS_OPTN or IS_UNBD) read
FIsValid write SetIsValid stored IsValid_Specified;
end;


Other instances of 'Array_Of_string' will still be treated as a collection.


However, if the importer also generates the following, then all instances of
'Array_of_string' will be unbounded:

RemClassRegistry.RegisterXSInfo(TypeInfo(Array_Of_string),
'http://www.w3.org/2001/XMLSchema', 'Array_Of_string');

Can you confirm which one the importer generated for 'field_widestr'? If you
can point me to the WSDL, I'd be happy to investigate.

Cheers,

Bruneau.


Sérgio Ricardo

unread,
Jun 7, 2007, 11:05:44 AM6/7/07
to
Hello Bruneau,

I sent mail to your personal address.

Thanks,

Sérgio Ricardo

"Jean-Marie Babet" <bba...@borland.com> escreveu na mensagem

news:4666f9bd$1...@newsgroups.borland.com...

Jean-Marie Babet

unread,
Jun 7, 2007, 5:31:33 PM6/7/07
to
Hello,

> I sent mail to your personal address.

Yes, I just read it (I'm off today so I'm catching up with email/newsgroup
late). Thank you.

"Unbounded" support was only added to D2006 in Hotfix10. If you have D7,
D2005 then I recommend that you grab the importer and updated runtime posted
at the following URL:

http://codecentral.codegear.com/Item/24535

If you have D2006, you can use Hotfix10 but the runtime update mentioned
above is better as it also adds other support (such as optional elements,
inheritance, etc).

Cheers,

Bruneau.


Sérgio Ricardo

unread,
Jun 7, 2007, 7:16:04 PM6/7/07
to
Hello Bruneau,

I had already installed the update and I must have made something wrong, I
remade the installation and now it function properly.

Thank you very much.

Sérgio Ricardo

"Jean-Marie Babet" <bba...@borland.com> escreveu na mensagem

news:4668...@newsgroups.borland.com...

Jean-Marie Babet

unread,
Jun 7, 2007, 7:19:07 PM6/7/07
to
Thanks for the follow-up post. I'm glad the unbounded support is working.

Cheers,

Bruneau.


fran...@gmail.com

unread,
Jun 3, 2015, 11:56:24 PM6/3/15
to
Hi Bruneau,
I'd like to try the updates.

Saludos
Franco
0 new messages