WCF WSDL 生成有关如何以及每个部分的含义的详细信息
我对 WCF 世界还很陌生。
我一直在寻找并试图理解 WCF 生成的 WSDL 文件。我寻找的原因是我们的 Java 和 PHP 客户在导入 WSDL 时遇到问题。
任何人都可以帮助我解决以下查询:
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/EvalServiceLibrary" />
</xsd:schema>
查询 1
基于上面的什么条件生成导入 schemalocation 标签?是基于数据合约和成员的数量还是其他(是什么?)
- <wsdl:message name="IEvalService_SubmitEval_InputMessage">
<wsdl:part name="parameters" element="tns:SubmitEval" />
</wsdl:message>
- <wsdl:message name="IEvalService_SubmitEval_OutputMessage">
<wsdl:part name="parameters" element="tns:SubmitEvalResponse" />
</wsdl:message>
查询 2: 我没有任何消息名称 IEvalService_SubmitEval_InputMessage。以上是如何生成的呢?还有零件名称和元件是什么?
<wsdl:portType name="IEvalService">
- <wsdl:operation name="SubmitEval">
<wsdl:input wsaw:Action="http://tempuri.org/IEvalService/SubmitEval" message="tns:IEvalService_SubmitEval_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IEvalService/SubmitEvalResponse" message="tns:IEvalService_SubmitEval_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
查询 3:
请告诉我上面的 wsdl 片段中的“tns:IEvalService_SubmitEval_InputMessage”是什么?
最后:
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org
/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org
/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
有没有办法从 WCF 代码中删除上述不必要的命名空间?我只知道如何更改名称空间。
谢谢你们。
I'm quiet new to WCF world.
I've been looking and trying to understand the WSDL file being generated by WCF. the reason I'm looking is that our clients with Java and PHP are having issue importing the WSDL.
Could anyone please kindly help me with following queries:
- <xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd0" namespace="http://tempuri.org/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/" />
<xsd:import schemaLocation="http://localhost:13818/WCFService2/Service.svc?xsd=xsd2" namespace="http://schemas.datacontract.org/2004/07/EvalServiceLibrary" />
</xsd:schema>
Query 1
Based on what condition is above import schemalocation tags gets generated? Is it based on number of data contracts and members or somethingelse (what is it?)
- <wsdl:message name="IEvalService_SubmitEval_InputMessage">
<wsdl:part name="parameters" element="tns:SubmitEval" />
</wsdl:message>
- <wsdl:message name="IEvalService_SubmitEval_OutputMessage">
<wsdl:part name="parameters" element="tns:SubmitEvalResponse" />
</wsdl:message>
Query 2:
I don't have any message name IEvalService_SubmitEval_InputMessage. How is above being generated? Also what is part name and element?
<wsdl:portType name="IEvalService">
- <wsdl:operation name="SubmitEval">
<wsdl:input wsaw:Action="http://tempuri.org/IEvalService/SubmitEval" message="tns:IEvalService_SubmitEval_InputMessage" />
<wsdl:output wsaw:Action="http://tempuri.org/IEvalService/SubmitEvalResponse" message="tns:IEvalService_SubmitEval_OutputMessage" />
</wsdl:operation>
</wsdl:portType>
Query 3:
could yo uplease tell me what is "tns:IEvalService_SubmitEval_InputMessage" on above wsdl snippet?
Fianally:
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org
/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org
/2001/XMLSchema" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:tns="http://tempuri.org/" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata">
is thre any way to remove the above unnecessary namespace from WCF code? I only know how to change the namespace.
Thank you heaps.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
tns
可能代表目标名称空间 - 它是 WSDL 文档中定义的元素的前缀。它只是参考第二个问题中定义的消息。您的客户在导入 WSDL 时遇到哪些错误?所有这些部分都是有效的。
tns
probably stands for target namespace - it is a prefix of elements defined in your WSDL document. It is just reference to message defined in your second question.What errors do your clients have when importing the WSDL? All these parts are valid.