Board index » delphi » Trouble with Delphi 7

Trouble with Delphi 7


2007-04-26 08:15:28 PM
delphi114
Hi,
I'm trying to import some wsdl files into Delphi 7. A number of them are
giving an error that some types are not declared. This problem is
anticipated in the comments:
//
************************************************************************ //
// The following types, referred to in the WSDL document are not
being represented
// in this file. They are either aliases[@] of other types
represented or were referred
// to but never[!] declared in the document. The types from the
latter category
// typically map to predefined/known XML or Borland types; however,
they could also
// indicate incorrect WSDL documents that failed to declare or import
a schema type.
//
************************************************************************ //
// !:string - "www.w3.org/2001/XMLSchema"
// !:date - "www.w3.org/2001/XMLSchema"
// !:dateTime - "www.w3.org/2001/XMLSchema"
// !:decimal - "www.w3.org/2001/XMLSchema"
// !:integer - "www.w3.org/2001/XMLSchema"
// !:ListOfAttendances - "www.w3.org/2001/XMLSchema"
// !:AttendanceCancellation - "www.w3.org/2001/XMLSchema"
// !:CancelledAttendance - "www.w3.org/2001/XMLSchema"
Then in the code ListOfAttendances, AttendanceCancellation and
CancelledAttendance are referred to.
Are there any known problems in the wsdl importer? Could this have been
fixed in the latest version of Delphi?
Regards,
--
Mark Patterson
www.piedsoftware.com
 
 

Re:Trouble with Delphi 7

Mark,
I would suggest trying the new importer/runtime at the following link. If
that does not solve the problem, I will be happy to investigate if you can
point me to the WSDL:
codecentral.codegear.com/Item/24535
Cheers,
Bruneau.
 

Re:Trouble with Delphi 7

Jean-Marie Babet writes:
Quote
Mark,

I would suggest trying the new importer/runtime at the following link. If
that does not solve the problem, I will be happy to investigate if you can
point me to the WSDL:

codecentral.codegear.com/Item/24535
Thanks. I downloaded that and tried again. It didn't fix the problem. I
also tried it in Delphi 2007, which is downloaded in trial format. That
version crashed with stack overflow when I try to import one of the wsdl's.
Is there any other way to try this?
--
Mark Patterson
www.piedsoftware.com
 

Re:Trouble with Delphi 7

Hello Mark,
Quote
Thanks. I downloaded that and tried again. It didn't fix the problem. I
also tried it in Delphi 2007, which is downloaded in trial format. That
version crashed with stack overflow when I try to import one of the
wsdl's.

Is there any other way to try this?
I have a slightly later importer than the one that shipped with Delphi 2007 but I
can't think of any stack-overflow fixes that went in. If you can point me to
the WSDLs, I will be happy to investigate.
Cheers,
Bruneau.
 

Re:Trouble with Delphi 7

Hello,
Quick note to mention that I just noticed you emailed me the WSDLs. I'll
investigate and relay my findings.
Cheers,
Bruneau.
 

Re:Trouble with Delphi 7

Hello Mark,
Indeed there was a bug in the way XMLSchema resolves 'ref="xxxx"' that
caused an endless loop/stack overflow. I have short-circuited the importer to
refrain from using IXMLElementDef.Name in cases where there's a 'ref="xxxx"'
attribute. I have forwarded you the .pas files generated by the importer after
the fix. If you'd like a copy of the updated importer, I would be happy to email
a .zipped copy. Also, if you have D2007, I can make available the source
changes in case you want to rebuild the importer.
Cheers,
Bruneau.
 

Re:Trouble with Delphi 7

Quote
Hi,

I'm trying to import some wsdl files into Delphi 7. A number of them are
giving an error that some types are not declared. This problem is
anticipated in the comments:

//
************************************************************************ //
// The following types, referred to in the WSDL document are not
being represented
// in this file. They are either aliases[@] of other types
represented or were referred
// to but never[!] declared in the document. The types from the
latter category
// typically map to predefined/known XML or Borland types; however,
they could also
// indicate incorrect WSDL documents that failed to declare or import
a schema type.
//
************************************************************************ //
// !:string - "www.w3.org/2001/XMLSchema"
// !:date - "www.w3.org/2001/XMLSchema"
// !:dateTime - "www.w3.org/2001/XMLSchema"
// !:decimal - "www.w3.org/2001/XMLSchema"
// !:integer - "www.w3.org/2001/XMLSchema"
// !:ListOfAttendances - "www.w3.org/2001/XMLSchema"
// !:AttendanceCancellation - "www.w3.org/2001/XMLSchema"
// !:CancelledAttendance - "www.w3.org/2001/XMLSchema"


Then in the code ListOfAttendances, AttendanceCancellation and
CancelledAttendance are referred to.

Are there any known problems in the wsdl importer? Could this have been
fixed in the latest version of Delphi?

Regards,

