OATS Enhancement: Verify the response contents of http requests which enclosed by begin/endconcurrent

Recently I’m testing the Fluid UI with OATS 12.4.0.2.
In this test, since the browser get all tiles in current page simultaneously, I have to simulate this behavior in OpenScript/OLT.
Then I put all those http requests into a concurrent block ( marked by begin/endconcurrent statments) and it works fine.
But this bring in a limitation: so far, the OATS doesn’t support to verify the http response contents if those http requests resided inside the concurrent blocks.
So I did an enhancement for OpenScript to overcome this limitation. I think it might useful if you have similar test scenario.
How to use it:
Put the attached file ConcurrentHTTPService.java into your OpenScript project folder ( same folder as where your script.java living).
Replace the alias line for http in script.java, the below is after replacement:
//@ScriptService oracle.oats.scripting.modules.http.api.HTTPService http;
@ScriptService ConcurrentHTTPService http;
  3. Put your http.get inside concurrent block as usual:
http.beginConcurrent("Get_Tiles_Concurrently");
//The below IDs are useful for later. We use this ID to identified the http requests inside the concurrent block.
//If you dn’t have those IDs, it’s OK, we can use the full URL string (including all parameters)to do the same thing,
//but the full URL is very long, and I hate the screen were occupied by URLs…
http.get( 193, "http://Page1",...);
http.get( 194, "http://Page2",...);
http.endConcurrent("Get_Tiles_Concurrently");
  4. After endConcurrent statement, We can use the following methods to get the http response content by RecID or full URL:
//Those methods should be used after the endConcurrent statement
//Get the response contents:
//Please reference the http.getLastResponseContent method for the explain of parameters.
info("Resp 193/Page1:" + http.getLastResponseContentForConcurrent(193,Source.Html));
info("Resp 193/Page1:" + http.getLastResponseContentForConcurrent("http://Page1",Source.Html));
//Verify the response contents:
//Please reference the http.AssertText method for the explain of parameters.
http.AssertTextForConcurrent(193, "Text Match Name", "Key_word_should_appear_in_response_content_of_request_193/page1",
    Source.Html, TextPresence.PassIfPresent, MatchOption.Exact);
