14
© Copyright 2012, LS Retail ehf. All rights reserved. All trademarks belong to their respective holders. LS Retail Mobile Inventory Support Notes

LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

Embed Size (px)

Citation preview

Page 1: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

© Copyright 2012, LS Retail ehf. All rights reserved. All trademarks belong to their respective holders.

LS Retail Mobile Inventory

Support Notes

Page 2: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail ehf. Katrínartún 2, 105 Reykjavík, Iceland

Tel: +354 414 5700 Fax: +354 571 2728

Contents

1 Introduction ............................................................................................................................... 1

2 Pre-requirements ..................................................................................................................... 1

3 Connect to NAV web service from your desktop machine ......................................... 2

4 Connect to NAV web service from the mobile device .................................................. 4

5 Mobile Inventory application on the mobile device .................................................... 6

6 Tips ................................................................................................................................................ 7

7 Errors encountered ................................................................................................................. 9

8 Emulator installation on Windows 7 ............................................................................... 11

9 Emulator installation notes for VirtualBox 4.2.0 ........................................................ 12 Revision History

No. Date Changes Changes

1.0 17.08.2012 First version

Page 3: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 1 - Introduction 1

1 Introduction

This support note describes the best approach to install the Mobile Inventory Application version 1.0.1 (SP1) and above. It covers the client and server configuration so that the Mobile Inventory application and the NAV web service can communicate successfully. This is not a guide on how the Mobile Inventory application and LS Retail NAV 6.4 are designed or how they function. Download the latest version of LS Retail NAV from http://partners.lsretail.com and extract the file „LS Retail NAV 6.4 Part 4 Other.exe„ to a local folder and locate the mobile application files.

2 Pre-requirements

Install the latest LS Retail demo company, for example: „CRONUS LS 2009

(6.4)W1 Demo v10“ - this demo company will be used as we connect to it from

the Mobile Inventory application and test programs.

Read the „LS Retail Mobile Inventory 2012 - Install and Quick Guide.pdf“

Make sure you have the Windows Mobile Device Center installed and that you

are able to connect from your desktop to the mobile device via USB cable.

This support note assumes that the mobile device is connected to a windows desktop machine via USB cable. It does not cover why you cannot connect to the NAV web service over the wireless network. The mobile device can be replaced with a Windows Mobile 6 Emulator.

Page 4: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 3 - Connect to NAV web service from your desktop machine 2

3 Connect to NAV web service from your desktop

machine

Before any installation on the mobile device takes place you should try from your desktop machine to connect and retrieve data from the NAV web service. Unzip the TestNavWs.zip file and run TestNavWs.exe from your desktop.

.Net 4.0 must be installed on your desktop.

Enter the NAV user name and password.

o This password should NOT be encrypted using the

MobileInventoryGenerator.exe.

Enter the URL to the NAV web service. This URL should be the same as in the

Web Service Setup.

Page 5: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 3 - Connect to NAV web service from your desktop machine 3

This test application sends and retrieves data from NAV in XML format. You can

change the values in the XML request body without breaking anything.

Select a few different web calls and retrieve the data from NAV.

o At startup the Mobile Inventory application uses the

IM_TEST_CONNECTION, IM_GET_SETUP_DATA and

IM_GET_WORK_DATA. So it is a good idea to test them.

The „Display xml response“ check box can be unchecked when you do not want

to retrieve megabytes of data into the response textbox.

This test application can also be helpful when checking the data returned from NAV since it uses exactly the same web methods and xml data structure as the Mobile Inventory application.

Page 6: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 4 - Connect to NAV web service from the mobile device 4

4 Connect to NAV web service from the mobile device

Before you install the LSRetailMobileInventory.CAB you should run the TestNavWsDevice program from the device. Unzip the TestNavWsDevice.zip file on your desktop machine. Change the following values in the app.config file. <add key="BOWebServiceURL" value = "http://172.22.17.76:7047//DynamicsNAV/WS/CRONUS_LS_64_W1_DemoV10/Codeunit/RetailWebServices"/> <add key="BOWebServiceUserName" value="NavUsername"/> <add key="BOWebServiceDomain" value=""/> <add key="BOWebServicePassword" value="navPlainPwd"/> Notice that the BOWebServiceURL is simply the encoded URL “http://172.22.17.76:7047/DynamicsNAV/WS/CRONUS LS 2009 (6.4)W1 Demo v9/Codeunit/RetailWebServices”

The password should NOT be encrypted using the MobileInventoryGenerator.exe. Copy the contents of the zip file to the mobile device (including the updated app.config file). Run the TestNavWsDevice.exe on the mobile device.

The TestNavWsDevice.exe should return „SUCCESS“ or a meaningful connection error message. Success means that it could connect to NAV web service. Look at the XML response code. I should be “0000” and no error text. You can have a SUCCESS but an error returned from NAV in the response code. That simply means that you’ve connected to NAV but it is responding with an error.

