Hi people,
 
I have made a web service in VS 2008 which connects to Ax 2009.
code is as follows:
 
/*********************************************************************************************************
 
using System;
using System.Linq;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Linq;
using Microsoft.Dynamics.BusinessConnectorNet;
[WebService(Namespace = "http://tempuri.org/";)]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, 
uncomment the following line. 
// [System.Web.Script.Services.ScriptService]
public class Service : System.Web.Services.WebService
{
Microsoft.Dynamics.BusinessConnectorNet.Axapta ax = new Axapta();
public Service () {
//Uncomment the following line if using designed components 
//InitializeComponent(); 
}
[WebMethod]
public string HelloWorld() 
{
string name;
System.Net.NetworkCredential nc = new System.Net.NetworkCredential("axbcbhel", 
"password","ilfstechnologies.com");
ax.LogonAs(Environment.UserName, null , nc, null, null, null, null );
name = Convert.ToString(ax.CallStaticClassMethod("Class1", "method1"));
return name ;
/*
DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
System.Net.NetworkCredential nc = new 
System.Net.NetworkCredential("ProxyUserId", "password");
DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",nc,"dat",
"en-us"," compa...@aos:2713","AXClient");
DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",nc,"dat",
"en-us","compa...@aos:2713","c:\\Client.axc");*/
}

}
*******************************************************************************************************/

When i run this webservice it works fine and prints the code written in the ax 
2009 class but when i deploy this webservice in IIS through virtual directory 
and then browse it ,it gives error 
 
/******************************************************************************************************
Microsoft.Dynamics.BusinessConnectorNet.InitializationFailedException: Failed 
to initialize Business connector.
   at 
Microsoft.Dynamics.BusinessConnectorNet.Axapta.Logon(BC_PROXY_ACCOUNT_INFO* 
pBCProxyAccountInfo, String company, String language, String objectServer, 
String configuration)
   at 
Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonUsingBCProxyAccount(_SEC_WINNT_AUTH_IDENTITY_W*
 pImpersonatedUserAccount, NetworkCredential bcProxyCredentials, String 
company, String language, String objectServer, String configuration)
   at Microsoft.Dynamics.BusinessConnectorNet.Axapta.LogonAs(String user, 
String domain, NetworkCredential bcProxyCredentials, String company, String 
language, String objectServer, String configuration)
   at Service.HelloWorld()

 
AND in the Event viewer i get this error

The configuration itl could not be found.
Use the Client Configuration Utility V5.0 to verify the configuration.
 *******************************************************************************************************/
 
I have tried these codes but in vain
    1.)   Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
      DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
      DynAx.LogonAs("","",null,"","","","");
                 
   2.)   Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
      DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
      DynAx.LogonAs(Environment.UserName,"",null,"","","","");
                 
  3.)    Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
      DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
      DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",null,"","","","");
                 
    4.)  Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
      DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
      System.Net.NetworkCredential nc = new 
System.Net.NetworkCredential("ProxyUserId", "password");
       
    5.)  
DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",nc,"","","","");
       Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
       DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
       System.Net.NetworkCredential nc = new 
System.Net.NetworkCredential("ProxyUserId", "password");
    
 
     DynAx.LogonAs   
(Environment.UserName,"FullyQualifiedDomainName",nc,"CompanyName","","",""); 
 
6.)Microsoft.Dynamics.BusinessConnectorNet.Axapta DynAx;
DynAx = new Microsoft.Dynamics.BusinessConnectorNet.Axapta();
System.Net.NetworkCredential nc = new 
System.Net.NetworkCredential("ProxyUserId", "password");
DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",nc,"dat",
"en-us"," compa...@aos:2713","AXClient");
DynAx.LogonAs(Environment.UserName,"FullyQualifiedDomainName",nc,"dat",
"en-us","compa...@aos:2713","c:\\Client.axc");********************************************************************************************************/
     
 Any kind of help is appreiciated.

 
Regards,
Prashant Verma
ILFS Technologies Limited.

Reply via email to