2013-05-20 36 views
0

我想從我的Great Plains本地實例中提取供應商列表。MS Dynamics Great Plains身份驗證 - 無法建立連接

當我訪問

http://localhost:48620/DynamicsGPWebServices/DynamicsGPService.asmx 

我被要求登錄。我輸入我的Windows憑據,然後我看到端點未找到。

我知道網絡服務存在。

我知道我的Windows憑據是正確的,因爲他們是管理員帳戶。我的公司安裝了示例公司。

這裏是我的代碼:

DynamicsGP g = new DynamicsGP(); 
     g.Credentials = new NetworkCredential("username", "password", "domain"); 

     // Create an instance of the web service want to do this 
     //asynchronously. 

     // Be sure the default credentials are used 
     //g.UseDefaultCredentials = true; 

     // Create a context with which to call the web service 
     Context context = new Context(); 

     // Specify which company to use (sample company) 
     var companyKey = new CompanyKey(); 
     companyKey.Id = (-1); 

     // Set up the context object 
     context.OrganizationKey = (OrganizationKey)companyKey; 
     context.CultureName = "en-US"; 

     //error occurs after this line 
     VendorSummary[] vs = g.GetVendorList(new VendorCriteria(), context); 

我收到此錯誤:

{System.Net.WebException: Unable to connect to the remote server ---> > System.Net.Sockets.SocketException: No connection could be made because the target machine actively > refused it 127.0.0.1:48260 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, > Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 > timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) at System.Net.HttpWebRequest.GetRequestStream() at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters) at PMInvoices.DynamicsGPService.DynamicsGP.GetVendorList(VendorCriteria criteria, Context Context) in >c:\Users\joe_a84\Downloads\DeveloperToolkitSampleApps\PMInvoices\PMInvoices\PMInvoices\Web References\DynamicsGPService\Reference.cs:line 4069

回答

0

我看到的網址是:

http://machinename:48620/DynamicsGPWebServices 

其中機器爲localhost。