http.AssertTextForConcurrent(("http://Page1", "Text Match Name", "Key_word_should_appear_in_response_content_of_request_194/page2",
    Source.Html, TextPresence.PassIfPresent, MatchOption.Exact);
Done!
Thank glenn.s in this thread: How to test asynchronous web service.

I think I have the solution to your dynamic addressing problem, but I have a problem combining HTTP authentication with dynamic address resolution.
I've got an external service that requires basic authentication and I've handled it successfully by adding a <MustSupportBasicAuthentication> block to the WSDL, as described in the article "Basic Authentication in HTTP SOAP BC" (http://wiki.open-esb.java.net/Wiki.jsp?page=HTTPBasicAuthentication). This works perfectly, causing the HTTP BC to send credentials every time it accesses the external service.
Now I want to make the URL of this external service dynamic (i.e., read it at run time from a configuration mbean). I followed the example from the article "Using Dynamic Address feature" (http://wiki.open-esb.java.net/Wiki.jsp?page=UsingDynamicPartnerLinks), which shows you how to send an endpoint reference (EPR), in the form of an <EndpointReference> block. This also works fine.
(I believe this last technique is the solution to your dynamic addressing problem. I've used both with and without BPEL. To use it outside of BPEL, you make a DocumentFragment out of the XML tree that begins with <EndpointReference> and pass it as an argument to the resolveEndpointReference method of your component context. This causes the JBI container to contact the HTTP BC, which understands the EPR.)
My problem is this: once I've dynamically changed the target URL of the external service, the HTTP BC seems to forget that it requires authentication and no longer sends credentials.
Has anyone else experienced this behavior, and if so how did you work around it?

Similar Messages

  • How to get the number and response time of HTTP request through Weblogic?

    hi,
    does anybody know how to get the HTTP request information through Weblogic server, such as the number of HTTP request in 1 min and the average response time of request in 5 mins ?
    Or is there anyway i can do it through monitoring and get these data then? If so, please help tell me.
    Thanks in advance
    BTW, we don't have the 3rd-party monitoring tool here.

    Hi,
    tables: usr02, usr41.
    data: OPCODE_MODE_COUNT(1) TYPE X VALUE 3,
          modes like sy-index,
          u_MODES LIKE MODES.
    select * from usr02.
      select * from usr41 where BNAME = usr02-bname.
        CALL 'ThUsrInfo' ID 'OPCODE' FIELD OPCODE_MODE_COUNT
          ID 'TID' FIELD usr41-TERMID
          ID 'MODES' FIELD MODES.
        IF SY-SUBRC = 0.
          u_MODES = u_MODES + MODES.
        ENDIF.
      endselect.
      if sy-subrc = 0.
        write:/ usr02-bname, u_MODES.
      endif.
      clear u_modes.
    endselect.

  • Slow response time for HTTP requests

    I have an 8310 Pearl. For the past week, I've noticed that the response time using the Internet browser was very slow. One work-around was to cancel the request and then submit it again. The second request returned the page MUCH faster.
    I cleared my history, and this seemed to have helped. Has anyone else noticed this? Thanks

    Welcome to the forums
    Try a Battery Pull:
    1. Remove the battery while phone is turned on
    2. Wait a few seconds before inserting it again
    3. Allow the long boot up process to finish (takes a few minutes usually)
    This clears most software issues that occur on blackberries from time to time. You could also use Quickpull, a free app that simulates a battery pull without physically removing the battery: http://software.crackberry.com/product.asp?id=27660
    A battery pull reclaims memory lost during application usage and clears minor software errors that creep in over time. The blackberry runs an OS just like your PC runs windows and the battery pull is the equivalent of a reboot/restart on your computer.
    Kijana
    Please remember to:
    1. Mark Accept as Solution on the appropriate post once your issue has been resolved
    2. Give Kudos to helpful posts (click the star next to the post)
    Thanks

  • Getting the Details from a HTTP Request using C#

    Hi,
    Suppose, a user submits a form with some details as Address, Phone Number etc.. to a Web Application. On the client side, I need to have a proxy to intercept this http request message being sent to the Server and get the details in it like Phone number and
    Address in this case and display them to user in a pop up box for confirming and if he clicks YES, then only I should forward the request to Web Server/Web Application. 
    If the user feels that the information shown to him is not correct he can Click NO and the request will not be sent to the Server. Anyone know how to use this in DOTNET WEB APPLICATIONS?
    I need to write code for the Proxy Part, I am not sure how to handle HTTP messages and from where to start with. Any help would be of great help.
    Thanks
    K.V.N.PAVAN

    http://forums.asp.net/
    Yu have many sections to choose from concerning Web based solutions.

  • Sending XML as the body of a HTTP request

    I have to write an application that interacters with a server that expects XML encoded commands as the body of a HTML request. Can anyone tell me how I should do this.
    Thanks.

    I have to write an application that interacters with a server that expects XML encoded commands as the body of a HTML request. Can anyone tell me how I should do this.
    Thanks.

  • How to read the Image Data using HTTp Request response

    i want to read image data from server please send me any code or answers.
    and also i want to exit application using button control for iphone simulator.
    thanks in advance.

    You would do a URLRequest and download the image. You could save it to disk and then load it or directly create a new image with the binary data.

  • How to detect the two Enter in  HTTP Request Line"

    I'm writing a HTTP Server. I want to ask how can I detect the "two <Enter> press" when the client finishes his request.
    Suppose the client typed the following:
    GET /xxx/index.html<ENTER>
    <ENTER>
    (Response header and Entity body here)
    if the user typed:
    GET /xxx/index.html<ENTER>
    If-Modified-Since:xxxxxx<ENTER>
    (Response header and Entity body here)
    How can I solve the above two cases?
    I have used the folowing statement but it fails, why?
    BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream( )));
    String request = null;
    request = in.readLine();
    Another problem in my WebServerThread is the output to the screen as shown in below:
    java.net.SocketException: Connection reset by peer: JVM_recv in socket input stream read
    at java.net.SocketInputStream.socketRead(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:85)
    at java.net.SocketInputStream.read(SocketInputStream.java:63)
    at java.io.InputStreamReader.fill(InputStreamReader.java:168)
    at java.io.InputStreamReader.read(InputStreamReader.java:244)
    at java.io.BufferedReader.fill(BufferedReader.java:134)
    at java.io.BufferedReader.readLine(BufferedReader.java:294)
    at java.io.BufferedReader.readLine(BufferedReader.java:357)
    at WebServerThread.run(WebServerThread.java:28)

    A second <ENTER> following directly after another will appear as empty line when you use in.readLine().

  • How to get the error code for http request

    I have to implement the if..elso loop depending on the error code return as below.
    String host="127.0.0.2"
    if the this servers is not found or itis down it should return error code, based on that I have to change the host value to some other server like "127.0.0.4" , Can you let me know how it can be implemented? Please help me.

    Here is my requirement...
    say.. if client hit " http:\\ 172.0.0.3: 1000/index.jsp" and if the server 172.0.0.3 is not available i will set the server host to some other and request will redirect accoringly like " http:\\ 172.0.0.4: 1000/index.jsp"

  • How can i call shutdown class after the server stopped listening http request

    Hi,
    I am using wls70sp1. I noticed that the shutdown class called right atfer the
    Server state changed to SUSPENDING. Then i saw the <http> *.jsp: destroy>, etc.
    see the log file in attachment. how can config the server stop the http listening
    first and then do the clean up works? This is very important for us, otherwise,
    there is still chance the request be left out.
    Thanks
    [shut.txt]

    Hi,
    I am using wls70sp1. I noticed that the shutdown class called right atfer the
    Server state changed to SUSPENDING. Then i saw the <http> *.jsp: destroy>, etc.
    see the log file in attachment. how can config the server stop the http listening
    first and then do the clean up works? This is very important for us, otherwise,
    there is still chance the request be left out.
    Thanks
    [shut.txt]

  • Get Response after HTTP Request

    Is it possible to display the response after a http request in forms? the response comes from a kind of reader which sends the reading-result as parameters after a request.

    Hello Henry,
    We are firing the CREATE/POST operation in the BATCH mode exactly with the same type of PAYLOAD what you have shared here and we are correctly getting response.
    1st operation was successful and we have got content with 201 Created Status Code.
    2nd operation failed and got 400 bad request with some error.
    3rd operation was successful and we have got the content with 201 Created Status Code.
    I am unable to replicate your problem in my case. Everything is working fine for me.
    Your problem is strange.
    Regards,
    Ashwin

  • Unable to deserialize HTTP response content - SharePoint Designer Call Web Service Workflow Activity

    I am creating a workflow using SharePoint Designer 2013 and I'm using the call HTTP web service action.
    The web service call works (it is for a text messaging service, and I get the text message to my phone) however the workflow stops at this point with internal status "suspended" and gives the error message below when clicking on the "i"
    icon.
    I have tried setting the Accept and Content-Type request headers to "application/json; odata=verbose" (minus the quote marks) as other posts suggested but this doesn't make a difference (e.g. here: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/f0b18411-87d1-466b-aab0-1a0093605ed4/workflow-cannot-read-json-after-latest-sp15-patches?forum=sharepointdevelopment).
    I tried adding in the Content-Length header too but that made no difference.
    I tested calling another web service (https://sharepointurl/_api/contextinfo) and this works fine.
    Is there any way to get the workflow to accept this XML as the response? I don't actually really need anything out of the response content, but I do need the workflow to carry on after this step and carry out other activities after this call.
    Error message:
    Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.IO.InvalidDataException:
    Unable to deserialize HTTP response content. Expected ContentType : 'application/json', 'text/plain' or 'text/html', Received ContentType : 'text/xml'. Content (truncated) : '<?xml version="1.0" ?><outbound-message-delivery messageId="35d60bd2-a829-4382-8189-7a74de2d1cca"
    isError="false"><recipient msisdn="6427xxxxxxx" isError="false"></recipient></outbound-message-delivery>'. ResponseStatusCode : 'OK' Request Uri : 'https://www.txtserviceurl.co.nz/api/3/sms/out?to=6427xxxxxxx&body=test+from+workflow'
    at Microsoft.Activities.Messaging.SendHttpRequest.OnReceiveResponse(NativeActivityContext context, Bookmark bookmark, Object value) at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context, Bookmark bookmark, Object value)
    at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager) Exception from activity SendHttpRequest HttpPost Switch<String> Sequence Microsoft.SharePoint.WorkflowServices.Activities.CallHTTPWebService
    Stage 1 Sequence Flowchart Sequence Testing 

    Hi,
    Thank you for your post.
    I'm trying to involve someone familiar with this topic to further look at this issue. There might be some time delay. Appreciate your patience.
    Best Regards,
    Lisa Chen
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact 
    [email protected]
    Lisa Chen
    TechNet Community Support

  • How to interpret ( parse / read ) the Servlet Response contents ...

    I want to parse the response content before it is displayed in the browser. I wrote a Servlet Filter to parse the request / response.
    Since there are no public API s available to get the content of response, I am not sure , how to read the response.
    Any idea ??

    Implement HttpServletResponseWrapper, override the writing methods to let them write to some reuseable/accessible buffer and access it afterwards.

  • Weblogic Portal - Disc API bug in response content type

    Hi
    While using WLP Disc APIs in the portal for AJAX calls, the response content type returned by the weblogic portal server is:
    text/x-netuix-json-comment-filtered; charset=ISO-8859-1
    This is not getting changed to 'application/json' inspite of setting this as the content type for a JSF JSP.
    Probably, looks like a bug.
    We have a JSF portlet in which we need to make an AJAX call.
    Please refer to the weblogic whitepaper for the AJAX examples (weblogic-portal-jsf-whitepaper.pdf).
    The example works fine in the dev/build environment. When the portal server is accepting calls through Sun One webserver,
    the logs from the webserver show the response content type from the portal server as "text/x-netuix-json-comment-filtered; charset=ISO-8859-1"
    - I tried changing the content type to "application/json" in the JSF JSP (as per the example from the pdf file). Still the content type does not change.
    - The response from the portal server is suffixed with "\n\r\t". Because of the trailing space/carriage return chars in the portal server response, the sun one webserver is unable to parse (or) eliminate the "\r\n\d" chars to the browser. When the browser receives a response (with the trailing chars), the module.js (weblogic wrapper API for DISC calls) fails.
    - The module.js tries to check whether the response from portal server ends with "**/" but unfortunately, the weblogic protal server returns
    "/** %json response%**/\n\r\d"
    I found a workaround to this issue by having a filter for the JSF JSP which sets the content type as "application/json" and does a flush() before it makes a call to the JSF JSP which responsds to an ajax call. This works as the content type is set and flushed first so any attempt by the portal server to set as "text/x-netuix-json-comment-filtered" does not get reflected in the http response.
    Any support/fix from oracle regarding this will be helpful as most of the webserver integration with the portal server happens during the middle of the project build and might lead to a technical risk.
    Server details: WLPS 10.3, Sun One 7.0
    Thanks
    Ananth Krishnan

    Make sure you're using the Reverse Proxy Plugin for Web Server, not the Application Server Connector (they are VERY similar, but not the same). The RPP knows how to handle 100 Continue, the Connector does not.
    Or use Web Server 7 and its built-in reverse proxy feature.

  • Response Content type for WLP Disc API calls

    Hi
    While using WLP Disc APIs in the portal for AJAX calls, the response content type returned by the weblogic portal server is:
    text/x-netuix-json-comment-filtered; charset=ISO-8859-1
    This is not getting changed to 'application/json' inspite of setting this as the content type for a JSF JSP.
    Probably, looks like a bug.
    We have a JSF portlet in which we need to make an AJAX call.
    Please refer to the weblogic whitepaper for the AJAX examples (weblogic-portal-jsf-whitepaper.pdf).
    The example works fine in the dev/build environment. When the portal server is accepting calls through Sun One webserver,
    the logs from the webserver show the response content type from the portal server as "text/x-netuix-json-comment-filtered; charset=ISO-8859-1"
    - I tried changing the content type to "application/json" in the JSF JSP (as per the example from the pdf file). Still the content type does not change.
    - The response from the portal server is suffixed with "\n\r\t". Because of the trailing space/carriage return chars in the portal server response, the sun one webserver is unable to parse (or) eliminate the "\r\n\d" chars to the browser. When the browser receives a response (with the trailing chars), the module.js (weblogic wrapper API for DISC calls) fails.
    - The module.js tries to check whether the response from portal server ends with "**/" but unfortunately, the weblogic protal server returns
    "/** %json response%**/\n\r\d"
    I found a workaround to this issue by having a filter for the JSF JSP which sets the content type as "application/json" and does a flush() before it makes a call to the JSF JSF which responsds to an ajax call. This works as the content type is set and flushed first so any attempt by the portal server to set as "text/x-netuix-json-comment-filtered" does not get reflected in the http response.
    Any support/fix from oracle regarding this will be helpful as most of the webserver integration with the portal server happens during the middle of the project build and might lead to a technical risk.
    Server details: WLPS 10.3, Sun One 7.0
    Thanks
    Ananth Krishnan

    The problem as you can see is only related to the URL because the webservice is not expecting the URL. Have you changed the wsdl also for the new scenario? The URL can be rechecked to the one present in the wsdl at bottom of it.
    Regards,
    Prateek

  • HTTP request/response object not thread safe.

    According to the serlvet spec. Http Request/Response
    are not thread safe. Quoting from the Spec:
    " Implementations of the request and response objects are not guaranteed to be thread safe. This means that they should only be used within the scope of the request handling thread. References to the request and response objects must not be given to objects executing in other threads as the resulting behavior may be nondeterministic."
    This has prompt me to ask the following question.
    For Example I have a servlet which does the following
    request.setAttribute("myVar","Hello");
    The request and response is dispatched(using RequestDispatch.include(request,response)) to another
    servlet which retrieve this attribute i.e request.getAttribute("myVar");
    Is this safe?
    The Spec only said "The Container Provider must ensure that the dispatch of the request to a target
    servlet occurs in the same thread of the same VM as the original request." I take this meaning that the targeting servlet does not have to run in the same thread(only dispatch), otherwise it would be safe.

    To put it another way, you can only have onle thing working on a request at a time. For instance, the ServletContext is available to all servlets running on a server. If you tried to save a particular request to the ServletContext, it would potentially be available to many concurrently running servlets. They could all change whatever in it at the same time. Each servlet is in its own running thread. Hope that helps some.

Maybe you are looking for