/John
Take a look at my web site for an example of this kind of thing. The
Tutorial is called - WebServices and ComplexTypes. Your second question will
be answered there as well. I suggest reading the previous tutorials too.
You'll get a better understanding of what is going on.
--
Shiv Kumar
The Delphi Apostle
http://www.matlus.com:8080
http://www.delphisoap.com:8080
Good article. I downloaded your project and tried using the same techniques,
but am running in to some problems relating to the WSDL that Delphi 6
automagically generates. So I tried compiling your project and querying the
compiled ISAPI DLL for its WSDL, and got the same problem: the problem being
that Delphi does not generate the WSDL that you published in you article, or
that you get from following the WSDL-link in your article! In particular, it
doesn't generate the description of the complex type:
- <xs:complexType name="TFieldInfoArray">
- <xs:complexContent>
- <xs:restriction base="soapenc:Array">
<xs:sequence />
<xs:attribute ref="soapenc:arrayType" n1:arrayType="xs:TFieldInfo[]"
xmlns:n1="http://schemas.xmlsoap.org/wsdl/" />
</xs:restriction>
</xs:complexContent>
</xs:complexType>
- <xs:complexType name="TFieldInfo">
- <xs:sequence>
<xs:element name="FieldName" type="xs:string" />
<xs:element name="FieldType" type="xs:string" />
<xs:element name="FieldSize" type="xs:int" />
<xs:element name="IsKeyField" type="xs:boolean" />
</xs:sequence>
</xs:complexType>
</xs:schema>
...
- <message name="GetSchemaInfoResponse">
<part name="return" type="xs:TFieldInfoArray" />
</message>
Instead, it just generates:
- <message name="GetSchemaInfoResponse">
<part name="return" type="xs:TFieldInfoArray" />
</message>
Thus, importing the WSDL genrates an unresolved type definition
(TFieldInfoArray), and no definition whatsoever of TFieldInfo.
What is the problem? Are you using a patched version of the Delphi classes,
or is your ISAPI DLL not doing the standard stuff when returning its WSDL,
or am I completely confused?
/John
"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7d2a96_1@dnews...
Yes, I'm sorry, I should have mentioned that in the Tutorial. It has been a
while since I fixed that (the fix is unofficial mind you).
Take a look at the fix I've made to the WebServExp.pas unit.
function TWebServExp.FindSchema(const ObjectTypeInfo: PTypeinfo; const
TnsURI: string): Boolean;
var
Index: Integer;
begin
Result := False;
//Do not register Empty TnsURI or tkSet or any predefined type from
XMLSchema
{ TODO -oShiv Kumar -cBUG :
Complex Types are not generated if this code is NOT commented.
Don't know the implications of doing this, but so far have not had issues. }
{ if ((TnsURI = '') or (ObjectTypeInfo.Kind = tkSet) or (TnsURI =
SXMLSchemaURI_1999) or (TnsURI = SXMLSchemaURI_2000_10) or
(TnsURI = SXMLSchemaURI_2001)) then
begin
Result := True;
Exit;
end;
}
for Index := 0 to Length(SchemaArray) -1 do
begin
if SchemaArray[Index].TypeInfo = ObjectTypeInfo then
begin
Result := True;
Exit;
end;
end;
//Add new type
Index := Length(SchemaArray);
SetLength(SchemaArray, Index+1);
SchemaArray[Index].TypeName := ObjectTypeInfo.Name;
SchemaArray[Index].NameSpace := TnsURI;
SchemaArray[Index].TypeInfo := ObjectTypeInfo;
SchemaArray[Index].XSGenerated := False;
end;
/John
"Shiv Kumar" <sh...@erols.com> wrote in message news:3b7fe919_1@dnews...