2013-10-07 49 views
1

我试图访问我的客户的GP 2010 Web服务,但我得到这个错误:405不允许的方法 - 动态GP 2010 Web服务

请求失败,HTTP status 405: Method Not Allowed

的网址是http://www.xyz.com:48620/Dynamics/GPService

在Visual Studio中,我看到这个URL中添加Web引用对话框:

xyz:48620/Metadata/WCF/Full/schemas.microsoft.com.dynamics.gp.2010.01.wsdl

当我访问的URL在浏览器中,我可以看到WSDL:

enter image description here

这里是WSDL代码:

http://pastebin.com/0VU7ZRbE

客户已经安装了GP2010 Web服务,它出现在浏览器中。我无法在Visual Studio中添加对它的引用。客户添加了入站和出站防火墙规则。

我使用了错误的URL还是有其他东西需要安装?

+0

您能看到上述服务的WSDL吗?请发布显示您与服务连接的代码? – Rajesh

+0

谢谢。我添加了更多信息。 –

回答

0

添加Web引用时,添加localhost:48620/Dynamics/GPService。如果您需要对另一个进行身份验证,请添加更改网址:

// Create an instance of the service 
     DynamicsGP.Core.DynamicsGPService.DynamicsGP wsDynamicsGP = new DynamicsGP.Core.DynamicsGPService.DynamicsGP(); 
     wsDynamicsGP.Url = "http://www.mysite.com:48620/DynamicsGPWebServices/DynamicsGPService.asmx"; 
     // Be sure the default credentials are used 
     wsDynamicsGP.UseDefaultCredentials = true; 
     wsDynamicsGP.Credentials = new NetworkCredential("username", "password", "domain"); 

     CompanyCriteria cc = new CompanyCriteria(); 
     Company[] c = wsDynamicsGP.GetCompanyList(cc, new Context()); 


     return wsDynamicsGP;