Highlighted
Contributor.. Contributor..
Contributor..
2231 views

LR 11.51 - AsyncCallbacks New feature

Jump to solution

So we have this product which is a messaging system (like JMS) which our web application uses. Today to simulate this we use Java protocol and Java over http (work around even though the applications might be in Flex).

 

This product works in this fashion (high level)

1. Send a Http Connect (say handle 1 ) with http 1.0 , with a long keep alive

2. Further communications with the product happen with bursts of http 1.1 with data requests etc (recorded as Custom requests )

3. The server always sends Acknowledgements for step 2 right away with a kind of a accept/acknowledgement

4. The actual response for the http 1.1 requests come back Asynchronously on Handle 1.

 

I have tried the new Async callbacks provided. Is there a way to not make the initial connect stay on even after a Response message is received to ResponseCB ? Apparently Response seems to be coming every time and the conversation gets deleted. If i go the poll or long poll route it sends the initial connect again which i dont want.

 

Is there a way to hold the handle 1 open even after ResponseCB gets invoked without sending another request? any options that i can use ? I have also tried tried Option "None". Does not help either..

 

 

1 Solution

Accepted Solutions
Highlighted
Contributor.. Contributor..
Contributor..

A New enhancement request to sort this out hase been raised. HP is working on this one , when I get a patch which works will post back here ..

 

Thanks

Prabhu

View solution in original post

0 Likes
8 Replies
Highlighted
New Member.

Hello,

 

I would suggest the following approach:

1. Register step 1 (Connect) as a Push conversation.

2. Keep sending further communication with web_custom_request steps.

3. Use the ResponseBodyBufferCB to analyze the acknowledgements as they are received.

The callback function will be called each time a response body buffer is received, and will allow you to read and analyze the acknowledgements.

4. Use a combination of web_sync steps and lr_think_time steps to determine when the conversation is over.

Once the conversation is done, call web_stop_async.

 

Please let me know if this suggestion was helpful.

 

Feel free to contact me directly for further information regarding our Async feature, and specifically regarding combining Async with Flex applications.

Oded Keret
Highlighted
Contributor.. Contributor..
Contributor..

Thanks Oded ,

 

I had already given a shot at Push and None options(this was the most logical scenario at first). issues that i had was

 

1. I need a header value from the response of the long call (handle 1), Iam unable to capture this value as this does not seem to be available in the aAccumulatedStr of the ResponseBodyBufferCB. HEaders basically are invisible to me at this point

 

2. Headers show up in the ResponseCB. but when i get a Response Callback that means that the connection is closed( or Async basically seems to close it). I cannot initiate another connection as thats how this driver works.

 

Is there a way for me to see the header info even before i get a ResponseCB or can i write something which can see the Header as in the aResponseHeadersStr ?

 

This header identifies a particular session value which needs to be sent back in the custom requests which we will be sending seperately. This was the reason i could not use the web_reg_cross_step_download as well as it opens up the stream but does not let me use any correlation function to capture stuff which came back.

 

If I can sort this out then maybe I can move away from clunky Custom Java code to handle all these libraries.

 

Thanks

Prabhu

 

 

Highlighted
New Member.

Hello Prabhu,

 

I am afraid that we currently do not support the ability to read the response headers while the response is being processed, as we do for the response body in ResponseBodyBufferCB.

I hope that we will be able to add this functionality in one of our upcoming releases.

 

Thanks again for sharing your effort and feedback with us.

Feel free to contact me directly regarding the Async feature if you have any further questions or suggestions.

 

Thanks and regards,

Oded Keret
0 Likes
Highlighted
Contributor.. Contributor..
Contributor..

A New enhancement request to sort this out hase been raised. HP is working on this one , when I get a patch which works will post back here ..

 

Thanks

Prabhu

View solution in original post

0 Likes
Highlighted
Absent Member.
Absent Member.

Hi prabhushankar

 

Any further update on this issue and how did you manage to resolve this.

 

 I am also struck up with this issue.

 

Anyhelp would be apprecieated

0 Likes
Highlighted
Frequent Contributor.. Frequent Contributor..
Frequent Contributor..

Hi Oded,

 

Can you please help me out with building my web_sync requests please? My asyn call has needs to push until i am able to correlate a value, more often my request is actually able to create the input in application but tool fails to capture the response cuz it is not waiting for it. currently using web reg save param and hence the issue i think

 

thanks!

souj

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi

I am having difficulty create a asynchronous call if you can perhaps guide me using version 12.61.

I have the following in place, and are getting a response "Failed to locate Vuser script function "Push_0_RequestCB" specified via the "RequestCB" argument"

    web_reg_async_attributes(
        "ID=Push_0",
        "URL=https://...", 
        "Pattern=Push", 
        "PollIntervalMs=3000", 
        "RequestCB=Push_0_RequestCB", 
        "ResponseHeadersCB=Push_0_ResponseHeadersCB", 
        "ResponseBodyBufferCB=Push_0_ResponseBodyBufferCB", 
        "ResponseCB=Push_0_ResponseCB", 
        LAST);

    web_custom_request("web_custom_request",
        "URL=https://...",
        "Method=GET",
        "TargetFrame=",
        "Resource=1",
        "Referer=",
        "Mode=HTML",
        "EncType=gzip,deflate,application/json",
        "Body=",
        LAST);

    web_stop_async("ID=Push_0", 
        LAST);

 

0 Likes
Highlighted
Trusted Contributor.
Trusted Contributor.

Hi

I am having difficulty creating a async request if you can perhaps provide some guidance.

I am using version 12.61 and getting the following error for the request performed.

"Failed to locate Vuser script function "Push_0_RequestCB" specified via the "RequestCB" argument"

 

    web_reg_async_attributes(
        "ID=Push_0",
        "URL=https:/…", 
        "Pattern=Push", 
        "PollIntervalMs=3000", 
        "RequestCB=Push_0_RequestCB", 
        "ResponseHeadersCB=Push_0_ResponseHeadersCB", 
        "ResponseBodyBufferCB=Push_0_ResponseBodyBufferCB", 
        "ResponseCB=Push_0_ResponseCB", 
        LAST);

    web_custom_request("web_custom_request",
        "URL=https:/…",
        "Method=GET",
        "TargetFrame=",
        "Resource=1",
        "Referer=",
        "Mode=HTML",
        "EncType=gzip,deflate,application/json",
        "Body=",
        LAST);

    web_stop_async("ID=Push_0", 
        LAST);

 

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.