MWS Designer – Installation and Basic Usage

Over the years I’ve seen a number of people whose environments aren’t configured correctly and don’t have MWS Designer installed correctly. This post is to run through the setup and creating some webservices. I deliberately haven’t gone in to detail on how to consume those webservices as this post is quite long as it is.

Please be aware that MWS is the only Infor supported method of querying the database (there is currently no supported method for directly updating the database). Incidentally over the years we’ve heard the ‘M3 caches’ data and MWS is cache aware and there has been some anecdotal evidence to suggest that this may infact be the case in the later versions of M3 (eg 15.1.2).

So what is MWS Designer?

MWS Designer is a front-end to develop webservices to wrap SQL queries, M3 APIs and M3 Display Programs. It also provides the ability to deploy the xml files to your MWS servers and to create unit tests.

Be aware that the files MWS Designer creates for the webservices can be created by hand if you live and breath XML.

Note: Infor license MWS and MWS Designer separately. Often they sell them separately, which is ridiculous and I know a number of very unhappy customers that have been left in this situation.

Requirements:

  • LWSDIG/MWSDIG pdf (install guide)
  • lws/mws designer plugin (this must match the version of LWS/MWS on the server)
  • Eclipse Classic (the version is specific to the plugins and can be determined from the install guide)
  • JDK appropriate for your version of LWS/MWS
  1. Extract the Eclipse zip file to a location of your choosing
    (Eclipse doesn’t install, it can just be run from the directory of your choosing)
  2. This will extract in to the directory of your choosing and create a subdirectory called eclipse
  3. Double click on the eclipse.exe
  4. Remove the tick from “Always ask before opening this file”
  5. If you get an error about being able to create the VM then we need to the edit the Eclipse.ini file.
    At the bottom, under the –vmargs change the settings so they are as follows

    -XX:MaxPermSize=256m

    -Xms40m

    -Xmx256m

    Now Eclipse should start

  6. Help -> Install New Software
  7. Click Add -> Archive and select designer plug in then click on open.
  8. Click OK
  9. Select MWS Designer
  10. Click Next
  11. Click Next
  12. Accept the terms
  13. Click Finish
  14. Windows -> Open Perspective -> Other
  15. Select the MWS Designer and click on OK
  16. We should now see the MWS Designer opens
    (note: the workspace defines where the webservices location and servers settings etc are read from)
  17. Web Service Repositories is where the websevices and their methods will be displayed

Verifying the Servers have been set up correctly

Often Infor miss a couple of steps in the setup of the environment, notably database connections.

  1. Start LifeCycle Manager
  2. Under the Applications Tab expand out the environment to find the LWS/MWS instance
  3. Right click and Select Manage Application
  4. Click on Configurations

    You should have a database connection set up and a M3 Configuration
  5. Click on the spanner/and screwdriver to look at the details
    1. Example M3 Configuration
    2. Example Database configuration (Microsoft SQL)
    3. Example database configuration against an AS400
  6. Check the database drivers that have been registered by clicking on JDBC

Uploading Database Drivers

Chances are that if your database connections weren’t configured, you won’t have the appropriate database drivers.

It is important but not critical to use a database driver that is available on both the server and the client. If they don’t match then you won’t be able to automatically generate the output fields for SQL queries.

On the AS400 the default that is registered tends to be the DB2Driver. There is no equivalent for the windows environment where you will run MWS Designer. The IBM documentation makes reference to the JT400 driver which can be obtained from http://jt400.sourceforge.net/

Note that each driver has a different syntax for connecting to a database, so review the appropriate documentation for the JDBC driver

  1. Start LifeCycle Manager
  2. Under the Applications Tab expand out the environment to find the LWS/MWS instance
  3. Right click and Select Manage Application
  4. Click on JDBC
  5. Click on Browse
  6. Locate the driver you want to upload and click on Open
  7. Click on Upload and you should get a message confirming the upload and it should appear in the uploaded JDBC Drivers. You will need to restart LWS/MWS to register the driver.

Adding Servers

We need to add connections to our LWS/MWS servers so we can deploy our WebServices

To do this we need to know the URI to the LWS/MWS server endpoints.