--
Mark Patterson
www.piedsoftware.com
Hi,
I have encountered the same error with Delphi 7.
// The following types, referred to in the WSDL document are not being represented
// in this file. They are either aliases[@] of other types represented or were referred
// to but never[!] declared in the document. The types from the latter category
// typically map to predefined/known XML or Borland types; however, they could also
// indicate incorrect WSDL documents that failed to declare or import a schema type.
I am trying to connect to the url
"eutils.ncbi.nlm.nih.gov/entrez/eutils/soap/eutils.wsdl"
I would be really happy if you could let me know the fix for this.
Thanks in advance
BizTalk Utilities - Frustration free BizTalk Adapters
www.topxml.com/biztalkutilities
 

Re:Trouble with Delphi 7

Hello,
Until Hotfix 10 of Delphi 2006 the WSDL importer did not support any
imported or included schema: IOW the importer only supported schemas
declared within the WSDL file. So anyone using an importer from an earlier
version will need to grab the updates posted at this URL:
cc.codegear.com/Item/24535
The new importer available at that URL will lists the external schemas
processed at the top of the generated .pas file as in:
// ************************************************************************
//
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL : eutils.wsdl
//>Import : eutils.wsdl:0
//>Import : egquery.xsd
//>Import : einfo.xsd
//>Import : esearch.xsd
//>Import : esummary.xsd
//>Import : elink.xsd
//>Import : efetch.xsd
//>Import : efetch_taxon.xsd
//>Import : efetch_nlmc.xsd
//>Import : efetch_pubmed.xsd
//>Import : efetch_pmc.xsd
//>Import : espell.xsd
// Version : 1.0
// (6/12/2007 12:17:11 PM - - $Rev: 7010 $)
// ************************************************************************
//
I just tried importing the WSDL you mentioned and there are errors in the
generated .pas file. I will try to make some time to investigate this later
today.
Cheers,
Bruneau
 

Re:Trouble with Delphi 7

Quote
Hi,

I'm trying to import some wsdl files into Delphi 7. A number of them are
giving an error that some types are not declared. This problem is
anticipated in the comments:

//
************************************************************************ //
// The following types, referred to in the WSDL document are not
being represented
// in this file. They are either aliases[@] of other types
represented or were referred
// to but never[!] declared in the document. The types from the
latter category
// typically map to predefined/known XML or Borland types; however,
they could also
// indicate incorrect WSDL documents that failed to declare or import
a schema type.
//
************************************************************************ //
// !:string - "www.w3.org/2001/XMLSchema"
// !:date - "www.w3.org/2001/XMLSchema"
// !:dateTime - "www.w3.org/2001/XMLSchema"
// !:decimal - "www.w3.org/2001/XMLSchema"
// !:integer - "www.w3.org/2001/XMLSchema"
// !:ListOfAttendances - "www.w3.org/2001/XMLSchema"
// !:AttendanceCancellation - "www.w3.org/2001/XMLSchema"
// !:CancelledAttendance - "www.w3.org/2001/XMLSchema"


Then in the code ListOfAttendances, AttendanceCancellation and
CancelledAttendance are referred to.

Are there any known problems in the wsdl importer? Could this have been
fixed in the latest version of Delphi?

Regards,

--
Mark Patterson
www.piedsoftware.com
It still doesn't work for me (Delphi 7) for the following wsdl :
ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl
It's a service that checks european VAT numbers.
After some edits for the duplicate parameter names, nothing special with this wdsl, I think.
Output parameters remain empty, except for the date parameter, which tends to "prove" that the wsdl is well accessed.
What am I doing wrong ?
Thanks for any help
BizTalk Utilities - Frustration free BizTalk Adapters
www.topxml.com/biztalkutilities
 

Re:Trouble with Delphi 7

Hello,
Quote
After some edits for the duplicate parameter names, nothing special with
this wdsl, I think.
Output parameters remain empty, except for the date parameter, which tends
to "prove" that the wsdl is well accessed.

What am I doing wrong ?