Page 7: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 4 - Connect to NAV web service from the mobile device 5

Mobile devices are more sensitive to the URL encoding, so you may need to encode every special character in the URL on a device even if the same URL works fine on a desktop machine.

For example, this URL without encoding works on a desktop machine but may not on a mobile device

http://172.22.17.76:7047/DynamicsNAV/WS/CRONUS LS 2009 (6.4)W1 Demo -9/Codeunit/RetailWebServices

Encode the URL properly and it will work on a mobile device http://172.22.17.76:7047/DynamicsNAV%2fWS%2fCRONUS%20LS%202009%20%286%2E4%29W1%20Demo%20%2D9%2fCodeunit%2fRetailWebServices Notice that you need to encode every special character. For example, if you do not encode the period “.” then your mobile device may not be able to connect to NAV. Keep the URL as simple as possible, no special characters like “().-” although blank spaces seem to work fine on a mobile device. Note that our applications use the .Net Compact Framework 3.5 so if the device/emulator does not have it installed then download it from http://www.microsoft.com/en-us/download/details.aspx?id=65 and install it on device/emulator. The Mobile inventory Application uses SQL Server compact 3.5 so if the device/emulator does not have it installed then download it from http://www.microsoft.com/en-us/download/details.aspx?id=12264 and install on device/emulator.

Page 8: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 5 - Mobile Inventory application on the mobile device 6

5 Mobile Inventory application on the mobile device

Now that both the test programs have successfully connected to the NAV web service there should not be any problems connecting from the Mobile Inventory application to the NAV web service. Install the Mobile Inventory Application as described in „LS Retail Mobile Inventory 2012 - Install and Quick Guide.pdf“ Note that at startup the Mobile Inventory application synchronizes with NAV using the IM_TEST_CONNECTION, IM_GET_SETUP_DATA and IM_GET_WORK_DATA web methods. If the sync fails you know that one of those failed. Mobile Inventory Application displaying errors? To debug the Mobile Inventory application you need to know what the application is doing.

All errors are written to the “LogTable” in a local database file.

o Located under the Data folder, Data\MobileInventory.sdf

o This is a SQL Server Compact Edition version 3.5

o To view it, copy the Data\MobileInventory.sdf to your desktop.

Download a database viewer like Compactview

