2015-10-05 159 views
0

我有一個WSDL defition一個非常基本的WCF服務如下:添加命名空間的WSDL定義

<wsdl:definitions 
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" 
xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
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:soap="http://schemas.xmlsoap.org/wsdl/soap/" 
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" 
xmlns:tns="urn:MyService" 
xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" 
xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" 
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:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" 
xmlns:wsa10="http://www.w3.org/2005/08/**addressing" 
xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" 
name="MyService" targetNamespace="urn:MyService"> 

我想補充的命名空間的xmlns:XSI =「http://www.w3.org/2001/XMLSchema實例「的定義,但我不知道在哪裏以及如何。

如何添加該命名空間?謝謝

回答

0

只需編輯和添加字符串的xmlns:XSI = 「http://www.w3.org/2001/XMLSchema-instance」

一個例子:

<definitions 

的xmlns:SOAP =「http://schemas.xmlsoap.org/wsdl/soap/」xmlns:soapenc =「http://schemas.xmlsoap.org/soap/encoding/」xmlns:xsi =「http://www.w3。 org/2001/XMLSchema-instance「xmlns:mime =」http://schemas.xmlsoap.org/wsdl/mime/「xmlns:tns =」http://example.com/「xmlns:xs =」http:/ /www.w3.org/2001/XMLSchema「xmlns:soap12 =」http://schemas.xmlsoap.org/wsdl/soap12/「xmlns:http =」http://schemas.xmlsoap.org/wsdl/http/ 「name =」WebServiceName「targetNamespace =」http:// e xample.com/「xmlns =」http://schemas.xmlsoap.org/wsdl/「>

+0

確定,但Visual Studio 2013/2015 WCF項目中沒有WSDL文件:( –

+0

也許嘗試使用svcutil util,還有一些類似的WSDL問題的其他答案推薦svcutil – kjm

+0

好友問題是帽子我根本看不到wsdl –