简体   繁体   English

在WSDL中使用XSD文件

[英]Using XSD file in WSDL

We have WSDL and XSD files given to us, 我们已经提供了WSDL和XSD文件,

Now how can we use that given XSD in WSDL, without adding manually all XSD elements in WSDL. 现在,我们如何在WSDL中使用给定的XSD,而无需在WSDL中手动添加所有XSD元素。 do we have something by which we can directally import xsd file to WSDL? 我们有什么方法可以直接将xsd文件导入WSDL?

Suggestion are welcome. 欢迎提出建议。

XSD is the schema of your object you will be sending to you web service. XSD是将要发送到Web服务的对象的架构。 Use command line below to create a serialized object from you XSD file. 使用下面的命令行从您的XSD文件创建序列化的对象。 For example, lets assume your language is C#, and your web service is SendData() 例如,假设您的语言为C#,而您的Web服务为SendData()

xsd.exe -c -l:c# -n:XmlSerializationHowTo yourobject.xsd xsd.exe -c -l:c#-n:XmlSerializationHowTo yourobject.xsd

This will create a class file called yourobject.cs In you code, reference your web service, and call SendData(yourobject); 这将创建一个名为yourobject.cs的类文件。在您的代码中,引用您的Web服务,然后调用SendData(yourobject);。 Note, you can also create sample xml from your xsd and vise versa. 注意,您还可以从xsd创建样本xml,反之亦然。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM