我在我的項目的一個Web服務的參考,但它有兩個網址一個是生活和第二個考驗是,如何動態地在vb.net這些URL之間切換如何更改Web服務URL動態
http://api.test/test/SOAP.wsdl
http://api.live/live/SOAP.wsdl
'LOGPOINT:
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.INFORMATION, ASSEMBLY_ID, "Start fnHOTELSPROSearchExecute()", "fnHOTELSPROSearchExecute")
Dim objsoap As New b2bHotelSOAPService()
Dim getres As New getAvailableHotelResponse()
QLSearchXML = xmlData
objsoap.Timeout = 20000
objsoap.Url = "http://api.live/live/SOAP.wsdl"
'objsoap.Timeout = TIMEOUT
getres = objsoap.getAvailableHotel(HOTELSPRO_APIKEY.Trim(), strDestinationId, dtmCheckIn, dtmCheckOut, strCurrencyCode, "UK", True, fngetpax(xmlData), getfilter())
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.INFORMATION, ASSEMBLY_ID, "Start DeSerializing the XML Output", "fnHOTELSPROSearchExecute")
lHOTELSPROReturn = fnCustomSerializeObject(GetType(getAvailableHotelResponse), getres)
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.INFORMATION, ASSEMBLY_ID, "End DeSerializing the XML Output", "fnHOTELSPROSearchExecute")
lTempDOM.LoadXml(lHOTELSPROReturn)
Return lTempDOM
Catch ex As Exception
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.ERROR, ASSEMBLY_ID, "Catch Block Error:" + ex.ToString(), "fnCreateHOTELSPROSearchRequest")
Finally
'LOGPOINT:
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.INFORMATION, ASSEMBLY_ID, "Response From HotelsPro--->" & lHOTELSPROReturn, "fnHOTELSPROSearchExecute")
Call mobjLogWrite.prWriteLogEntry(clsLogWriter.enuLogEntryType.INFORMATION, ASSEMBLY_ID, "END Finally Block fnHOTELSPROSearchExecute()", "fnHOTELSPROSearchExecute")
End Try
錯誤響應返回
「我已經在我的項目一個web服務的參考,但它有兩個網址一個是生活和第二個是TES t,如何在vb.net中動態地切換這些網址「
objsoap.Url = someurl是正確的,你確定這兩個web服務是相同的嗎?什麼是錯誤?你可以在這裏發佈嗎? – Stefan
@Duke我可以知道你在fngetpax(xmlData),getfilter()這些函數中發送了什麼。因爲我也有與hotelsPro.com工作,並沒有在c#中找到任何例子# – rahularyansharma