Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2013-02-01T19:52:34Z by george.baker
george.baker
george.baker
314 Posts
ACCEPTED ANSWER

Pinned topic HATS Web services client question

‏2013-01-30T00:17:01Z |
Assume we have a HATS Web service composed of Chained IOs. Assume also that the Web services client is a non-HATS servlet. Now assume that the Web page that the user sees has a button to submit the work to the servlet. The servlet accepts the request and formulates the action into a HATS Web services call. The servlet will call the FIC (logon) element when necessary and save the HPubLinkKey from the return and use it appropriately for the MIC and the LIC calls. Assume all works well if everyone plays by the rules.

Now assume two things:
  • The Web page the user sees does not force the user to wait until the first request is completed before submitting another one.

If the user clicks the submit button two times in rapid succession I assume the following occurs:
1. Two requests are sent to the non-HATS servlet
2. The non-HATS servlet submits the first request, capturing the HPubLinkKey.
3. The second request comes into the non_HATS servlet before the first finishes. I assume that this second request would be launched in a separate thread.
4. The second thread has access to the HPubLinkKey from the first request and uses it.

What will HATS do in this case?

We are seeing that the first request will run correctly, but the second request submitted before the first is completed is generating HATS errors similar to:

No connection 

for chained application found with key HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#50 HPS6007 Connection Link Key is 

null when trying to acquire a chained non-web connection No connection 

for chained application found with key HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#51 HPS6007 Connection Link Key is 

null when trying to acquire a chained non-web connection


IMHO, the Web services client (non-HATS servlet) is at fault. However, my questions are:
1. If a WS client issues a second request for a HATS Web service before the first completes and uses the same HPubLinkKey, are two threads spawned?
2. If so would this account for the errors seen?

A strange situation I admit. I'm just trying to understand what actually happened.
Updated on 2013-02-01T19:52:34Z at 2013-02-01T19:52:34Z by george.baker
  • RajniJain
    RajniJain
    12 Posts
    ACCEPTED ANSWER

    Re: HATS Web services client question

    ‏2013-01-31T06:55:23Z  in response to george.baker
    Hi George,

    For each request HATS is generating one unique HPubLink Key.
    lets take example we have 3 chained macros , FIC ,MIC and LIC.
    If user has sent 2 requests using FIC (logon macro) , he will receive 2 HPubLink key from HATS WS.

    e.g HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#50
    and HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#51

    Same HPubLink key cannot be used for 2 request.

    now user can use any of one key for MIC only once and then same key for LIC only once.

    Below errors could be come because of following reasons :

    Same key is used twice for MIC
    Same key is used twice by LIC
    key is directly used by LIC not by MIC.
    etc..
    Regards,
    Rajni
  • george.baker
    george.baker
    314 Posts
    ACCEPTED ANSWER

    Re: HATS Web services client question

    ‏2013-01-31T15:57:36Z  in response to george.baker
    Rajni, I understand what you posted. Unfortunately, I believe there was some miscommunication, so let me clarify.

    • First we are talking about a Web service that uses IO chaining.
    • I understand that when you run an FIC you get a unique HPubLinkKey for that session and you should use that key when running all FIC and the LIC for that session. You do not get a new key after each request, MIC.
    • If we issue two FIC we get 2 keys, e.g. HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#50 and HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#51. Theoretically, these represent requests from two separate users.

    The scenario under question can be simplified as follows:
    • The Web Service client issues a MIC for HodConn:cdw7+cdw7t3+cdw7ts3|prjlamiEAR.ear#50, then it proceeds to issue another MIC request for the same key without waiting for the response from the first request. How does HATS handle this? The Web services client in this example is accepting requests from the end user, but is allowing the user to submit the second request before the first request has completed. This is not proper procedure but what is happening. I would have thought that there would have been some queuing of the second request because it was for the same key, but apparently there is not. I'm trying to determine how HATS processes a request in this environment and what error conditions will be reflected in order to determine if this is causing the error that we are seeing.

    I have two another related question here:
    1. In a normal Web project the JSESSION id is used to associate the request to the end user and multiple requests are rejected. I assume that the HPubLinkKey is the equivalent in a Web service. In a Web service the client may be submitting requests for multiple clients. I assume that it is the responsibility of this client to ensure that the correct key is used for the correct client, but is there any control by HATS that would prohibit the Web service client from using the wrong key? For example if two requests come from two separate clients and the client specifies the key on the MIC for the other client what happens?
    2. Both the Web service client and the HATS Web service are running on vertical clones. Is it possible that the second request submitted by the end user is sent to the wrong clone causing this type of problem?
    • RajniJain
      RajniJain
      12 Posts
      ACCEPTED ANSWER

      Re: HATS Web services client question

      ‏2013-02-01T10:32:31Z  in response to george.baker
      1. In a normal Web project the JSESSION id is used to associate the request to the end user and multiple requests are rejected. I assume that the HPubLinkKey is the equivalent in a Web service. In a Web service the client may be submitting requests for multiple clients. I assume that it is the responsibility of this client to ensure that the correct key is used for the correct client, but is there any control by HATS that would prohibit the Web service client from using the wrong key? For example if two requests come from two separate clients and the client specifies the key on the MIC for the other client what happens?

      Yes, George , This is responsibility of client to ensure correct key is used for correct client.
      In case HATS receive wrong key or chained Integration Objects are called out of sequence.In that case "No connection for chained application found with key "HPubLinkKey value" error will be thrown.

      2. Both the Web service client and the HATS Web service are running on vertical clones. Is it possible that the second request submitted by the end user is sent to the wrong clone causing this type of problem?

      Yes, It can cause the problem.
      Just to understand better , want to know the setup details and under what condition web service client can call wrong clone.

      Regards,
      Rajni
  • george.baker
    george.baker
    314 Posts
    ACCEPTED ANSWER

    Re: HATS Web services client question

    ‏2013-02-01T19:52:34Z  in response to george.baker
    Not having actually written and deployed a Web service client that called HATS I'm not sure how WAS manages the request. In a Browser the JSESSIONID is used by the plug-in to route the request, but what is used when the request is a SOAP request?

    I was just looking for anything to explain the errors that we are seeing.