I am developing an Intranet site that utilizes GP Web Services to manage Vendor information (among other things). Today I noticed that the GetVendorByKey method was failing for one of our Vendors.
We have tested quite a few Vendors, and this is the first time that this error has occurred.
I'll provide some context and cover what steps I have already taken here...
Visual Studio throws a...
1.System.ServiceModel.FaultException<System.ServiceModel.ExceptionDetail>
With a message of...
1.{"The application encountered an unhandled system exception. Contact your system administrator for details."}
I've seen this message a few times before and previously used the Dynamics GP Exception Management Console to actually view the message. However, when I attempted to view the System Exceptions I received a 'Cannot Access the Exception Service' error from the console.
Following the 3rd solution on this guide, I was able to view the errors in SQL Management Studio. I removed the logs that contained 'invalid chars' using the below SQL query.
1.delete from DYNAMICS..WSExceptionLog
2.where ExceptionMessage like '%invalid character%'
Heading back into the Dynamics Exceptions Console I can now see an error.
Business object not found.
at Microsoft.Dynamics.Common.BusinessService.GetByKey(Key key, Context context, Type[] types)
The Request XML is (Vendor Id 00490 is the problem Vendor)...
<?xml version="1.0"?>
<RequestObjects>
<Id>OO490</Id>
</VendorKey>
<OrganizationKey xsi:type="CompanyKey">
<Id>1</Id>
</OrganizationKey>
<CultureName />
<CurrencyType>Transactional</CurrencyType>
<RoleKey>
</RoleKey>
</Context>
<string>Microsoft.Dynamics.GP.Vendor</string>
After a few more random attempts to retrieve the Vendor object via Web Services, I received the same error from the Exceptions Console and decided to look at the error in SQL Management Studio. Here, I found an Exception Message of...
'', hexadecimal value 0x06, is an invalid character.
Apparently this character is ACK, or acknowledgment. Never heard of this before.
I assumed that somewhere in the PM00200 table, there was an invalid 'ACK' character so wrote a quick C# script to check each column in the row for 0x06 characters. Nothing came up.
I also checked the VendorMaintenance Card in GP and all options/address fields for weird characters and didn't find anything.
Now that you're up to speed...
I'm still assuming that there is an invalid character in some Vendor-related table that GP Web Services is tripping over, but other than that I don't have a clue.
It may have something to do with the fact that I can only see one 'Business Object Not Found' error in the Error Management Console while every subsequent error apparently contains 'invalid characters'.
Any suggestions?