.NET Core 專案在引用原先 .Net Framework 所撰寫的 Web Service 時會引發錯誤訊息

.NET Core 專案在引用原先 .Net Framework 所撰寫的 Web Service 時會引發錯誤訊息

.core 專案在引用原先 .Net Framework 所撰寫的 Web Service 時會引發下列的錯誤訊息
無法匯入 wsdl:port\r\n詳細資料: \r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='Service']/wsdl:port[@name='ServiceHttpPost']
無法匯入 wsdl:binding\r\n詳細資料: 匯入 wsdl:binding 所相依的 wsdl:portType 時發生錯誤。\r\nwsdl:portType 的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ServiceHttpPost']\r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='ServiceHttpPost']
無法匯入 wsdl:portType\r\n詳細資料: 執行 WSDL 匯入延伸模組時擲回例外狀況: System.ServiceModel.Description.XmlSerializerMessageContractImporter\r\n錯誤: 參考的類型 'http://schemas.xmlsoap.org/soap/encoding/:Array' 只對編碼的 SOAP 有效。\r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ServiceHttpPost']
無法匯入 wsdl:port\r\n詳細資料: \r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:service[@name='Service']/wsdl:port[@name='ServiceHttpGet']
無法匯入 wsdl:binding\r\n詳細資料: 匯入 wsdl:binding 所相依的 wsdl:portType 時發生錯誤。\r\nwsdl:portType 的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ServiceHttpGet']\r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:binding[@name='ServiceHttpGet']
無法匯入 wsdl:portType\r\n詳細資料: 執行 WSDL 匯入延伸模組時擲回例外狀況: System.ServiceModel.Description.XmlSerializerMessageContractImporter\r\n錯誤: 參考的類型 'http://schemas.xmlsoap.org/soap/encoding/:Array' 只對編碼的 SOAP 有效。\r\n錯誤來源的 XPath: //wsdl:definitions[@targetNamespace='http://tempuri.org/']/wsdl:portType[@name='ServiceHttpGet']
匯出期間驗證某些所產生的 XML 結構描述時發生錯誤:\r\n將尚未定義的 complexType 'http://schemas.xmlsoap.org/soap/encoding/:Array' 用作複雜類型限制的基底。


解決方式:
只需將原 Web Service web.confing 內容中的區段註解掉就可以
	<!--
	<webServices>
		<protocols>
			<clear/>
			<add name="HttpSoap12"/>
			<add name="HttpSoap"/>			
			<add name="HttpPost"/>
			<add name="HttpGet" />
			<add name="HttpPostLocalhost" />
			<add name="Documentation" />
		</protocols>
	</webServices>
	-->