(http://sourceforge.net/p/compactview/home/Home/) and look at the

“LogTable”.

Errors that cannot be written to the local database are written to a text file.

o The file is called "HHInventoryLog.txt" located in the same folder as the

exe.

o If the sqlce.wce5.armv4i.CAB was not installed you will see all the errors

in this file.

You can make the application write traces to the LogTable so you can see what

code is being executed. Simply set the LogLevel to 1 in the app.config file and

restart the application.

o <add key="LogLevel" value="1"/>

In extreme cases you can view the XML requests and responses between NAV

and the Mobile Inventory application. Set the LogLevel to 0 (zero) in the

app.config file and restart the application. This will also write traces and error

to the LogTable.

o <add key="LogLevel" value="0"/>

o All the requests are saved as xml to a file called “HHXmlRequest.txt”.

o Not all the responses are saved to the HHXmlRequest.txt file, for example

the master data response is not saved since the size of the response can

be very large.

Remember to set the Loglevel back to “2” once debugging is done.

Otherwise the disk may fill up quickly.

Page 9: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 6 - Tips 7

6 Tips

There is a great tool called myMobiler (http://mymobiler.com/?cat=4) that allows you to remote display a mobile device from your desktop. Simply connect via USB using Windows Mobile Device Center and you can control the mobile device remotely. If you are having problems connecting to the NAV web service:

On the NAV server make sure the web service is up and running.

o c:\netstat.exe -na

and make sure that the ip address and port (7047) are Listening

o To start the NAV web service ..

o Make sure the windows firewall is not blocking the port

o \Microsoft Dynamics NAV\60\Service\CustomSettings.config file is

pointing to the correct server.

o NAV windows services must be restarted after changes

o

o Ipv6 may need to be disabled (if everything else fails look at this)

From your client, try to make a connection to NAV web service

o c:\telnet.exe 172.100.77.10 7047

to enable telnet client on win 7, www.fettesps.com/windows-7-enable-

telnet

You should be able to connect to the NAV web service URL with internet explorer (also from the mobile device browser). Internet explorer should prompt you for the username and password. Search for items in a worksheet. Check how the search if performed against the NAV server. For example, if Positive Adjustments search returns nothing it is probably because the “Search for Item by” is set to None. Change it and restart the application.

Page 10: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 6 - Tips 8

Page 11: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 7 - Errors encountered 9

7 Errors encountered

Error Solution

<?xml version="1.0" encoding="utf-8" standalone="no"?> <Response><Request_ID>IM_GET_MASTER_DATA</Request_ID><Response_Code>0099</Response_Code><Response_Text>This message is for C/AL programmers: Unable to create an instance of Automation Server {4632654B-DAEC-4087-A7E7-F97308E24BEB} with CLSID = 4632654b-daec-4087-a7e7-f97308e24beb Retrieving the COM class factory for component with CLSID {4632654B-DAEC-4087-A7E7-F97308E24BEB} failed due to the following error: 80040154..</Response_Text></Response>

Check if the LS Retail Toolbox has been installed. Under Tools/Custom Controls look for the LS Retail controls. If not found install from it from \Setup\LS Retail Toolbox 6.4 \Setup\LS Retail ToolboxRTC 2.02

Same error as above.. This message is for C/AL programmers: Unable to create an instance of Automation Server {4632654B-DAEC-4087-A7E7-F97308E24BEB} with CLSID = 4632654b-daec-4087-a7e7-f97308e24beb Retrieving the COM class factory for component with CLSID {4632654B-DAEC-4087-A7E7-F97308E24BEB} failed due to the following error: 80040154

LS Retail Toolbox must be installed on the machine where the NAV web service is running \Setup\LS Retail Toolbox 6.4 \Setup\LS Retail ToolboxRTC 2.02

NavNCLChangeListenerConnectionFailedException NAV Server cannot connect to ChangeListener to SQL Server

The key “DatabaseName” in CustomSettings.config file must point to the database where the company resides. \Microsoft Dynamics NAV\60\Service\CustomSettings.config

MissingMethodException. Could not load type xxx from assembly xxxx,.

Make sure the .Net Compact Framework 3.5 and SQL Server compact 3.5 are installed on device/emulator

Page 12: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 7 - Errors encountered 10

Page 13: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 8 - Emulator installation on Windows 7 11

8 Emulator installation on Windows 7

If you do not have Visual Studio 2008 installed you can install and use the standalone Windows Mobile 6 Emulator by following these instructions. The emulator was successfully installed on a Windows 7 machine by following these 3 steps.

1. Install the emulator and image

http://www.microsoft.com/en-us/download/details.aspx?id=16182 (download

professional version)

2. Install the “Virtual PC” so you can get network connection from the emulator

http://www.microsoft.com/en-us/download/details.aspx?id=24439

3. Install the Windows Mobile Device Center 6.1 (needed to copy CAB file to

emulator)

http://www.microsoft.com/en-us/download/details.aspx?id=3182

4. Install the device emulator – make sure you choose 64 bit for 64 bit machines.

This allows you to cradle the emulator.

http://www.microsoft.com/en-us/download/details.aspx?id=5352

5. Install all the software like you would with a device. That includes sqlce and .Net

3.5

Helpful links: Connect from the emulator to the internet with internet explorer (www.google.com). Read these articles to configure the emulator so it can connect to the network. Installing the emulator and access to network. http://blogs.technet.com/b/exchange/archive/2007/09/17/3403937.aspx Help with network access on emulator. http://betterthaneveryone.com/archive/2008/08/31/getting-network-access-on-the-windows-mobile-emulator.aspx SUCCESS !

Page 14: LS Retail documentfiles.lsretail.com/NAV/LSMobileInventory1.0.2/Mobile Inventory... · LS Retail Mobile Inventory Support Notes Chapter 1 - Introduction 1 1 Introduction This support

LS Retail Mobile Inventory Support Notes

Chapter 9 - Emulator installation notes for VirtualBox 4.2.0 12

9 Emulator installation notes for VirtualBox 4.2.0

Installation for emulator on VirtualBox is the same as above Windows 7 installation steps. Installation files used for VirtualBox setup.

VirtualBox 4.2.0.virtual machine

o VirtualBoxSDK-4.2.0-80737.zip (VirtualBox-4.2.0-80737-Win.exe)

VitualBox Guest Additions 4.2.0

o VBoxGuestAdditions_4.2.0.iso – (for shared folder between guest and

host)

Operating System installed on Virtalbox.

Windows 7 Professional 64bit and Service Pack 1

Files used for successful installation of LS Retail Mobile Inventory on VirtualBox.

Microsoft Virtual PC

o vpc-64setup.exe

Mobile Device Center

o drvupdate-amd64.exe

Device Emulator

o vs_emulator_x64_vista.exe

Emulator Images (different device screen sizes )

o Windows Mobile 6.1 Professional Images (USA).msi

Now you should configure Device Emulator network settings on device itself and cradle in Device Emulator Manager. Files that must be installed on the Emulator prior to installing LS Retail Mobile Inventory are listed here below. Create shared folder in Virtualbox (this option is installed with VirtualBox Guest Additions), copy these files to shared folder, open Mobile Device Center and open browse mobile device and copy files in to program files folder. Go to emulator itself and click these files for installation.

.NET framework 3.5 for Windows Mobile

o NETCFv35.wm.armv4i.cab

SQL CE database for Windows Mobile

o sqlce.wce5.armv4i.CAB

Configure Emulator (see installation for Emulator on Windows 7 above if not already done) copy LSRetailMobileInventory.CAB to Emulator and run.

This should work.