Discoverying your LWS/MWS Endpoints

  1. Start LifeCycle Manager
  2. Under the Applications Tab expand out the environment to find the LWS/MWS instance
  3. Right Click and Select Monitor Application
  4. Select Web Components
  5. Expand the Context Roots
  6. Record the entry point on the server that the LWS/MWS component is installed on (you can right click and select “Copy Shortcut”
    http://ifbenp.indfish.co.nz:22104/mws

Adding LWS/MWS Connections to the WebServices Designer

  1. In the servers, click on the + button
  2. Provide a meaningful name and enter the URI that we got from MWS in LifeCycle Manager earlier
  3. Click on Finish and this should now be added to our servers list
  4. Click on the little chevron to the left of the server name to test our connection to the server
  5. Log in with a user that has rights to LWS/MWS
  6. And we shall have a list of the different configurations that we have set up in LWS/MWS

Create a Repository for your WebServices

A repository is there the XML files that define the webservices will be created.

You should save these files to be in a location that is backed up.

  1. In MWS Designer click on the Add Repository Location
  2. Specify a location where you would like to save the files
  3. Click on Finish

Creating WebServices

We have three options when creating our webservices.

SQL Queries Wrapped in a WebService

These allow you to wrap SQL queries and have data returned through a webservice. You can call Stored Procedures, DELETE, INSERT, SELECT and UPDATE

This is the only supported method for direct database interaction.

Most installs that I have come across can’t use the Populate output from statement

Which creates the resultset automatically based upon your query. This generally occurs because MWS wants to use the same database JDBC driver as the server to make the query, but it will do so from your computer.

Figure 1 – jdbc driver for this connection is missing

We can fix this issue by having the same jdbc driver on your computer. This can be imported in to the appropriate Eclipse directory by clicking Window -> Preferences -> MWS Designer -> Development Settings -> Import

In my instance you can see that I have the jt400.jar which was the same version as that which I used for my AS400 based M3 install and sqljdbc4-4.0.jar which is what is now used for the Windows based install of M3.

Note: please make sure that you uniquely name the resultsets per webservice. If a method has the same resultset as another method within the webservice, then you will enter a world of hurt using tools like Visual Studio whenever you make changes to the webservice.

I typically use the format <methodname>Result

M3 APIs Wrapped in a WebService

We can wrap the standard M3 APIs in a webservice. This has the advantage of external applications not needing the M3 API Toolset installed. It can also provide a nice, easy and consistent method of interfacing.

M3 Display Programs Wrapped in a WebService

This is the most difficult of types to create and get correct. M3 Display Programs will look at the ViewDefinitions and simulate what would be entered at the presentation layer.

This also has the highest risk of not working correctly and consistently after upgrades.

M3 Display Programs Build Example

We will use CRS055 to extract the Rate Factor, Name, Description and Currency for a specific currency.

  1. In MWS Designer
  2. Right Click on your Repo and select “New Web Service”
  3. Give the currency a name
  4. Select M3 Display Program to a type
  5. Select the server you want deploy this against
  6. We need to authenticate with a user that has at a minimum app-admin rights to MWS and use a user that exists in your authentication source

    This will allow MWS to retrieve the configurations from the MWS Application
  7. Select your Configuration
  8. Select the View configuration
  9. We will select CRS055
  10. Provide a meaningful name
  11. It will check to see if there is a M3 API with the same name and warn you if it exists (in general you should use the API instead)
  12. We need to enter the sequence we would use if we were using it in Smart Office
    We want to be in panel B, then we want to go to Panel E before we exit (F3)

    Entering the panels in here will populate the Inputs we can select from
  13. To get to panel E, we need to select Option 5 (Display). We also need to specify the default currency (AUD) and we need to ensure that our Panel Sequence has panel E as our first entry
  14. Now we need select the E panel fields we want to extract
  15. Save our newly created WebService
  16. Click on the Overview tab and then click on Deployment Wizard
  17. Select the environment to deploy to
  18. Select the context (if you haven’t authenticated to MWS yet, you will be prompted)
  19. You should get a confirmation that the webservice has been deployed
  20. Go to MWS Configuration Page to confirm that we deployed our webserivce
    Click on List
  21. Select the service context we deployed to and then click on our webservice
  22. We can see the WSDL Addresses that we can use to load in to an application like SoapUI or Visual Studio
This entry was posted in M3 / MoveX. Bookmark the permalink.

6 Responses to MWS Designer – Installation and Basic Usage

  1. Mike Wolfe says:

    I have created a web service and it works great in MWS designer. I am playing around with this so that I can get some experience using the M3 WS APIs. For an exercise I’d like to use a WS API from within Excel to add or change records in M3. In the past I have use the socket connectors but I’d like to do something new. I have been looking around for some documentation that would help me but have not come across the right things. For instance, in Excel there is a WEBSERVICE function that looks pretty interesting and I’d like to use that. Can you point me in the right direction? I have a feeling that I may get past a lot of security issues too.
    Thanks,
    Mike

    • potatoit says:

      Hi Mike,

      I’ve never used the WebService function however it looks pretty primitive and I don’t see any way to provide credentials.

      I’ve seen people use PocketSOAP in conjunction with Excel to interact with MWS – I’m not a big fan as it requires additional software to be installed.

      What security issues are you experiencing? The user saving their password in the spreadsheet? Or cert issues?

      Cheers,
      Scott

      • Mike says:

        Scott,
        I am anticipating cert issues. With using the socket method I can prompt for credentials in VBA. I’m thinking it might not be so easy with Excel and WS API, Unless there is another toolkit available. I’m trying to do things in as modern a method as possible and sometimes I find documentation that seems just too old.

        Just for starters, I’d like to find the formatting for the http command to use with the web services. For instance, I know if I paste something like this in my web browser that I get a nice response from the server:
        http://server.companyname.com:21107/mws-ws/services/WS_MWS001MI?wsdl

        I’d like to expand on that and add the actual transaction information to get some response on a transactional level, I just don’t know how to format it.

  2. Asaf says:

    Great post – Thanks
    I’ll be happy to get more details on the MDP

  3. Jan says:

    Can you use a M3 display program webservice to get the list of the B panels that match the criteria?

    • potatoit says:

      To be honest, I can’t remember if MWS allows you to pull back the list, but I’d not recommend approaching it from this direction as it’s a fairly fragile approach. I’d use standard APIs.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s