Thanks for any help
Do you mean that you're running into a runtime failure when accessing the
service or do you suspect the importer. I just imported the WSDL you
mentioned and I am including the binding generated by the importer. Please
let me know whether it is an importer or runtime problem that you're running
into. If it is the latter, I will need some information about how to access the
service, or if you can send me the request/response XML, I will be happy to
investigate.
Cheers,
Bruneau.
[checkVatPort.pas generated by importer: ]
// ************************************************************************
//
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL :
ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl
//>Import :
ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl:0
// Encoding : UTF-8
// Version : 1.0
// (6/13/2007 12:43:29 PM - - $Rev: 7010 $)
// ************************************************************************
//
unit checkVatPort;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
const
IS_UNQL = $0008;
type
//
************************************************************************ //
// The following types, referred to in the WSDL document are not being
represented
// in this file. They are either aliases[@] of other types represented or
were referred
// to but never[!] declared in the document. The types from the latter
category
// typically map to predefined/known XML or Borland types; however, they
could also
// indicate incorrect WSDL documents that failed to declare or import a
schema type.
//
************************************************************************ //
// !:checkVat -
"urn:ec.europa.eu:taxud:vies:services:checkVat:types"
// !:string - "www.w3.org/2001/XMLSchema"
// !:checkVatResponse -
"urn:ec.europa.eu:taxud:vies:services:checkVat:types"
// !:date - "www.w3.org/2001/XMLSchema"
// !:boolean - "www.w3.org/2001/XMLSchema"
checkVat = class; {
"urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Cplx] }
checkVatResponse = class; {
"urn:ec.europa.eu:taxud:vies:services:checkVat:types"[Cplx] }
//
************************************************************************ //
// XML : checkVat, <complexType>
// Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
//
************************************************************************ //
checkVat = class(TRemotable)
private
FcountryCode: WideString;
FvatNumber: WideString;
published
property countryCode: WideString Index (IS_UNQL) read FcountryCode
write FcountryCode;
property vatNumber: WideString Index (IS_UNQL) read FvatNumber write
FvatNumber;
end;
//
************************************************************************ //
// XML : checkVatResponse, <complexType>
// Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat:types
//
************************************************************************ //
checkVatResponse = class(TRemotable)
private
FcountryCode: WideString;
FvatNumber: WideString;
FrequestDate: TXSDate;
Fvalid: Boolean;
Fname_: WideString;
Faddress: WideString;
public
destructor Destroy; override;
published
property countryCode: WideString Index (IS_UNQL) read FcountryCode
write FcountryCode;
property vatNumber: WideString Index (IS_UNQL) read FvatNumber write
FvatNumber;
property requestDate: TXSDate Index (IS_UNQL) read FrequestDate
write FrequestDate;
property valid: Boolean Index (IS_UNQL) read Fvalid write
Fvalid;
property name_: WideString Index (IS_UNQL) read Fname_ write
Fname_;
property address: WideString Index (IS_UNQL) read Faddress write
Faddress;
end;
//
************************************************************************ //
// Namespace : urn:ec.europa.eu:taxud:vies:services:checkVat
// transport : schemas.xmlsoap.org/soap/http
// style : document
// binding : checkVatPortSoapBinding
// service : checkVatService
// port : checkVatPort
// URL : ec.europa.eu/taxation_customs/vies/api/checkVatPort
//
************************************************************************ //
checkVatPortType = interface(IInvokable)
['{FF7DB705-D388-D555-FDCA-58B0F7D33A5F}']
// Cannot unwrap:
// - The input part is not a complex type
// - The output part is not a complex type
function checkVat(const parameters: checkVat): checkVatResponse;
stdcall;
end;
function GetcheckVatPortType(UseWSDL: Boolean=System.False; Addr: string='';
HTTPRIO: THTTPRIO = nil): checkVatPortType;
implementation
uses SysUtils;
function GetcheckVatPortType(UseWSDL: Boolean; Addr: string; HTTPRIO:
THTTPRIO): checkVatPortType;
const
defWSDL =
'ec.europa.eu/taxation_customs/vies/api/checkVatPort?wsdl';
defURL = 'ec.europa.eu/taxation_customs/vies/api/checkVatPort';
defSvc = 'checkVatService';
defPrt = 'checkVatPort';
var
RIO: THTTPRIO;
begin
Result := nil;
if (Addr = '') then
begin
if UseWSDL then
Addr := defWSDL
else
Addr := defURL;
end;
if HTTPRIO = nil then
RIO := THTTPRIO.Create(nil)
else
RIO := HTTPRIO;
try
Result := (RIO as checkVatPortType);
if UseWSDL then
begin
RIO.WSDLLocation := Addr;
RIO.Service := defSvc;
RIO.Port := defPrt;
end else
RIO.URL := Addr;
finally
if (Result = nil) and (HTTPRIO = nil) then
RIO.Free;
end;
end;
destructor checkVatResponse.Destroy;
begin
FreeAndNil(FrequestDate);
inherited Destroy;
end;
initialization
InvRegistry.RegisterInterface(TypeInfo(checkVatPortType),
'urn:ec.europa.eu:taxud:vies:services:checkVat', 'UTF-8');
InvRegistry.RegisterDefaultSOAPAction(TypeInfo(checkVatPortType), '');
InvRegistry.RegisterInvokeOptions(TypeInfo(checkVatPortType), ioDocument);
InvRegistry.RegisterInvokeOptions(TypeInfo(checkVatPortType), ioLiteral);
InvRegistry.RegisterExternalParamName(TypeInfo(checkVatPortType),
'checkVat', 'parameters1', 'parameters');
RemClassRegistry.RegisterXSClass(checkVat,
'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVat');
RemClassRegistry.RegisterXSClass(checkVatResponse,
'urn:ec.europa.eu:taxud:vies:services:checkVat:types', 'checkVatResponse');
RemClassRegistry.RegisterExternalPropName(TypeInfo(checkVatResponse),
'name_', 'name');
end.