I have D2007, and getting a stack overflow when trying to import a set
of wsdl's (with xsd files). These wsdl's can be imported both with .net
and java (axis2).
Any ideas?
Bora Aydemir
Is the service on your machine or another machine? If the service is
not under your control, there is nothing to be done -- the
implementation can't be debugged.
You can debug your client, and services that you run, however.
Dmitry Savy
"bora aydemir" <bora.a...@gmail.com> wrote in message
news:4850...@newsgroups.borland.com...
With D2007 we included the source code with the WSDL importer. I don't
expect you to have to debug the importer but you definitely could build it
and find out a little more. Do you get a stack trace [albeit, a huge one,
I'd expect] with the overflow? I suspect the failure is in a recursive
routine and knowing the top 4 or 5 items on the stack might help.
My first inclination is that we're not properly detecting cycles in the
imported schemas. How does the WSDL and the XSD files refer to each other?
If the WSDL and XSD don't contain sensitive data, I'm happy to investigate
if you can email them to me ( bbabet at codegear dot com).
Let me know how I can help!
Cheers,
Bruneau
I sent an email containing the wsdls.
Thanks for your support
Bora Aydemir
Jean-Marie Babet yazmış:
Thank you! I did receive the WSDLs/Schemas and found out that the problem is
in the XMLSchema support. Matter of fact, you can see the lockup/overflow if
you launch the XML DataBinding wizard and select 'DataTypes.xsd' from the
coreschemas directory.
I'm going to work with the person responsible for the XMLSchema support on
this. I'll relay my findings.
Cheers,
Bruneau
I'll relay my findings!
Cheers,
Bruneau
I have heard that people manage to import these wsdls by unifying these
xsd files into one big file. But I don't have an idea how to do that.
Bora
Jean-Marie Babet yazmış:
> I have heard that people manage to import these wsdls by unifying these
> xsd files into one big file. But I don't have an idea how to do that.
I suspected that would help. When I ran inside of the debugger and paused
the process once it locked up, I noticed that we were trying to resolve a
type (NullFlavor, I believe) and that we were loading imported/included
schemas to do so. Since datatypes-based.xsd and voc.xsd [the two schemas
used by datatypes.xsd] import correctly, it's not the content that's causing
the problem but more likely faulty logic that recursively loads 'referred
to' schemas.
It's something we'd like to correct but if I do find a temporary workaround
by combining the schemas, I'll relay that info.
Cheers,
Bruneau
Have you tried importing/invoking the WSDL with other tools? Some can
help you to ensure something is not malformed. You might try
StrikeIron's free Web Services Analyzer: http://www.strikeiron.com/tools/tools_analyzer_windows.aspx
Just a note to mentioned that I've received a fix from the person who works
on the XML API. The issue was related to cycles in the schema voc includes
datatypes which includes datatypes-base which includes voc).
I'll try the fix and relay my findings soon.
Cheers,
Bruneau
Best regards,
Bora
Jean-Marie Babet yazmış:
Well, I'm still having problems at the XML schema level but at least there's
no lockup. The fix I received is temporary (the engineer express the desire
to rework that logic) but it's basically a stack to keep track of cycles.
(I'm including the diff to XMLSchema.pas below). However, now I'm having
problem with resolving certain types. Before when we could not resolve the
type, we kept walking down the list of included/imported schemas. That's
fixed. So we now we simply throw an exception that a particular name/type
could not be resolved.
Interesting, the .NET's xsd.exe utility has a problem with the very same
type we have a problem with. Here's the error message I get when I run:
> xsd.exe /classes infrastructureRoot.xsd
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.42]
Copyright (C) Microsoft Corporation. All rights reserved.
Schema validation warning: Type 'urn:hl7-org:v3:NullFlavor' is not declared,
or is not a simple type. Line 39, position 8.
There are other messages that follow but I'd rather resolve one item at a
time.
As I pointed out before, when we were locking up, when I paused in the
debugger I noticed that we were trying to resolve 'NullFlavor'.
The issue though is that "NullFlavor" is indeed defined (in voc.xsd) and it
is a simpletype:
<xs:simpleType name="NullFlavor">
<xs:annotation>
<xs:documentation>vocSet: T10609
(C-0-T10609-cpt)</xs:documentation>
</xs:annotation>
<xs:union memberTypes="NoInformation">
<xs:simpleType>
<xs:restriction base="cs">
<xs:enumeration value="NP"/>
</xs:restriction>
</xs:simpleType>
</xs:union>
</xs:simpleType>
So maybe it's a namespace issue... or maybe something else. I"ll relay my
findings after spending a little more time on this tomorrow.
Cheers,
Bruneau
PS: Here's the diff to XMLSchema.pas for the lockup on cycles when
attempting to resolve a type. I'm happy to email anyone an updated copy of
XMLSchema.pas if there's interest.
Index: XMLSchema.pas
===================================================================
--- XMLSchema.pas (revision 10466)
+++ XMLSchema.pas (working copy)
@@ -1649,6 +1649,7 @@
var
TranslatorList: IInterfaceList;
XMLSchemaURI: DOMString = SXMLSchemaURI_2001;
+ LinkedSchemaList: TStringList;
implementation
@@ -3432,6 +3433,35 @@
function FindItemNS(SchemaItems: TXMLSchemaItems; const Name, ItemNS:
DOMString): IXMLSchemaItem;
+ // TODO: Temporary fix for 261033. Recursive included schema detection
should be improved.
+ function PushLinkedSchema(const SchemaLocation: string): Boolean;
+ begin
+ if LinkedSchemaList = nil then
+ begin
+ LinkedSchemaList := TStringList.Create;
+ LinkedSchemaList.CaseSensitive := False;
+ LinkedSchemaList.Sorted := True;
+ end;
+ if LinkedSchemaList.IndexOf(SchemaLocation) = -1 then
+ begin
+ LinkedSchemaList.Add(SchemaLocation);
+ Result := True;
+ end
+ else
+ Result := False; // Recursion detected!
+ end;
+
+ procedure PopLinkedSchema(const SchemaLocation: string);
+ var
+ Index: Integer;
+ begin
+ Index := LinkedSchemaList.IndexOf(SchemaLocation);
+ Assert(Index <> -1, 'Internal error with linked schema handling'); //
Do not localize
+ LinkedSchemaList.Delete(Index);
+ if LinkedSchemaList.Count = 0 then
+ FreeAndNil(LinkedSchemaList);
+ end;
+
function SearchLinkedSchemas(const SchemaDocRefs: IXMLSchemaDocRefs;
const ItemNS: DOMString): IXMLSchemaItem;
var
@@ -3442,12 +3472,15 @@
Result := nil;
for I := 0 to SchemaDocRefs.Count - 1 do
if Assigned(SchemaDocRefs[I].SchemaRef) and
-
SameNamespace(VarToWideStr(SchemaDocRefs[I].SchemaRef.TargetNamespace),
ItemNS) then
- begin
+
SameNamespace(VarToWideStr(SchemaDocRefs[I].SchemaRef.TargetNamespace),
ItemNS) and
+ PushLinkedSchema(SchemaDocRefs[I].SchemaLocation) then
+ try
SchemaObj := (SchemaDocRefs[I].SchemaRef as IXMLNodeAccess);
ImportCollection :=
SchemaObj.FindHostedNode(SchemaItems.FCollectionClassType) as
IXMLSchemaItems;
Result := ImportCollection.FindItem(Name);
if Assigned(Result) then Break;
+ finally
+ PopLinkedSchema(SchemaDocRefs[I].SchemaLocation);
end;
end;
Best regards
Bora Aydemir
Jean-Marie Babet yazmış:
>
> PS: I'm happy to email anyone an updated copy of
Cheers,
Bruneau
Cheers,
Bruneau
I have one problem due to structure of the wsdls (nothing to do with the
importer) .Net and java imports every wsdl in different namespaces or
packages. There are 25 wsdls, more to come :( The problem with delphi is
the unit and object names of imported wsdls are the same. Can't include
two different wsdls into same project. I will have to manually change
the names I guess.
Best regards
Bora Aydemir
Jean-Marie Babet yazmış:
> Thanks for the update. I'm trying it out. Seems to be working ok.
Thanks for the feedback.
> I have one problem due to structure of the wsdls (nothing to do with the
> importer) .Net and java imports every wsdl in different namespaces or
> packages. There are 25 wsdls, more to come :( The problem with delphi is
> the unit and object names of imported wsdls are the same. Can't include
> two different wsdls into same project. I will have to manually change
> the names I guess.
It's indeed a problem with a importer. There's a 'Feature Request' in the
backlog for this. You can see this problem if you import eBay and PayPal.
They share a schema. The types of that schema are duplicated in the binding
generated for each Service hence making it impossible to use both of them in
the same project without name conflicts.
Java's nice mapping of xml namespace to package solves this problem
elegantly. .NET's importer (wsdl.exe) has the /sharetypes option:
/sharetypes
Turns on type sharing feature. This feature creates one code file with
a single type definition for identical types shared between different
services (namespace, name and wire signature must be identical).
Reference the services with http:// URLs as command-line parameters
or create a discomap document for local files.
Not too long ago we went through the backlog of 'New Features' and this came
up; I suggested that a /sharetypes-like option would be easier for us to
implement. However, not much has happened on that front since as there's
plenty of other things to do also:(. I'll bring up this issue again.
Cheers,
Bruneau
i have the same problem. i have contacted with the developers of the
service. They said that delphi is trying to get xsd files infinitely and
send me a workaround for delphi as you mention. The solution they offer
merging xsd files.
i'm sending the file which their modified and unified to your emails. It
may give you another viewpoint.
As Bora said there is so much wsdl file and these services will be
frequently updated. So we will try to import these wsdl files again and
again... There is many delphi developers who use these services on
countrywide. We need an automatic solution.
Thank for your rapid and effective help.
ibrahim KAZANCI
Jean-Marie Babet yazmış:
> Hello,
>
> The issue I was running into was related to a namespace problem in the was
> we handle include'd schemas. I have enough of that resolved to generate a
> binding from the WSDL you had suggested. I don't have the time to validate
> its correctness tonight thought I'd post it here any in case you can confirm
> whether it looks correct.
>
> Cheers,
>
> Bruneau
>
>
> // ************************************************************************
> //
> // The types declared in this file were generated from data read from the
> // WSDL File described below:
> // WSDL : msvs_semalari\Muayene\MCCI_AR000001TR01.wsdl
> // >Import : msvs_semalari\Muayene\MCCI_AR000001TR01.wsdl>0
> // >Import :
......
The imported file has some extra structure elements i think. I'm using
$Rev: 12980 $ of WSDLImp.exe.
I was imported same wsdl file into delphi. It's seems working after
some manual changes. Then i complated message structure in delphi and
sended xml message to server. I get an error message in returning xml
answer:
unexpected subelement: integrityCheck
Error disappeared when i comment out "integrityCheck published property"
in imported .pas file. There is similiar error for 2 more property:
unexpected subelement: width
unexpected subelement: center
After canceling these 3 rows came a positive answer as incoming xml for
now (I cant fill text fields -StrucDoc_Text-, so i dont know if it works
with filled text fields).
Owners of service said that there is no integritycheck, width or center
element in the structure. Could it be a problem with the importer?
If you dont have original wsdl files i can send them again. I was
emailed it before.
Thanks for your interest.
PS: I commented out this 3 rows:
// property integrityCheck: bin2 Index
(IS_ATTR) read FintegrityCheck write FintegrityCheck;
// property width_: PQ read Fwidth_ write Fwidth_;
// property center: TS2 read Fcenter write Fcenter;
And parts that contain the canceled rows:
//*****************************************************************
// XML : ST, global, <complexType>
// Namespace : urn:hl7-org:v3
//******************************************************************
ST2 = class(ED)
private
Frepresentation: BinaryDataEncoding;
Frepresentation_Specified: boolean;
FmediaType: cs;
FmediaType_Specified: boolean;
Flanguage: cs;
Flanguage_Specified: boolean;
Fcompression: CompressionAlgorithm;
FintegrityCheck: bin2;
FintegrityCheckAlgorithm: IntegrityCheckAlgorithm;
Freference: TEL;
Freference_Specified: boolean;
Fthumbnail: ED;
Fthumbnail_Specified: boolean;
procedure Setrepresentation(Index: Integer; const ABinaryDataEncoding:
BinaryDataEncoding);
function representation_Specified(Index: Integer): boolean;
procedure SetmediaType(Index: Integer; const Acs: cs);
function mediaType_Specified(Index: Integer): boolean;
procedure Setlanguage(Index: Integer; const Acs: cs);
function language_Specified(Index: Integer): boolean;
procedure Setreference(Index: Integer; const ATEL: TEL);
function reference_Specified(Index: Integer): boolean;
procedure Setthumbnail(Index: Integer; const AED: ED);
function thumbnail_Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property representation: BinaryDataEncoding Index
(IS_ATTR or IS_OPTN) read Frepresentation write Setrepresentation stored
representation_Specified;
property mediaType: cs Index
(IS_ATTR or IS_OPTN) read FmediaType write SetmediaType stored
mediaType_Specified;
property language: cs Index
(IS_ATTR or IS_OPTN) read Flanguage write Setlanguage stored
language_Specified;
property compression: CompressionAlgorithm Index
(IS_ATTR) read Fcompression write Fcompression;
// property integrityCheck: bin2 Index
(IS_ATTR) read FintegrityCheck write FintegrityCheck;
property integrityCheckAlgorithm: IntegrityCheckAlgorithm Index
(IS_ATTR) read FintegrityCheckAlgorithm write FintegrityCheckAlgorithm;
property reference: TEL Index
(IS_OPTN) read Freference write Setreference stored reference_Specified;
property thumbnail: ED Index
(IS_OPTN) read Fthumbnail write Setthumbnail stored thumbnail_Specified;
end;
// *******************************************************************
// XML : IVL_TS, global, <complexType>
// Namespace : urn:hl7-org:v3
//********************************************************************
IVL_TS = class(SXCM_TS)
private
Flow_: IVXB_TS;
Fwidth: PQ;
Fwidth_Specified: boolean;
Fhigh_: IVXB_TS;
Fhigh__Specified: boolean;
Fhigh__: IVXB_TS;
Fhigh___Specified: boolean;
Fwidth_: PQ;
Fhigh___: IVXB_TS;
Fhigh____Specified: boolean;
Fcenter: TS2;
Fwidth__: PQ;
Fwidth___Specified: boolean;
procedure Setwidth(Index: Integer; const APQ: PQ);
function width_Specified(Index: Integer): boolean;
procedure Sethigh_(Index: Integer; const AIVXB_TS: IVXB_TS);
function high__Specified(Index: Integer): boolean;
procedure Sethigh__(Index: Integer; const AIVXB_TS: IVXB_TS);
function high___Specified(Index: Integer): boolean;
procedure Sethigh___(Index: Integer; const AIVXB_TS: IVXB_TS);
function high____Specified(Index: Integer): boolean;
procedure Setwidth__(Index: Integer; const APQ: PQ);
function width___Specified(Index: Integer): boolean;
public
destructor Destroy; override;
published
property low_: IVXB_TS read Flow_ write Flow_;
property width: PQ Index (IS_OPTN) read Fwidth write
Setwidth stored width_Specified;
property high_: IVXB_TS Index (IS_OPTN) read Fhigh_ write
Sethigh_ stored high__Specified;
property high__: IVXB_TS Index (IS_OPTN) read Fhigh__ write
Sethigh__ stored high___Specified;
// property width_: PQ read Fwidth_ write Fwidth_;
property high___: IVXB_TS Index (IS_OPTN) read Fhigh___ write
Sethigh___ stored high____Specified;
// property center: TS2 read Fcenter write Fcenter;
property width__: PQ Index (IS_OPTN) read Fwidth__ write
Setwidth__ stored width___Specified;
end;