2012-12-19 18 views
2

我在Visual Studio 2007中使用VB.NET。我試圖將FexEd評級服務集成到我公司的一個使用FedEx WSDL的網站中。根據我的觀點(我第一次使用WSDL),我的與WSDL的連接/集成似乎正常工作,因爲它不會抱怨未定義的方法等。RateService未在VB.NET中使用FedEx WSDL定義

例外的情況是,當我嘗試創建的RateService一個新的實例,我得到

錯誤「類型‘價格服務’沒有定義」。

我使用的是FexEx提供的示例代碼中的完全相同的聲明Dim service As RateService = New RateService()並且具有相同的導入語句。

有人可以想一想爲什麼我只有這個課程有問題嗎?還是有誰使用了可以給我指針的Fedex服務?如果您需要更多信息,請隨時提問,因爲我最有可能遺漏了一些重要的信息。

在此先感謝。

這裏是RateService構造的開始要求通過urbanlemur

Imports System.ComponentModel 
Imports System.Diagnostics 
Imports System.Web.Services 
Imports System.Web.Services.Protocols 
Imports System.Xml.Serialization 

' 
' This source code was auto-generated by wsdl, Version=2.0.50727.1432. 
' 


''' <remarks/> 
<System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.1432")> _ 
<System.Diagnostics.DebuggerStepThroughAttribute> _ 
<System.ComponentModel.DesignerCategoryAttribute("code")> _ 
<System.Web.Services.WebServiceBindingAttribute(Name := "RateServiceSoapBinding", [Namespace] := "http://fedex.com/ws/rate/v13")> _ 
Public Partial Class RateService 
    Inherits System.Web.Services.Protocols.SoapHttpClientProtocol 

    Private getRatesOperationCompleted As System.Threading.SendOrPostCallback 

    ''' <remarks/> 
    Public Sub New() 
+0

如果您分享相關的代碼片段,以便人們可以看到究竟是什麼不工作,這可能會有所幫助。 – aLearner

回答

1

只是爲了驗證你創建的代理類? (聽起來像你這樣,但從來沒有傷害要求)

Create web service proxy in Visual Studio from a WSDL file

你已經在你的web配置定義的連接?

<applicationSettings> 
    <RateWebServiceClient.Properties.Settings> 
     <setting name="RateWebServiceClient_RateServiceWebReference_RateService" serializeAs="String"> 
     <value>##fedex webservice address ##</value> 
     </setting> 
    </RateWebServiceClient.Properties.Settings> 
    </applicationSettings> 
+0

我沒有代理類。我創建了它並將其放入我的項目中,但我仍然收到相同的錯誤。我之前曾嘗試在我的web配置中包含連接,但出現錯誤,提示「無法識別的配置節applicationSettings/RateWebService.Properties.Settings」 – jbryhan

+0

您是否有由wsdl.exe創建的RateService構造函數的代碼片段?您是否包含RateServiceClass代理的名稱空間? – urbanlemur

+0

我在上面的原始問題中包含了RateService構造函數片段。你的第二個問題的答案可能是'不',因爲我不知道該怎麼做。我對VB.NET開發很陌生。 – jbryhan