MS Dynamics Great Plains身份验证 - 无法建立连接

时间:2013-05-20 13:32:16

标签: microsoft-dynamics dynamics-gp

我试图从我当地的Great Plains实例中提取供应商列表。

当我访问时

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

我被要求登录。我输入我的Windows凭据,然后我看到找不到端点。

我知道Web服务存在。

我知道我的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:无法连接到远程服务器---> > System.Net.Sockets.SocketException:无法建立连接,因为目标计算机主动>拒绝它127.0.0.1:48260   在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)     ---内部异常堆栈跟踪结束---     在System.Net.HttpWebRequest.GetRequestStream(TransportContext& context)     在System.Net.HttpWebRequest.GetRequestStream()     在System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName,Object []参数)     at PMInvoices.DynamicsGPService.DynamicsGP.GetVendorList(VendorCriteria criteria,Context Context)> c:\ Users \ joe_a84 \ Downloads \ DeveloperToolkitSampleApps \ PMInvoices \ PMInvoices \ PMInvoices \ Web References \ DynamicsGPService \ Reference.cs:line 4069

1 个答案:

答案 0 :(得分:0)

我看到网址是这样的:

http://machinename:48620/DynamicsGPWebServices

其中machinename是localhost。