动态GP的Web服务:从另一方收到了不安全或不正确安全的故障 [英] Web Service of Dynamic GP: An unsecured or incorrectly secured fault was received from the other party
问题描述
动态GP 2013安装程序在服务器(Windows Server 2008 R2)上成功完成。在SQL Server 2008 R2上自动创建数据库。创建服务并运行这些服务。
在Visual Studio 2012上使用控制台应用程序并添加Dynamic GP的Web服务。 http:// IP:48620 /动态/ GPService / mex
使用示例代码测试下面给出的内容:
使用系统;
使用 System.Collections.Generic;
使用 System.Linq;
使用 System.Text;
使用 System.Threading.Tasks;
使用 WebServiceConsoleApp.DynamicGPAtTen;
使用 System.ServiceModel;
命名空间 WebServiceConsoleApp
{
class Program
{
静态 void Main( string [] args)
{
CompanyKey companyKey;
上下文上下文;
供应商供应商;
VendorKey vendorKey;
Policy vendorPolicy;
// 创建服务实例
DynamicsGPClient wsDynamicsGP = new DynamicsGPClient();
// 创建用于调用Web服务的上下文对象
context = new Context();
// 指定使用哪家公司(样本公司)
companyKey = new CompanyKey();
companyKey.Id =( - 1);
// 设置上下文
context.OrganizationKey = companyKey;
// 创建新供应商密钥
vendorKey = < span class =code-keyword> new VendorKey();
vendorKey.Id = TstVndr0001;
// 填充供应商对象
vendor = new 供应商();
vendor.Key = vendorKey;
vendor.Name = TestVendor0001;
// 获取供应商的创建政策
vendorPolicy = wsDynamicsGP.GetPolicyByOperation( CreateVendor,context);
// 创建供应商
wsDynamicsGP.CreateVendor(供应商) ,context,vendorPolicy);
// 关闭服务
if (wsDynamicsGP.State!= CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}
}
运行应用程序后出现以下错误消息:
从另一方收到无担保或错误安全的故障
有什么想法可以解决吗?
图片的详细信息
图片
Dynamic GP 2013 Setup successfully done at server (Windows Server 2008 R2). Database auto created on SQL Server 2008 R2. Services are created and these are running.
Taking a console application on Visual Studio 2012 and added the Web Service of Dynamic GP. http://IP:48620/Dynamics/GPService/mex
Use a sample code to test which are given bellow:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WebServiceConsoleApp.DynamicGPAtTen;
using System.ServiceModel;
namespace WebServiceConsoleApp
{
class Program
{
static void Main(string[] args)
{
CompanyKey companyKey;
Context context;
Vendor vendor;
VendorKey vendorKey;
Policy vendorPolicy;
// Create an instance of the service
DynamicsGPClient wsDynamicsGP = new DynamicsGPClient();
// Create a context object with which to call the web service
context = new Context();
// Specify which company to use (sample company)
companyKey = new CompanyKey();
companyKey.Id = (-1);
// Set up the context
context.OrganizationKey = companyKey;
// Create a new vendor key
vendorKey = new VendorKey();
vendorKey.Id = "TstVndr0001";
// Populate the vendor object
vendor = new Vendor();
vendor.Key = vendorKey;
vendor.Name = "TestVendor0001";
// Get the create policy for the vendor
vendorPolicy = wsDynamicsGP.GetPolicyByOperation("CreateVendor", context);
// Create the vendor
wsDynamicsGP.CreateVendor(vendor, context, vendorPolicy);
// Close the service
if (wsDynamicsGP.State != CommunicationState.Faulted)
{
wsDynamicsGP.Close();
}
}
}
}
After running application it gives following error message:
An unsecured or incorrectly secured fault was received from the other party
Any idea to solve?
Detail info on Image
Image
这篇关于动态GP的Web服务:从另一方收到了不安全或不正确安全的故障的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!