WCF WSDL 生成有关如何以及每个部分的含义的详细信息

发布于 2024-11-30 22:13:54 字数 2693 浏览 1 评论 0原文

我对 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

歌入人心 2024-12-07 22:13:54
  1. 这部分取决于所涉及的程序集的数量。第一行代表您的服务程序集,第二行始终包含在内 - 一些 MS 预定义元素(但仍然有效的可互操作 XSD),第三行可能是您的数据契约的库。
  2. 默认模式是 ServiceContractName_OperationContractName_X,其中 X 是 InputMessage 或 OutputMessage,以区分请求和响应。部分定义消息的内容,元素引用 XSD 方案 - 该元素将在从第一个问题导入的第一个或第二个架构中定义。
  3. tns 可能代表目标名称空间 - 它是 WSDL 文档中定义的元素的前缀。它只是参考第二个问题中定义的消息。
  4. 默认情况下没有。您可能需要自定义编码器。

您的客户在导入 WSDL 时遇到哪些错误?所有这些部分都是有效的。

  1. This part depends on number of assemblies involved. The first line represents your service assembly, second line is always included - that some MS predefined elements (but still valid interoperable XSD) and the third line is probably library with your data contracts.
  2. The default pattern is ServiceContractName_OperationContractName_X where X is either InputMessage or OutputMessage to differ between request and response. Part defines content of the message and element is reference to XSD scheme - that element will be defined in first or second schema import from your first question.
  3. 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.
  4. With default stuff no. You would probably need custom encoder.

What errors do your clients have when importing the WSDL? All these parts are valid.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文