Provider Certification Tool Question

I'm playing around with writing the Provider and have had problems finding information on the Certification Tool (specifically, the intent of each test, the way things are supposed to work). As a result I have a few questions:

1) In the Device Information, what DeviceSimulator is supposed to be used? There is one in the bin folder (DeviceSimulator.exe), but is that one specific for the Acme sample provider? Does each provider have to write their own DeviceSimulator in order to pass the tests?

2) One of the tests that failed is the following: Simulated->Reader->Mandatory->"Add Device in Online Mode". In the Device Information, I set the IP Address and the Port for my device. The "Add Device in Online Mode" uses those settings to talk to my device, then closes the connection and then tries to open another connection using a different Port. Is this the intended behavior? I did not see any <applyPropertyProfile> commands going to the Provider. I thought that was the way to change the Port.

Once again, if there is a document that helps me understand some of these things better, please point me to it.

Thanks,

Greg

[1208 byte] By [Grishka] at [2008-1-21]
# 1

The DeviceSimulator.exe is not specific to Acme and can be used to simulate any device. However one will have to write a device specific DeviceTranslator. Refer 'Developing Device Simulators by Using the Device Simulator Framework ' in the BizTalk RFID documentation for understanding the same.

The DeviceSimulator.exe can be called using the following command to simulate a specific device:

"%RFIDINSTALLDIR%\bin\devicesimulator.exe" -c -f SimulatorConfig.xml

The config file contains information about the Translator and the Logical devices. For ex:

<?xml version="1.0" encoding="utf-8" ?>
<profile>
<section name="NumberOfDevices">
<entry name="DeviceCount">1</entry>
</section>

<section name="DeviceInformation_1">
<entry name="DeviceName">MyDevice</entry>
<entry name="ConnectionType">TCPIP</entry>
<entry name="IpAddress">127.0.0.1</entry>
<entry name="PortNumber">6668</entry>
<entry name="ProviderId">MyProvider</entry>
<entry name="NotificationDataFile">NotificationConfig.xml</entry>
<entry name="DeviceTranslatorAssemblyPath">MyTranslator.dll</entry>
<entry name="DeviceTranslatorConfigFile"></entry>
</section>

</profile>

--Ashish

Ashish at 2007-9-13 > top of Msdn Tech,BizTalk Server,BizTalk RFID...
# 2

Greg,

1) In the Device Information, what DeviceSimulator is supposed to be used? There is one in the bin folder (DeviceSimulator.exe), but is that one specific for the Acme sample provider? Does each provider have to write their own DeviceSimulator in order to pass the tests?

A: Devicesimulator.exe is the one which is supposed to be used here and it is not specific to acme provider. You can use the classes in the Device Simulator Interface to develop device simulators for various devices and you can write translators to simulate devices in addition to the basic framework that contains the common device functionality. For more on this topic please go through Microsoft BizTalk RFID Documentation > RFID Device Providers > Testing Providers> Developing Device Simulators by Using the Device Simulator Framework section in %rfidinstalldir%\Documentation\BizTalkRFID.chm

2) One of the tests that failed is the following: Simulated->Reader->Mandatory->"Add Device in Online Mode". In the Device Information, I set the IP Address and the Port for my device. The "Add Device in Online Mode" uses those settings to talk to my device, then closes the connection and then tries to open another connection using a different Port. Is this the intended behavior? I did not see any <applyPropertyProfile> commands going to the Provider. I thought that was the way to change the Port.

A: This test would try to add a device(with the transport setting that you have specified), create and start a process with this device hard linked to it. Then it will create another new device (with incremented port), simulate it and try to add to add the same to BiztalkRfid service.

Again, in %rfidinstalldir%\Documentation\BizTalkRFID.chm, you can find overview of manual and automatic testing of device providers, and how to develop a device simulator using Device Simulator Framework in section Microsoft BizTalk RFID Documentation > RFID Device Providers > Testing Providers and Microsoft BizTalk RFID Documentation > RFID Device Providers > Testing Providers > Testing Providers Using the Provider Certification Tool talks about the usage of the PCT.

