Delphi:不包括在WSDL文件中的WSDL对象 [英] Delphi: WSDL objects not included in WSDL file
问题描述
我想在C#中创建一个WCF服务,使用Delphi构建的客户端应用程序。在Delphi中下载WSDL时,Delphi生成的文件中不包含任何对象。
在C#中我必须做什么才能在导入时声明WSDL中的对象进入Delphi?
EDIT
我使用EntityFramework在C#数据库(它是一个现有的数据库所以请不要告诉我应该首先做代码)。下面是一个类文件的例子:
命名空间LeadVendorModel
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
public partial class T_LeadVendorEmailDetail:DbContext
{
public int LeadVendorEmailDetailID {get;组; }
public int LeadVendorEmailID {get;组; }
public string Field_label {get;组; }
public string Field_Data {get;组; }
public Nullable< System.DateTime> EnteredOn {get;组; }
public virtual T_LeadVendorEmailHeader T_LeadVendorEmailHeaders {get;组; }
}
}
我只是使用 C#项目发布项目。我不知道在哪里,我会定义类型/对象,德尔福抱怨。是否有一个XML设置,我需要添加到Web.config?
我很高兴给任何其他信息所需,只是不知道还有什么帮助(第一次使用EF并首次创建API)。
END EDIT
是生成的文件的一个片段(没有创建对象):
接口
使用InvokeRegistry,SOAPHTTPClient,Types,XSBuiltIns;
type
// ***************************** ***************************************** //
// The以下类型,在WSDL文档中引用的不是这个文件中的
//。它们是表示的其他类型的别名[@],或者被引用
//到文档中声明的绝对[!]。后一类别的类型
//通常映射到预定义/已知的XML或Borland类型;然而,他们也可以
//表示未能声明或导入模式类型的不正确的WSDL文档。
// ******************************************** **************************** //
//!:GetFranchiseDetails - http://tempuri.org/
//!:GetFranchiseDetailsResponse - http://tempuri.org/
//!:FranchiseExists - http://tempuri.org/
//!:FranchiseExistsResponse - http://tempuri.org/
//!:GetLeadDetails - http://tempuri.org/
//!:GetLeadDetailsResponse - http://tempuri.org/
//!:GetLookupList - http://tempuri.org/
//!:GetLookupListResponse - http://tempuri.org/
//!:SubmitLead - http://tempuri.org/
//!:SubmitLeadResponse - http://tempuri.org/
//!:SubmitLeadAction - http://tempuri.org/
//!:SubmitLeadActionResponse - http://tempuri.org/
//!:SubmitLeadOutcome - http://tempuri.org/
//!:SubmitLeadOutcomeResponse - http://tempuri.org/
// ************************** ********************************************** //
//命名空间:http://tempuri.org/
//绑定:wsHttpBinding
//服务:LeadService
//端口:wsHttpBinding
// *** **************************************************** ******************* //
ILeadService = interface(IInvokable)
['{C61A5600-2BA8-436A-41AA-F81C45A9A738}']
function GetFranchiseDetails(const parameters:GetFranchiseDetails):GetFranchiseDetailsResponse; stdcall;
function FranchiseExists(const parameters:FranchiseExists):FranchiseExistsResponse; stdcall;
function GetLeadDetails(const parameters:GetLeadDetails):GetLeadDetailsResponse; stdcall;
function GetLookupList(const parameters:GetLookupList):GetLookupListResponse; stdcall;
function SubmitLead(const parameters:SubmitLead):SubmitLeadResponse; stdcall;
function SubmitLeadAction(const parameters:SubmitLeadAction):SubmitLeadActionResponse; stdcall;
function SubmitLeadOutcome(const parameters:SubmitLeadOutcome):SubmitLeadOutcomeResponse; stdcall;
end;
function GetILeadService(UseWSDL:Boolean = System.False; Addr:string =''; HTTPRIO:THTTPRIO = nil):ILeadService;
这是另一个Delphi生成的文件的代码片段,包含对象定义:
interface
使用InvokeRegistry,SOAPHTTPClient,Types,XSBuiltIns;
type
// ***************************** ***************************************** //
// The以下类型,在WSDL文档中引用的不是这个文件中的
//。它们是表示的其他类型的别名[@],或者被引用
//到文档中声明的绝对[!]。后一类别的类型
//通常映射到预定义/已知的XML或Borland类型;然而,他们也可以
//表示未能声明或导入模式类型的不正确的WSDL文档。
// ******************************************** **************************** //
//!:dateTime - http://www.w3.org / 2001 / XMLSchema
//!:int - http://www.w3.org/2001/XMLSchema
//!:boolean - http://www.w3.org / 2001 / XMLSchema
//!:decimal - http://www.w3.org/2001/XMLSchema
//!:string - http://www.w3.org / 2001 / XMLSchema
CompanyID = class; {http:// ...}
Address = class; {http:// ...}
Property_ = class; {http:// ...}
AppointmentRequest = class; {http:// ...}
{http:// ...}
PersonServiceRoleID =(
BuyersAgent,
SellersAgent,
SellersLawyer,
BuyersLawyer,
Seller,
买家,
拥有者,
租户,
TransactionCoordinator,
RelocationCoordinator ,
ReferredBy,
ContractorAdministrator,
InsuranceAgent,
Contractor,
PropertyManagement,
Buyer1,
Seller1,
Owner1,
Tenant1
);
{http:// ...}
PersonSearchCriteriaActiveType =(DeletedOnly,Both,UndeletedOnly);
ArrayOfInt =整数数组; {http:// ...}
// *********************** *********************************************** //
//命名空间:http:// ...
// ****************************** ****************************************** //
CompanyID = class(TRemotable)
private
FServiceCompanyID:Integer;
已发布
属性ServiceCompanyID:整数读取FServiceCompanyID写FServiceCompanyID;
end
// ************************************ ************************************ //
//命名空间:http:// ...
// soapAction:http:// ...
// transport:http://schemas.xmlsoap.org/soap/http
// binding:CompanySoap
// service:Company
// port:CompanySoap
// URL:http:// ...
// ************* **************************************************** ********* //
CompanySoap = interface(IInvokable)
['{44A8B9BE-7E75-8534-279B-46BF5D1674D7}']
函数GetAvailableAppointments(const appointmentRequest: AppointmentRequest; const companyID:CompanyID):ArrayOfAppointmentSlot; stdcall;
function GetQuote(const quoteRequest:QuoteRequest; const companyID:CompanyID):ServiceFee; stdcall;
function GetPropertyTypes(const companyID:CompanyID):ArrayOfPropertyType; stdcall;
function GetFoundationTypes(const companyID:CompanyID):ArrayOfFoundationType; stdcall;
function GetServiceTypes(const companyID:CompanyID):ArrayOfServiceType; stdcall;
function GetServiceProfessionals(const companyID:CompanyID):ArrayOfInspectorDetails; stdcall;
function ScheduleAppointment(const appointmentmentslot:AppointmentSlot; const customer:Contact; const companyID:CompanyID; const Quote:QuoteRequest; const agent:ArrayOfServiceAgent):AppointmentInfo; stdcall;
function FindAppointment(const contactID:Integer; const companyID:CompanyID):ArrayOfAppointmentInfo; stdcall;
procedure CancelAppointment(const companyID:CompanyID; const appointmentID:Integer); stdcall;
function CustomerLookUp(const criteria:PersonSearchCriteria):ArrayOfContact; stdcall;
function AddContact(const customer:Contact; const companyID:CompanyID):Contact; stdcall;
function UpdateContact(const customer:Contact; const companyID:CompanyID):Contact; stdcall;
function ProcessCompanyID(const serviceCompanyID:CompanyID):CompanyID; stdcall;
end;
function GetCompanySoap(UseWSDL:Boolean = System.False; Addr:string =''; HTTPRIO:THTTPRIO = nil):CompanySoap;
文件顶部的大注释块说明关于未创建的类型,以及它们的列表。它解释了为什么它们没有被创建 - 因为领先的!
,它表明他们从来没有被声明。
注释表示这可能表示不正确的WSDL文档未能声明或导入模式。您的服务是声明模式还是从某处导入模式?所有跳过的类都使用tempuri.org,这不会是在您的服务中使用的有效命名空间。
I am trying to create a WCF service in C# for use by a client app built using Delphi. When downloading the WSDL in Delphi, no objects are included in the file generated by Delphi.
What do I have to do in C# to declare the objects in the WSDL when imported into Delphi?
EDIT
I am using EntityFramework in C# to generate the classes from the database (it was an existing database so please don't tell me I should do code first). Here is an example of one of the class files:
namespace LeadVendorModel
{
using System;
using System.Collections.Generic;
using System.Data.Entity;
public partial class T_LeadVendorEmailDetail : DbContext
{
public int LeadVendorEmailDetailID { get; set; }
public int LeadVendorEmailID { get; set; }
public string Field_label { get; set; }
public string Field_Data { get; set; }
public Nullable<System.DateTime> EnteredOn { get; set; }
public virtual T_LeadVendorEmailHeader T_LeadVendorEmailHeaders { get; set; }
}
}
I am simply using the 'Publish' action in the C# project to publish the project. I am not sure where else I would define the types/objects that Delphi is complaining about. Is there a XML setting that I need to add to Web.config?
I am happy to give any other info needed, just not sure what else would help (first time using EF and first time creating an API).
END EDIT
Here is a snippet of the generated file (no objects created):
unit LeadService;
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
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.
// ************************************************************************ //
// !:GetFranchiseDetails - "http://tempuri.org/"
// !:GetFranchiseDetailsResponse - "http://tempuri.org/"
// !:FranchiseExists - "http://tempuri.org/"
// !:FranchiseExistsResponse - "http://tempuri.org/"
// !:GetLeadDetails - "http://tempuri.org/"
// !:GetLeadDetailsResponse - "http://tempuri.org/"
// !:GetLookupList - "http://tempuri.org/"
// !:GetLookupListResponse - "http://tempuri.org/"
// !:SubmitLead - "http://tempuri.org/"
// !:SubmitLeadResponse - "http://tempuri.org/"
// !:SubmitLeadAction - "http://tempuri.org/"
// !:SubmitLeadActionResponse - "http://tempuri.org/"
// !:SubmitLeadOutcome - "http://tempuri.org/"
// !:SubmitLeadOutcomeResponse - "http://tempuri.org/"
// ************************************************************************ //
// Namespace : http://tempuri.org/
// binding : wsHttpBinding
// service : LeadService
// port : wsHttpBinding
// ************************************************************************ //
ILeadService = interface(IInvokable)
['{C61A5600-2BA8-436A-41AA-F81C45A9A738}']
function GetFranchiseDetails(const parameters: GetFranchiseDetails): GetFranchiseDetailsResponse; stdcall;
function FranchiseExists(const parameters: FranchiseExists): FranchiseExistsResponse; stdcall;
function GetLeadDetails(const parameters: GetLeadDetails): GetLeadDetailsResponse; stdcall;
function GetLookupList(const parameters: GetLookupList): GetLookupListResponse; stdcall;
function SubmitLead(const parameters: SubmitLead): SubmitLeadResponse; stdcall;
function SubmitLeadAction(const parameters: SubmitLeadAction): SubmitLeadActionResponse; stdcall;
function SubmitLeadOutcome(const parameters: SubmitLeadOutcome): SubmitLeadOutcomeResponse; stdcall;
end;
function GetILeadService(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): ILeadService;
Here is a snippet of another Delphi generated file which includes the object definitions:
interface
uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;
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.
// ************************************************************************ //
// !:dateTime - "http://www.w3.org/2001/XMLSchema"
// !:int - "http://www.w3.org/2001/XMLSchema"
// !:boolean - "http://www.w3.org/2001/XMLSchema"
// !:decimal - "http://www.w3.org/2001/XMLSchema"
// !:string - "http://www.w3.org/2001/XMLSchema"
CompanyID = class; { "http://..." }
Address = class; { "http://..." }
Property_ = class; { "http://..." }
AppointmentRequest = class; { "http://..." }
{ "http://..." }
PersonServiceRoleID = (
BuyersAgent,
SellersAgent,
SellersLawyer,
BuyersLawyer,
Seller,
Buyer,
Owner,
Tenant,
TransactionCoordinator,
RelocationCoordinator,
ReferredBy,
ContractorAdministrator,
InsuranceAgent,
Contractor,
PropertyManagement,
Buyer1,
Seller1,
Owner1,
Tenant1
);
{ "http://..." }
PersonSearchCriteriaActiveType = (DeletedOnly, Both, UndeletedOnly);
ArrayOfInt = array of Integer; { "http://..." }
// ************************************************************************ //
// Namespace : http://...
// ************************************************************************ //
CompanyID = class(TRemotable)
private
FServiceCompanyID: Integer;
published
property ServiceCompanyID: Integer read FServiceCompanyID write FServiceCompanyID;
end;
// ************************************************************************ //
// Namespace : http://...
// soapAction: http://...
// transport : http://schemas.xmlsoap.org/soap/http
// binding : CompanySoap
// service : Company
// port : CompanySoap
// URL : http://...
// ************************************************************************ //
CompanySoap= interface(IInvokable)
['{44A8B9BE-7E75-8534-279B-46BF5D1674D7}']
function GetAvailableAppointments(const appointmentRequest: AppointmentRequest; const companyID: CompanyID): ArrayOfAppointmentSlot; stdcall;
function GetQuote(const quoteRequest: QuoteRequest; const companyID: CompanyID): ServiceFee; stdcall;
function GetPropertyTypes(const companyID: CompanyID): ArrayOfPropertyType; stdcall;
function GetFoundationTypes(const companyID: CompanyID): ArrayOfFoundationType; stdcall;
function GetServiceTypes(const companyID: CompanyID): ArrayOfServiceType; stdcall;
function GetServiceProfessionals(const companyID: CompanyID): ArrayOfInspectorDetails; stdcall;
function ScheduleAppointment(const appointmentslot: AppointmentSlot; const customer: Contact; const companyID: CompanyID; const Quote: QuoteRequest; const agent: ArrayOfServiceAgent): AppointmentInfo; stdcall;
function FindAppointment(const contactID: Integer; const companyID: CompanyID): ArrayOfAppointmentInfo; stdcall;
procedure CancelAppointment(const companyID: CompanyID; const appointmentID: Integer); stdcall;
function CustomerLookUp(const criteria: PersonSearchCriteria): ArrayOfContact; stdcall;
function AddContact(const customer: Contact; const companyID: CompanyID): Contact; stdcall;
function UpdateContact(const customer: Contact; const companyID: CompanyID): Contact; stdcall;
function ProcessCompanyID(const serviceCompanyID: CompanyID): CompanyID; stdcall;
end;
function GetCompanySoap(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): CompanySoap;
The large comment block at the top of the file explains about types not being created, along with the list of them. It explains why they weren't created - because of the leading !
, it indicates they're never declared.
The comment says that this may indicate incorrect WSDL documents that failed to declare or import a schema. Does your service declare a schema or import one from somewhere? All of the skipped classes use tempuri.org, which would not be a valid namespace for use in your service.
这篇关于Delphi:不包括在WSDL文件中的WSDL对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!