我正在尝试从我当地的 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:无法连接到远程服务器 ---> > System.Net.Sockets.SocketException:无法建立连接,因为目标机器主动 > 在 System.Net 拒绝它 127.0.0.1:48260。 System.Net.ServicePoint.ConnectSocketInternal 上的 Sockets.Socket.DoConnect(EndPoint endPointSnapshot,SocketAddress socketAddress)(布尔连接失败,套接字 s4,套接字 s6,> 套接字和套接字,IPAddress 和地址,ConnectSocketState 状态,IAsyncResult asyncResult,Int32 > 超时,异常和异常) --- 内部异常堆栈跟踪结束 --- 在 System.Net.HttpWebRequest.GetRequestStream() 在 System.Net.HttpWebRequest.GetRequestStream(TransportContext& context) 在 System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] 参数)在 PMInvoices。DynamicsGPService.DynamicsGP.GetVendorList(VendorCriteria 标准,上下文上下文)在 >c:\Users\joe_a84\Downloads\DeveloperToolkitSampleApps\PMInvoices\PMInvoices\PMInvoices\Web References\DynamicsGPService\Reference.cs:line 4069