sreejithm
asked on
'System.ServiceModel.FaultException`1' occurred in mscorlib.dll Error C#
Good Morning.
As a part of my ongoing project for an in house integration, I need to push some data into our MS Dynamic CRM erp from a custom application. My code was working fine until yesterday, when I started getting the error :
A first chance exception of type 'System.ServiceModel.Fault Exception` 1' occurred in mscorlib.dll
I am calling a webservice from a C# windows client.
My code is as below
Could you please asssist
As a part of my ongoing project for an in house integration, I need to push some data into our MS Dynamic CRM erp from a custom application. My code was working fine until yesterday, when I started getting the error :
A first chance exception of type 'System.ServiceModel.Fault
I am calling a webservice from a C# windows client.
My code is as below
private void button1_Click(object sender, EventArgs e)
{
testAX.TelephoneRevenueClient tel = new testAX.TelephoneRevenueClient();
testAX.Alle_TelephoneRevenueData rev = new testAX.Alle_TelephoneRevenueData();
tel.ClientCredentials.Windows.ClientCredential.Domain = "dddd";
tel.ClientCredentials.Windows.ClientCredential.UserName = "testuser";
tel.ClientCredentials.Windows.ClientCredential.Password = "mtestpassword";
tel.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;
DateTime dt1 = new DateTime(2015, 05, 01);
DateTime dt2 = new DateTime(2015, 05, 28);
rev.parmAcctNum = "045013771";
rev.parmCustAccount = "500725";
rev.parmDepartment = "015";
rev.parmLOB = "010";
rev.parmPeriod = "201405";
//rev.parmRevFixed = Convert.ToDecimal(pfRev);
//rev.parmRevUsage = Convert.ToDecimal(puRev);
rev.parmSDate = dt1;
rev.parmEDate = dt2;
tel.insertRevenue(new testAX.CallContext(), rev);
Console.WriteLine("done");
Console.Read();
}
Could you please asssist
Disabling the error option in the Visual Studio Editor Tools->Option menu of IDE
- Uncheck Visual Studio Editor Tools -> Option -> Debugging -> General -> Enable the exception assistant.
- Uncheck Visual Studio Editor Tools -> Option -> Debugging -> General -> Enable just my code.
After that you will get the actual error which was throw by web service instead of FaultException.
- Uncheck Visual Studio Editor Tools -> Option -> Debugging -> General -> Enable the exception assistant.
- Uncheck Visual Studio Editor Tools -> Option -> Debugging -> General -> Enable just my code.
After that you will get the actual error which was throw by web service instead of FaultException.
ASKER
What are the service configuration?
ASKER
Hi Fareed,
How do I check that ?
Regards
How do I check that ?
Regards
ASKER
Hi Fareed.
Please find the detailed exception below
Server stack trace:
at System.ServiceModel.Channe ls.Service Channel.Ha ndleReply( ProxyOpera tionRuntim e operation, ProxyRpc& rpc)
at System.ServiceModel.Channe ls.Service Channel.Ca ll(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
at System.ServiceModel.Channe ls.Service ChannelPro xy.InvokeS ervice(IMe thodCallMe ssage methodCall, ProxyOperationRuntime operation)
at System.ServiceModel.Channe ls.Service ChannelPro xy.Invoke( IMessage message)
Exception rethrown at [0]:
at System.Runtime.Remoting.Pr oxies.Real Proxy.Hand leReturnMe ssage(IMes sage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Pr oxies.Real Proxy.Priv ateInvoke( MessageDat a& msgData, Int32 type)
at testservice.testAX.Telepho neRevenue. insertReve nue(Teleph oneRevenue InsertReve nueRequest request)
at testservice.testAX.Telepho neRevenueC lient.test service.te stAX.Telep honeRevenu e.insertRe venue(Tele phoneReven ueInsertRe venueReque st request) in c:\Users\Sree\Documents\Vi sual Studio 2013\Projects\testservice\ testservic e\Service References\testAX\Referenc e.cs:line 861
at testservice.testAX.Telepho neRevenueC lient.inse rtRevenue( CallContex t CallContext, Alle_TelephoneRevenueData _telRevenue) in c:\Users\Sree\Documents\Vi sual Studio 2013\Projects\testservice\ testservic e\Service References\testAX\Referenc e.cs:line 868
at testservice.Form1.button1_ Click(Obje ct sender, EventArgs e) in c:\Users\Sree\Documents\Vi sual Studio 2013\Projects\testservice\ testservic e\Form1.cs :line 48
done
Please find the detailed exception below
Server stack trace:
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.ServiceModel.Channe
at System.ServiceModel.Channe
Exception rethrown at [0]:
at System.Runtime.Remoting.Pr
at System.Runtime.Remoting.Pr
at testservice.testAX.Telepho
at testservice.testAX.Telepho
at testservice.testAX.Telepho
at testservice.Form1.button1_
done
find the <bindings> section in webservice configuration and write it here with obfuscated values.
ASKER
Hi Fareed.
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Teleph oneRevenue " />
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://test123 14:8202/Dy namicsAx/S ervices/Te leRevenue"
binding="netTcpBinding" bindingConfiguration="NetT cpBinding_ TelephoneR evenue"
contract="testAX.Telephone Revenue" name="NetTcpBinding_Teleph oneRevenue ">
<identity>
<userPrincipalName value="test@test.loc" />
</identity>
</endpoint>
</client>
</system.serviceModel>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_Teleph
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://test123
binding="netTcpBinding" bindingConfiguration="NetT
contract="testAX.Telephone
<identity>
<userPrincipalName value="test@test.loc" />
</identity>
</endpoint>
</client>
</system.serviceModel>
Write the code here you used to register the TCP Channel and client channel. I need to check the channel registeration.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The issue was resolved by re-compiling the webservice in AX
In Visual Studios, go to Tools -> Options (of the Integrated Development Environment):
Enable the exception assistant,
Enable Just My Code (Managed Only)
If the above are unchecked, I don't know what the problem is. But based on your description (with the problem rearing its head upon a client connecting), I bet the above are checked. You could try unchecking them and see if the problem goes away.