Testing a service that returns an AsyncToken

I have a working test that tests a service that returns an AsyncToken. I am using AsyncResponder instead of any of the Aysnc Flexunit stuff. Is this OK?
One thing I don't get is that the passthroughData get passed to the onResult method, even though AsyncResponder doesn't pass on anything other than the event.
    [Test(async)]
        public function testAttemptLogin():void
      var token: AsyncToken = objectToTest.attemptLogin('k');
     token.addResponder(new AsyncResponder(onResult, faultHandler));
        private function onResult(event:ResultEvent,passthroughData:Object):void {
//assertions

No. This will not work.
FlexUnit has a Async.asyncResponder
method that will do what you want
Mike

Similar Messages

  • Invoking a web service that returns binary

    Hi,
    Is it possible to invoke a web service that returns a binary object?
    Its similar the following example but I need to return a binary object :
    declare
    v_url:='http://www.somesite.com/function_name?invoke=placeOrder&par1=val1'
    v_output varchar2(4000);
    begin
    select utl_http.request(v_url)
    into v_output from dual;
    end;
    Thanks in advance

    No "advantage" as there are two very different tools.
    UTL_HTTP is basically an Oracle PL/SQL web browser. It uses the HTTP application protocol. It is just like your ordinary browser (IE, Firefox, Opera), but as it is server-side and display-less, it comes without a rendering engine.
    UTL_DBWS is to interact with web services using the SOAP application protocol.

  • BPEL build error when invoke an extrenal Web Service that returns an Array

    Hello,
    I built with JDeveloper a web service that returns an Array of Java Bean classes and I try to invoke this web service from a BPEL process. The wsdl file is automatically generated by the JDev. When I built the BPEl project I obtained the following error:
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAP-ENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'.
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAPENC:Array'. It was detected that 'SOAPENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/Top300FactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAPENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/Top300FactoryWS?WSDL'.
    [bpelc] [Error] :-1:-1: src-resolve.4.2: Error resolving component 'SOAP-ENC:Array'. It was detected that 'SOAP-ENC:Array' is in namespace 'http://schemas.xmlsoap.org/soap/encoding/', but components from this namespace are not referenceable from schema document 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'. If this is the incorrect namespace, perhaps the prefix of 'SOAP-ENC:Array' needs to be changed. If this is the correct namespace, then an appropriate 'import' tag should be added to 'http://malangiu-ro:8988/cde-Project-context-root/CdeFactoryWS?WSDL'.
    Any hint? Thanks in advance!
    Regards,
    Marinel

    Hi,
    BPEL and BPEL PM do not have a good support for SOAPENC-Array: it would be very difficult to create such an array in BPEL or to receive it and manipulate it.
    The (unfortunately very intrusive) work around is to change the WSDL of the service to use a XML type defined using XML schema. This is all the more painful that JDev 9.0.4 does not have strong support for complex types.
    In general though, I would highly recommend this best practice:
    1) Start by define the WSDL contract first
    2) Then generate the server side skeleton to implement it
    3) Use BPEL as the client to this contract.
    By starting with the contract first, you make sure that 1) your interfaces are clean and coarse grained.
    2) things like java objects, sessions, etc to not leak through the interface (which would be the worst thing that could happen because it would closely link the client and the server.
    Sorry for not being more helpful. This will get radically cleaner in Oracle AS 10.1.3.
    Edwin

  • Problem with web service that returns an object with a String that have som

    Hi everybody:
    I have a problem with a web service I am doing, I have made a web service that returns a collection of objects, the objects have a set of properties, there is one property that is a String,this property consists in a text fragment that could have some characters that are considered special in XML like &, <, >, " and that's why when I execute the service from a client an exception is thrown:
    {code}
    Exception in thread "main" org.codehaus.xfire.XFireRuntimeException: Could not invoke service.. Nested exception is org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    org.codehaus.xfire.fault.XFireFault: Could not read XML stream.. Nested exception is com.ctc.wstx.exc.WstxParsingException: Expected a text token, got START_ELEMENT.
    at [row,col {unknown-source}]: [9,646]
    at org.codehaus.xfire.fault.XFireFault.createFault(XFireFault.java:89)
    at org.codehaus.xfire.client.Client.onReceive(Client.java:410)
    at org.codehaus.xfire.transport.http.HttpChannel.sendViaClient(HttpChannel.java:139)
    at org.codehaus.xfire.transport.http.HttpChannel.send(HttpChannel.java:48)
    at org.codehaus.xfire.handler.OutMessageSender.invoke(OutMessageSender.java:26)
    at org.codehaus.xfire.handler.HandlerPipeline.invoke(HandlerPipeline.java:131)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:79)
    at org.codehaus.xfire.client.Invocation.invoke(Invocation.java:114)
    at org.codehaus.xfire.client.Client.invoke(Client.java:336)
    at org.codehaus.xfire.client.XFireProxy.handleRequest(XFireProxy.java:77)
    at org.codehaus.xfire.client.XFireProxy.invoke(XFireProxy.java:57)
    at $Proxy0.search(Unknown Source)
    at cu.co.cenatav.webservices.client.Client.main(Client.java:26)
    {code}
    I know that this is happening because special characters are sent by the soap message but I don't know how to solve this problem.
    How could I avoid this exception ?
    I hope you can help me.
    Regards.
    Ariel

    Hi,
    BPEL and BPEL PM do not have a good support for SOAPENC-Array: it would be very difficult to create such an array in BPEL or to receive it and manipulate it.
    The (unfortunately very intrusive) work around is to change the WSDL of the service to use a XML type defined using XML schema. This is all the more painful that JDev 9.0.4 does not have strong support for complex types.
    In general though, I would highly recommend this best practice:
    1) Start by define the WSDL contract first
    2) Then generate the server side skeleton to implement it
    3) Use BPEL as the client to this contract.
    By starting with the contract first, you make sure that 1) your interfaces are clean and coarse grained.
    2) things like java objects, sessions, etc to not leak through the interface (which would be the worst thing that could happen because it would closely link the client and the server.
    Sorry for not being more helpful. This will get radically cleaner in Oracle AS 10.1.3.
    Edwin

  • Can Adobe Interactive PDF consume a service that returns JSON?

    Can Adobe Interactive PDF consume a service that returns JSON? A few web sites seem to suggest it can:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=functions_c-d_43.html
    http://blogs.adobe.com/acdc/2008/08/using_json_to_exchange_data_wi.html

    Its probably better to post this in the Form or Designer forum as those ones deal more with the capabilities of XFA based PDFs.  The Generator forum deals with the server software that converts documents to PDF.
    Having said that.
        You should be able to do it, but not directly. I don't believe that there is a way to map the JSON returned values to a field, as XFA pdf's generally support XML.  You may be able to put the returned JSON value into a single field and then write some code that would parse that value into the proper fields.

  • OSB: Retrieve non XML Payload from a service that returns status code 500

    Hello,
    I'm using OSB 11g.
    I have a Business Service that invokes a REST based service (AnyXML). The service I'm calling may return a 500 status code and some JSON-encoded information in the response body containing the remote service error information.
    From a Proxy Service, I invoke the Biz Service using a standard Service Call Out. The Call Out works fine if the service doesn't return any error (status code 200).
    The problem starts when the service returns a 500 status error: it seems that there is no way to to get hold of the error information (string) that are in the response body. The $fault variable contains some info, but not the actual payload.
    I have also tried to "resume" the flow (using a resume action) but no luck.
    Is there a way to retrieve a NON-XML payload of a service even if the service returns a 500 status code?
    Thanks
    Luciano

    Hi,
    I have same problem, any idea?
    I created several Proxy Services between SOA (BPEL) and JDE. Proxy Service works correct, but if interface response has an error (fault) from JDE side, we get high level error message from OSB and we lost error information from endpoints. I want to get following error information from response body, which containing the remote service error information.
    e.g. <SOAP-ENV:Fault>:
    <SOAP-ENV:Body>
    <SOAP-ENV:Fault>
    <faultcode>SOAP-ENV:Client</faultcode>
    <faultstring>[ISS.0088.9134] Exception occurred while processing the body of the message</faultstring>
    <faultactor>http://HOST/soap/default</faultactor>
    <detail xmlns:webM="http://www.webMethods.com/2001/10/soap/encoding">
    <webM:exception> </webM:exception>
    </detail>
    </SOAP-ENV:Fault>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    Until now, I solved errorhandling for Proxy Service with single route node, but if I use Proxy Service for “Failover” and OSB connect to Endpoint 2, BPEL-instances with "fault" state get OSB error message and WSG-Response will be lost from $body of messages.--> error-propagation to client is NOT OK.
    Regards,
    Moh

  • Testing a SP that returns a CURSOR

    I'm using Oracle 11 and trying to use SQL Developer. However, I cannot seem to get the DEBUG to work to test calling a SP that returns a Cursor.
    I wrote a small test program to test, but it won't compile and I'm not sure why not. Can you assist?
    the first code fragment is a package I have that has a CURTYPE defined. It is used throughout my application when declaring a cursor:
    create or replace
    PACKAGE          "SP_STATE"
    Is
        type     curtype is ref cursor;
    ...now, here is the first part of the SP that I want to test. note that I defined PriceCur as using the package CURTYPE.
    create or replace
    PROCEDURE          "USP_GETL_ACCOUNT_PRICES" (
      AcctNo          in     marketer_account.mka_last_full_css_acct_no%type,
      MktrNo          in     marketer_account.mka_mktr_no%type,
      Status                     in              varchar2 default null,     
      PriceCur          out            sp_state.curtype
    as
    begin
    Open Pricecur For
    Select
    ...Now here is my test procedure:
    Declare
       Price_Cur  Sp_State.Curtype;
       price_rec  price_cur%rowtype;
    Begin
       Usp_Getl_Account_Prices('302189139000026', 11813,'A', price_cur);
       Open Price_Cur;
       Loop
          Fetch Price_Cur Into Price_Rec;
          Exit When Price_Cur%Notfound;
          dbms_output.put_line(price_cur%rowcount || ') ' || price_rec.apr_account_price_id);
       End Loop;
       close price_cur;
    end;It won't compile. All I'm trying to do here is call the SP - pass in the 3 inbound parameters and get back a cursor,
    then I want to loop through the cursor and list out certain fields....
    Where am I going wrong? Any help would be greatly appreciated.
    Sean

    userLynx wrote:
    I had to change my SP to return 4 or 5 columns (before it was returning about 12) just so that I can see if the procedure works.
    I ended up doing this:
    set serveroutput on;
    declare
    V_Rc Sys_Refcursor;
    priceID integer;
    AcctId number;
    Mktrno Number;
    Accountnumber Varchar2(15);
    Errcd Number;
    descrip varchar2(150);
    Begin
    USP_GETL_ACCOUNT_PRICES1('313747128500038', 11536, 'R', v_rc);
    Loop
    fetch v_rc into priceID, acctId, MktrNo, accountNumber, errcd, descrip;
    Exit When V_Rc%Notfound;
    dbms_output.put_line(priceID || ',' || acctId || ','  || MktrNo || ',' || accountNumber || ',' || Errcd || ',' || descrip);
    end loop;
    end;I was able to get data back.
    It just seems odd that I cannot use the cursor directly or FETCH into a RECORD (cur%rowType)You probably can use a record that looks something like (untested)
      type rec_type is record(
       priceID integer,
       AcctId number,
       Mktrno Number,
       Accountnumber Varchar2(15),
       Errcd Number,
       descrip varchar2(150),
      rec rec_type;
      fetch ... into rec;Notice I made the record look exactly like the list of variables you defined and selected into. If not, you still have use of the variables

  • Web Service That Return A Table

    Hello,
    Does Someone Know A WebService Witch Return Or Have A Parameter That Is A Table
    Thank You For Your Answers

    Hello,
    Maybe this links will give you a hint.
    /people/thomas.jung3/blog/2005/01/05/develop-a-web-service-that-sends-an-email--in-abap
    http://help.sap.com/saphelp_nw04/helpdata/en/e9/ae1b9a5d2cef4ea4b579f19d902871/content.htm
    Bye
    Gabriel P.-

  • Test web service published returns Error code: InternalError, Http status code: 500

    Further invastigating ther error mentioned here: 
    https://social.msdn.microsoft.com/Forums/azure/en-US/14afa50f-287d-4158-852a-c9532f9f30eb/test-published-web-service-experiment-error-with-status-code-400?forum=MachineLearning
    I have made an even simpler experiment with two python scirpt modules. The experiment again runs fine in Azure ML Studio but fails in the web service test with the error
    Error code: InternalError, Http status code: 500, Request id: 53eef674-190a-4f63-bdc6-a072a45a9c72, Timestamp: Fri, 24 Apr 2015 09:30:37 GMT
    The experiment consists only of two python script modules. The code of the first module:
    import numpy as np
    import pandas as pd
    def azureml_main(dataframe1 = None, dataframe2 = None):
        dataframe1.loc[1] = ["U5000","resB",np.nan]
        dataframe1.loc[2] = ["U5000","resC",2]
        dataframe1.loc[3] = ["U5000","resD",2]
        dataframe1.loc[4] = ["U5000","resE",np.nan]
        dataframe1.loc[5] = ["U6000","resA",np.nan]
        dataframe1.loc[6] = ["U6000","resB",1]
        dataframe1.loc[7] = ["U6000","resC",2]
        dataframe1.loc[8] = ["U6000","resD",np.nan]
        dataframe1.loc[9] = ["U6000","resE",1]
        dataframe1['hasRated'] = pd.Series(1, index=dataframe1.index).astype(bool)
        df_new = pd.DataFrame()
        df_new = pd.DataFrame(dataframe1[["restaurant","rating","hasRated"]])
        return df_new,
    The code of the second module that takes as input the result of the first module:
    def azureml_main(dataframe1 = None, dataframe2 = None):
    return dataframe1,
    A url of a screenshot taken from the experiment.
    http://i.imgur.com/4nrbneA.png
    Please respond. Again I am using a free workspace of Azure ML Studio.
    Thank you very much

    Thank you for your quick reply.
    I hope you will be able to resolve this issue soon.
    asavvopoulos

  • Testing Async service that uses callbacks, not Events

    Hello All,
    I am curios how others are writing Async tests on a service layer where events are not used?
    Ex: calling into a service object - sending a callback method (closure)
    private function buyItem(id:String, callback:Function
    DataManager.getInstance().purchaseItem(id, callback);
    private function callback(success:Boolean, data:Object):void
         // Do stuff
    TestBuyItem.as
    [Test (order=1, async, timeout="60000")]
    public function testBuyItem():void
         Async.asyncHandler(this, callback, 20000, null, null);
         DataManager.getInstance().purchaseItem("myitemid", callback);
    private function callback(success:Boolean, data:Object
         // This method gets called and success does equal true - however my test fails
         Assert.assertTrue(success);
    What am I doing wrong? 
    What type of method does the 'callback' need to be?
    Is there an Async.waitForCallbackFunctionCall()
    I am sure I am doing something wrong, I am just not sure what - thanks for any help you can offer.
    --jason

    Jason,
    Async.asyncHandler(... returns a function. This is your callback. Store a reference to it, and when you receive the result in your callback, execute the function that was returned from Async.asyncHandler.
    The asyncHandler signature is "handler(event:Event, passThroughData:Object):void". Just create a dummy event that wraps the data from your callback and invoke the handler.
    Hope this helps,
    Russ

  • A web service that returns a xml file and gets another xml file as input?

    Hi,
    I want to create a web service which gets an xml document as input then returns again an xml document.How can I create this kind of web service?
    Is this kind of implementation is possible?
    public Document mywebservice(Document input){
    Document d;
    return d;
    or do I have to use serialization processes which I don't know very much.
    I am waiting for your help.Thank you...

    If you want to deal directly with the Document and not want the SOAP engine to serialize/deserialize the XML into Java objects, then you can easliy implement this using Axis. Look at the Axis documentation (http://ws.apache.org/axis/java/user-guide.html#ServiceStylesRPCDocumentWrappedAndMessage) under the heading "Message Services". One of the provided API methods that Axis provides is in the form you want: public Document method(Document body). Hope that helps. As for how to implement the service using Axis, that is beyond the scope of this forum. Check the Axis docs for more help on that.

  • Calling A Web Service That Returns A PDF

    I'm looking at building a new browser based Flex application
    One of the web services I'll be calling returns a PDF as a octet-stream in the XML
    I would like that PDF to open in a new browser window.
    Has anyone seen anything like this done with Flex?
    If so, could you point be to any examples or reference docs that may help me to figure out how.
    Thanks
    Mathias

    I'm looking at building a new browser based Flex application
    One of the web services I'll be calling returns a PDF as a octet-stream in the XML
    I would like that PDF to open in a new browser window.
    Has anyone seen anything like this done with Flex?
    If so, could you point be to any examples or reference docs that may help me to figure out how.
    Thanks
    Mathias

  • Writing a web service that returns a table

    Hello Experts,
    I'm a bit new to J2EE programing and will appreciate your help.
    The main question is:
    What is the best way to return a table from a web service?
    In details:
    I wrote an EJB calling an RFC.
    The RFC returns a table.
    I've created a web service from this EJB and need to return the above table as an output parameter.
    What is the best way of passing the JCO.Table as an output parameter?
    Should I pass it as an Object (and the client will take care of the casting)
    or - is there a simple type I should convert the table to before passing it?
    Thanks for your help, Adi.

    Hi Adi,
    The way I always return a JCO table in my Webservice Interface is returning an Interface.
    Say you JCO table is a Person with different attributes in it.
    Then I create an Interface IPerson with methods like
    public abstract String getName(); etc.
    I also create an object Person with methods:
    public String getName() {
    return name;
    In my bean the I have a method:
    public IPerson getJCOPerson() {
    //retrieve the JCO table person
    IPerson pers = new Person();
    pers.setName(//name from JCO table);
    etc.
    return pers;
    I hope this helps you further.

  • How to handle HTTPS Service that returns XML

    When using Flash + AMF remoting I've always typecast the event.result as XML(event.result).  Typecasting isn't working in Flash Builder, I'm getting an object as the result [object MYXMLROOT] and I can access it's properties, but I can't typecast it as XML, nor can I loop each of it's properties....

    Hi,
    There are ways to use XML returned by Http Service in  flex. Is this what you are looking to achieve?
    http://blog.flexexamples.com/2008/03/29/dynamically-loading-xml-files-using-the-httpservic e-tag/
    The DCD features of Flash Builder 4 can also be used to access the XML as Services.
    Nishad

  • Consume a web service from JME that returns an image

    Hi,
    I have a web service that returns an image in base64binary format, but when i use the wscompile tool to generate the stub i get an error becuase seems that JME does not support base64binary -> byte[] convert. My question is: How can i return an image from web service to consume from JME?.
    Thanks in advance.
    Bruno

    I tried this and works fine, but i see this like a workaround instead of a solution. Do you know why JME doesn't support this type of data? I think that is weird because i don't see a limitation on JME for use it.
    Thanks for repsonse.

Maybe you are looking for

  • Home Media (MR) Feature No Longer Required for Remote DVR Support

    I just found out that, effective today (or maybe yesterday) you can now activate Remove DVR programming capability through the FiOS TV Central website without have the multi-room feature. I do not have the multi-room support on my DVR and just logged

  • Spry good in DW but same error all browsers

    When I set up this index.html page following a tutorial, it worked great in DW.  I have 4 pages, all menus performed perfectly in live view, also in browser icon view.  I also put all pages through the browser compatibility check, and no errors came

  • How to best output Shake files to FCP so that FCP likes them

    Hi, I think this post might be better suited for the Shake Subsection. I have a totally tricked out 8 core Mac pro with 8 GB ram and a 1 TB drive (mostly empty). I'm using the Latest FCP. Recently, I've been editing some HD video that I've shot and h

  • XmlHttpRequest AJAX not returning message from COMET server

    I have the following COMET client javascript code: function getResponse() { document.getElementById("_receivedMsgLabel").innerHTML += "getResponse() called.<br/>"; if (receiveReq.readyState == 4 || receiveReq.readyState == 0) { receiveReq.open("GET",

  • Lighting Effect Won't Render

    I'm using Photoshop CS6 and trying to render a simple lighting effect. I successfully rendered the effect in a smaller document (5.5x8.5 in), but the effect doesn't show at all when I drag the layer into a new, larger document (24x78 in). I tried ren