iT邦幫忙

0

(已解決)WSDL因連線問題無法參考服務

  • 分享至 

  • twitterImage

已取得乙方服務的wsdl文件,但由於一些原因導致網路不通又必須一邊開發一邊測試,
是否能夠在自己的測試環境中
藉由這個WSDL
部屬一個對方的模擬服務??

這是在C#加入參考報的錯誤https://ithelp.ithome.com.tw/upload/images/20190805/20113932PJxCcENep9.jpg

WSDL文件內容
不確定是否能公開其內容
所以將部分code取代掉

<wsdl:definitions xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" 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:wsdl="http://schemas.xmlsoap.org/wsdl/" name="服務名稱" targetNamespace="http://tempuri.org/">
<wsdl:types>
<xsd:schema targetNamespace="http://tempuri.org/Imports">
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱?xsd=xsd0" namespace="http://tempuri.org/"/>
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc?xsd=xsd1" namespace="http://schemas.microsoft.com/2003/10/Serialization/"/>
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc?xsd=xsd2" namespace="Systemweb.Core.Entities"/>
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc?xsd=xsd3" namespace="http://schemas.datacontract.org/2004/07/Systemweb.Core.Entities"/>
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc?xsd=xsd4"/>
<xsd:import schemaLocation="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc?xsd=xsd5" namespace="Systemweb.TIPS.WCF.FundServices.Contract.Entity"/>
</xsd:schema>
</wsdl:types>
<wsdl:message name="服務名稱_GetUUID_InputMessage">
<wsdl:part name="parameters" element="tns:GetUUID"/>
</wsdl:message>
<wsdl:message name="服務名稱_GetUUID_OutputMessage">
<wsdl:part name="parameters" element="tns:GetUUIDResponse"/>
</wsdl:message>
<wsdl:message name="服務名稱_ForeignCurrencyTrade_InputMessage">
<wsdl:part name="parameters" element="tns:ForeignCurrencyTrade"/>
</wsdl:message>
<wsdl:message name="服務名稱_ForeignCurrencyTrade_OutputMessage">
<wsdl:part name="parameters" element="tns:ForeignCurrencyTradeResponse"/>
</wsdl:message>
<wsdl:message name="服務名稱_ForeignCurrencyTradeResult_InputMessage">
<wsdl:part name="parameters" element="tns:ForeignCurrencyTradeResult"/>
</wsdl:message>
<wsdl:message name="服務名稱_ForeignCurrencyTradeResult_OutputMessage">
<wsdl:part name="parameters" element="tns:ForeignCurrencyTradeResultResponse"/>
</wsdl:message>
<wsdl:portType name="服務名稱">
<wsdl:operation name="GetUUID">
<wsdl:input wsaw:Action="http://tempuri.org/服務名稱/GetUUID" message="tns:服務名稱_GetUUID_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/服務名稱/GetUUIDResponse" message="tns:服務名稱_GetUUID_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="ForeignCurrencyTrade">
<wsdl:input wsaw:Action="http://tempuri.org/服務名稱/ForeignCurrencyTrade" message="tns:IKGIBankService_ForeignCurrencyTrade_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/IKGIBankService/ForeignCurrencyTradeResponse" message="tns:服務名稱_ForeignCurrencyTrade_OutputMessage"/>
</wsdl:operation>
<wsdl:operation name="ForeignCurrencyTradeResult">
<wsdl:input wsaw:Action="http://tempuri.org/服務名稱/ForeignCurrencyTradeResult" message="tns:IKGIBankService_ForeignCurrencyTradeResult_InputMessage"/>
<wsdl:output wsaw:Action="http://tempuri.org/服務名稱/ForeignCurrencyTradeResultResponse" message="tns:IKGIBankService_ForeignCurrencyTradeResult_OutputMessage"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BasicHttpBinding_服務名稱" type="tns:IKGIBankService">
<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="GetUUID">
<soap:operation soapAction="http://tempuri.org/服務名稱/GetUUID" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ForeignCurrencyTrade">
<soap:operation soapAction="http://tempuri.org/服務名稱/ForeignCurrencyTrade" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="ForeignCurrencyTradeResult">
<soap:operation soapAction="http://tempuri.org/服務名稱/ForeignCurrencyTradeResult" style="document"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="服務名稱">
<wsdl:port name="BasicHttpBinding_服務名稱" binding="tns:BasicHttpBinding_服務名稱">
<soap:address location="http://localhost/ELNCo2_ConsultanAPI/服務名稱.svc"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Zed_Yang iT邦新手 3 級 ‧ 2019-08-05 11:52:48 檢舉
補充一下問題好了
目前收到對方的WSDL 未來要呼叫他們的webservice
但是無法加入參考會報以下錯誤:

可了解文件,但無法加以處理。
- WSDL 文件含有無法解析的連結。
- 下載 http://localhost/ELNCo2_ConsultanAPI/KGIBankService.svc?xsd=xsd0 時發生錯誤。
- 要求失敗,HTTP 狀態 404 : Not Found。

猜測是對方的webservice還沒有架設到IIS

目前需要一邊開發一邊測試
所以想請教是否能依據他給的WSDL
在我方的測試環境中先架設測試用webserice
Zed_Yang iT邦新手 3 級 ‧ 2019-09-10 16:07:26 檢舉
已解決
是對方提供的WSDL有問題
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友回答

立即登入回答