Hope this helps.

Thanks,

Keerthi.

KeerthiKiran[MSFT] at 2007-9-13 > top of Msdn Tech,BizTalk Server,BizTalk RFID...
# 3

Does the line <"%RFIDINSTALLDIR%\bin\devicesimulator.exe" -c -f SimulatorConfig.xml> go into the "Device Simulator Plug-in Details" path in the Design Information? I get a syntax error if I do that:

5|unable to load "C:\Program Files\Microsoft BizTalk RFID\bin\DeviceSimulator.exe" -c -f SimulatorConfig.xml due to System.Argument
Exception: Illegal characters in path.
at System.IO.Path.CheckInvalidPathChars(String path)
at System.IO.Path.IsPathRooted(String path)
at Microsoft.RadioFrequencyIdentification.DeviceSimulator.Reader.Init()

Grishka at 2007-9-13 > top of Msdn Tech,BizTalk Server,BizTalk RFID...
# 4

Greg,

RFIDINSTALLDIR is an environment variable which is set to 'C:\Program Files\Microsoft BizTalk RFID\'. So, by using %RFIDINSTALLDIR% we can refer to this path and the relative files.

I was not able to reproduce this error even after specifying a non-existing config file. So, the config file contents may have some invalid characters. Try opening both SimulatorConfig.xml and the corresponding NotificationConfig.xml in iExplore to check whether the XML contains any invalid characters or not. You can refer to the Acme sample to see the contents of these config files which are available at the following location: 'C:\Program Files\Microsoft BizTalk RFID\Samples\Device Service Provider\Acme\AcmeEndToEnd\Simulator'.

The very first statement that comes when the simulator is started is: '1|Starting device simulator web service'. Were you able to see that? If not then may be the command line itself has some invalid characters in it. Also try launching the DeviceSimulator.exe directly from the folder.

--Ashish

Ashish at 2007-9-13 > top of Msdn Tech,BizTalk Server,BizTalk RFID...
# 5

Thank you, I have a bare-bones translator running. I have a generic question about how to make tests succeed. I know that my provider is not all implemented yet, but I just wanted an advice on a strategy to correct something based on the output of the Certification Tool test. I'm attaching the output below. How would I proceed to correct the problem specifically or the approach in general? Thank You, Greg

Test Title -> "Add Device in Online Mode"

5| 051107 10:01:26| 5/11/2007 10:01:26 AM: Test Starting

5| 051107 10:01:37| Trying to Simulate Device device42

5| 051107 10:01:43| Device Name: device42, LastSuccessfulConnectTime 5/11/2007 10:01:43 AM, LastActivityTime 5/11/2007 10:01:43 AM, NumberofConescutiveFailedConnections 0, LastExceptiononConnect , InterestedProcessesLength 0, Provider XXX

5| 051107 10:01:43| GetDeviceVersionInfos() returned 3 Versions for a newly added device

5| 051107 10:01:43| Device version did not turn out to be as expected for the newly added device

5| 051107 10:01:43| Trying to stop the process Process_1

5| 051107 10:01:46| Stopped the process Process_1

5| 051107 10:01:47| Cleaning Up

5| 051107 10:01:47| Stopping All Processes

5| 051107 10:01:47| Stopping all processes with eventCollectingMode = False

5| 051107 10:01:47| All Processes Stopped

5| 051107 10:01:47| Deleted binding for process Process_1

5| 051107 10:01:47| Deleted process Process_1

5| 051107 10:01:47| Deleted device device42

5| 051107 10:01:47| Deleted device device41

5| 051107 10:01:47| Failed to Add a valid Device in Online Mode with Device Simulator

5| 051107 10:01:47| Test Has Failed

Failed Test: Add Device in Online Mode

Grishka at 2007-9-13 > top of Msdn Tech,BizTalk Server,BizTalk RFID...