LSO10, APIs & WebServices, things have changed

We recently upgraded to LSO10 (yay!), got Mashups (yay!), DAF (yay!) and LES (yay!) and we went as far as we could with the Grid. So M3 is now in the Grid so we lose Server View and instead get a lot of very interesting and fancy stuff in LifeCycle Manager.

We have Gridified the M3 Business Engine, which in turn effects means we have access to Grid WebServices. In the world of Grid WebServices there are a few surprises.

The Grid is all handled through LifeCycle Manager.

Authentication Changes

Grid Services use LDAP for authentication. Previously WebServices and Smart Office used LDAP and the APIs used our AS400 authentication.

SQL Connection Changes

It is this that prompted the posting. Setting up WebServices to use SQL pre-grid was pretty straight forward. You would go to the Lawson Web Services page and click on the create a SQL link and you’ll get something similar to this

The Driver and the JDBC Url you could actually get from the M3 properties.

Under the Grid it gets arcane to those of us who don’t live and breath AS400 and DB2.

  1. Log in to LifeCycle Manager
  2. Find your WebService Environment
  3. Right Click Lawson Grid -> Application -> Manage Application
  4. Click Configurations
  5. Add a Database Configuration
  6. Fill in the Connection details
    1. Name – a friendly name for you to reference
    2. Driver – this is the part that wasn’t obvious, and the documentation cryptically referred to “Lawson WebServices Administration Guide” which is no-where to be found for the Grid version of WebServices. Prevously it had been “com.ibm.as400.access.AS400JDBCDriver”. But as we were DB2, I choose DB2
    3. JDBC Url – again, I tried using the old config, no dice. In a fit of intellectual prowess I tried changing the jdbc:as400:// to jdbc:db2:// and it worked!
    4. Username and password, well…
  7. Click on Service Contexts
  8. Click on the Edit Selected Service Context
  9. Select your Database that you created.

Pre-Grid this would be sufficient for you to submit a string like this:
<soapenv:Envelope xmlns:soapenv=”http://schemas.xmlsoap.org/soap/envelope/&#8221; xmlns:mws2=”http://mws.intentia.net/mws2&#8243; xmlns:get=”http://www.indfish.co.nz/FreeCapsSQL/GetFreeCaps”><soapenv:Header><mws2:mws><mws2:user>potato</mws2:user><mws2:password>potatoit</mws2:password><mws2:company>100</mws2:company><mws2:division>IFL</mws2:division></mws2:mws></soapenv:Header><soapenv:Body><get:GetFreeCaps><get:OrderNumber>00000001</get:OrderNumber></get:GetFreeCaps></soapenv:Body></soapenv:Envelope&gt;

using a HttpWebRequest.

Post-Grid you will get authentication errors. It is actually through this that I discovered the Debug options in LifeCycle Manager for the Web Services which proved to give me the clues to solve this issue.

Now we need to use the HttpWebRequest.Credentials to provide the authentication information (refer to my previous postings for a more complete example in to which to insert the code below)

var credCache = new CredentialCache();
credCache.Add(new Uri(http://WLMX02.indfish.co.nz:21005&#8221;),“Basic”new NetworkCredential(“potato”“potatoit”));
hwrRequest.Credentials = credCache;

The http://WLMX02.indfish.co.nz:21005&#8221; is the endpoint of your webservice.
The “Basic” is to identify that we are using Basic authentication.
The new NetworkCredential(“potato”“potatoit”) is the username and password that we will use in the authentication header.

Interestingly I no longer needed to put the username and password in the SOAP envelope.

Identifying Endpoints and Getting the wdsl

You can find the location of the WDSL in LifeCycle Manager

  1. Log in to LifeCycle Manager
  2. Find your WebService Environment
  3. Right Click Lawson Grid -> Application -> Manage Application
  4. Select List
  5. Select your Service Context
  6. Select your WebService
  7. And now you have a path to the wsdl

To get the EndPoint is very easy. In Lawson Web Service Designer simply expand the server that you want to connect to, and locate the class you created, right click and select “Copy Endpoint”

And you’ll get something like
http://WLMX02.indfish.co.nz:21005/lws-ws/LWSDeve/FreeCapsSQL

Configuring the Servers for Lawson Web Service Designer

Finding where you need to point LWS Designer to wasn’t the most trivial of exercises, so here is a step by step.

  1. Log in to LifeCycle Manager
  2. Go to the Application Tab
  3. Find your Web Service
  4. Right Click and select Configure Application
  5. Click Manage Application
  6. Click Web Components
  7. Expand the entrypoints
  8. And the Entry Points are what you add to LWS Designer

Debugging – the Kewl Stuff!

One of the really nice things about Gridification is we have some debug settings.

If we turn on the “Create dump files for SOAP messages (files are stored in <Grid>/application/LWS/dumps)” we get a in and an out with the envelopes

Call your webservice

And now you’ll have files which show exactly what was submitted and returned.

This entry was posted in M3 / MoveX, Webservices. Bookmark the permalink.

5 Responses to LSO10, APIs & WebServices, things have changed

  1. Jonathan Amiran says:

    About the Grid Server View, if you like, it is possible to access it with a browser using URL similar to this:
    http://WLMX02.indfish.co.nz:22005/grid/ui/#/M3BE_14.1.2-Deve
    Jonathan.

  2. Thanks for this post Scott. Another kewl thing with the Grid is the REST endpoint for M3 API: http://thibaudatwork.wordpress.com/2012/02/23/how-to-call-m3-api-with-rest-json/

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s