Variable URL in data service

I'm new to Flex and trying to create a proof of concept Air App.  I have it connecting to an http service to retrieve data but I want the URL to be configurable.  I created a preferences page which is working, but I can't seem to load the URL preference into a variable for the http service.  Below is my code:
<fx:Script>
        <![CDATA[
            import mx.controls.Alert;
            import mx.events.FlexEvent;
            import services.exadatademo.newUrl;
            //public var testDbUrl:String = "http://localhost/pls/apex/";
            public var testDbUrl:String;
            private function init():void
                var storedDatabaseUrl:ByteArray = EncryptedLocalStore.getItem("DatabaseUrl");
                testDbUrl = storedDatabaseUrl.readUTFBytes(storedDatabaseUrl.length);
                services.exadatademo.newUrl = 'bar';
                trace(testDbUrl);
            protected function getPrefs():void
                var storedDatabaseUrl:ByteArray = EncryptedLocalStore.getItem("DatabaseUrl");
                dbUrlTxt.text = storedDatabaseUrl.readUTFBytes(storedDatabaseUrl.length);
                testDbUrl = dbUrlTxt.text;
                var storedDatabaseUserName:ByteArray = EncryptedLocalStore.getItem("DatabaseUserName");
                dbUsernameTxt.text = storedDatabaseUserName.readUTFBytes(storedDatabaseUserName.length);
                var storedDatabasePassword:ByteArray = EncryptedLocalStore.getItem("DatabasePassword");
                dbPasswdTxt.text = storedDatabasePassword.readUTFBytes(storedDatabasePassword.length);
            private function savePrefs():void
                var bytes:ByteArray = new ByteArray();
                //write string text as UTF8 bytes
                bytes.writeUTFBytes(dbUrlTxt.text);
                EncryptedLocalStore.setItem("DatabaseUrl", bytes);
                bytes = new ByteArray();
                bytes.writeUTFBytes(dbUsernameTxt.text);
                EncryptedLocalStore.setItem("DatabaseUserName", bytes);
                bytes = new ByteArray();
                bytes.writeUTFBytes(dbPasswdTxt.text);
                EncryptedLocalStore.setItem("DatabasePassword", bytes);
            protected function button1_clickHandler(event:MouseEvent):void
                trace('foo');
                savePrefs();
                currentState = "Main";
            protected function linkbutton1_clickHandler(event:MouseEvent):void
                currentState = "Preferences";
                getPrefs();
            protected function InterconnectTraffic_creationCompleteHandler(event:FlexEvent):void
                //GetEmployeesResult.token = exadataDemo.GetEmployees();
            protected function button2_clickHandler(event:MouseEvent):void
                // TODO Auto-generated method stub
                GetEmployeesResult.token = exadataDemo.GetEmployees();
        ]]>
    </fx:Script>
package services.exadatademo
    import mx.core.FlexGlobals;
    public var newUrl:String = null;
public class ExadataDemo extends _Super_ExadataDemo
    public function ExadataDemo():void
        super();
        trace(newUrl+'hello');
        trace(FlexGlobals.topLevelApplication['testDbUrl']);
        _serviceControl.baseURL = FlexGlobals.topLevelApplication['testDbUrl'];
Thanks,
Tyler

I tried something similar quite some time ago, spend a lot of
time on this task, but never got to a real solution.
As far as I remember there was no way to do it in with shared
libraries that do have different urls.
There might be a workaround to build a php/asp/jsp script
that pipes through the content of a configured shared lib to flash,
pretending it would be the requested shared lib.

Similar Messages

  • Cannot add parameter or header to post request URL in Data/Services

    I'm trying to set up Data/Services in flash builder to connect to a RESTful API and as per usual Flash Builder attempts to scupper my efforts with it 'nearly but not quite' tools at every turn.
    So I need to pass a POST request with a JSON string containing auth details to the URL:
    https://myrestservice.com/rest/session/
    For authentication to work I also need to add either:
    A: an additional header containing: api_key = *my-api-key*
    or
    B: append the api key to the URL so: https://myrestservice.com/rest/session/?api_key=*my-api-key*
    Simple right? Wrong. In the data/services tool for a custom http service there seems to be no way to add a custom header. Ok annoying as even a free chrome plugin can do this but hey I can live with that, I'll use option B. Wrong again. The URL field in Data/Services will ignore the query on the end of the URL. Seriously WTF. Am I missing something here?
    So if I amend the auto-generated code in the super class and call it directly it works but if I try to take advantage of any of the tools the code is regenerated and overwrites my changes. Test Operation never works either.
    I know there is a second class which is supposed to be used to extended and override the super class but only certain overrides seem to work so for example:
    This works:
    ._serviceControl.baseurl = ("https://someotherurl.com")
    This doesn't work:
    ._serviceControl.headers = ({"api_key = *my-api-key*"})
    Oh and Test operation only seems to execute the super class. Once again a brick wall.
    Working with flash builder seems to be 50pc coding 50pc deciding if it's a bug in your code or flash builder f*****g you over.
    Any thoughts, workarounds, am I missing something would be much appreciated.
    Thanks

    Shameless bump here!
    So nobody has had this issue before?

  • Making the URL of an HTTP data service call the same domain it is served from

    Hi All,
    I've got an HTTP service I defined in Flash Builder, via the "Data Services" tab.  I've got an absolute URL in there right now.  Here's what it looks like:
    What I really want is to not define a path that includes a domain name at all--I want the service to simply call an absolute path that's on the same domain as whatever domain the SWF was served from... can I do that?  When I got rid of the base URL and then gave an absolute URL path (e.g., /roster/deleteMember), Flex Builder complained that "File does not exist."  Well, of course it doesn't exist, it isn't a file, it's a URL to a service call--there is no corresponding file on the filesystem.
    Can anyone advise me how to do that?  Changing the domain name has at least once caused me a great deal of trouble, and the only workaround I was able to figure out was to create a whole new project and copy/paste all the code from my previous project into that new project, and recreate the data service definitions.  Big headache!

    mmh,
    from the adobe documentation:
    The configuration files sometimes contain special {server.name} and {server.port} tokens. These tokens are replaced with server name and port values based on the URL from which the SWF file is served when it is accessed through a web browser from a web server. Similarly, a special {context.root} token is replaced with the actual context root of a web application.
    Whenever is a RemoteService, HttpService or WebService... if you specify the endpoint as http://{server.name}:{server.port}/{context.root}
    automatically on runtime, the variables are set by the flashplayer depending on where you've been downloaded the application. So, if the webservices are deployed on the same server where the flex application is downloaded, this is the solution.
    But in your case,  maybe you cannot do that through the plugin you are using for declaring your services, but have to programmatically solve it.
    Bye,
    Lionel

  • Data services with SQL Server 2008 and Invalid time format variable

    Hi all
    Recently we have switched from DI on SQL Server 2005, to DS(Date Services) on SQL Server 2008. However I have faced an odd error on the query that I was running successfully in DI.
    I validate my query output using a validation object to fill either Target table (if it passes), or the Target_Fail table (if it fails). Before sending data to the Target_Fail table, I map the columns using a query to the Target_Fail table. As I have a column called 'ETL_Load_Date' in that table, which I should fill it with a global variable called 'Load_Date'. I have set this global variable in the script at the very first beginning of the job. It is a data variable type:
    $Load_Date = to_char(sysdate(),'YYYY.MM.DD');
    When I assign this global variable to a datetime data type cloumn in my table and run the job using Data Services, I get this error:
    error message for operation <SQLExecute>: <[Microsoft][ODBC SQL Server Driver]Invalid time format>.
    However I didn't have this problem when I was running my job on the SQL Server 2005 using Data Integrator. The strange thing is that, when I debug this job, it runs completely successfully!!
    Could you please help me to fix this problem?
    Thanks for your help in advance.

    Thanks for your reply.
    The ETL_Date is a datetime column and the global variable is date data type. I have to use the to_char() function to be able to get just the date part of the current system datetime. Earlier I had tried date_part function but it returns int, which didn't work for me.
    I found what the issue was. I don't know why there were some little squares next to the name of the global variable which I had mapped to the ETL_Date in the query object!!! The format and everything was OK, as I had the same mapping in other tables that had worked successfully.
    When I deleted the column in the query object and added it again, my problem solved.

  • Using variables within the definition of ExcelWorkbook in the Data Services 4.2

    Hi Together
    We have installed the Datas Services 4.2 with a matching SAP BO 4.1 Installation
    The Repositories are hosted on a MS SQL Server 2012R2.
    The System is a Windows 2012 R2 Server
    Within a Repository I try to define an ExcelWorkbook.
    Within this Definition I need a
    Format name,
    the Directory where the Excelfile is in the File System,
    the name from the ExcelFile.
    To define the Access method I will use the Namend Range.
    Is it possible to use for the Namend Range a defined variable with a namend Range.
    I’ve tried a lot notations, but I am not able to use that Variable.
    What is a possible Solution ?
    Regards
    Ralph

    Hello Friend,
    You indicate to go to the Central Management Console (http://server/BOE/CMC), click the Data Services option.
    Select the Configure a new Data Services Repository, complete all fields and click Test Connection. If everything is ok and return success message, click save.
    The repository created will appear in your repositories list, then right click it and select the User Security option. Make sure that the Data Services Administrator Users group is present and with Full Control access. To ensure that your user has access, you can also add it through the Add Principals option. Select the desired user, pass to the other side and click the Add option and Assign Security and include Full Control permission and apply.
    In version 4.2 the ability to create access groups within the Central Repository was added.
    To create and manage such groups need access SAP Data Services Management Console:
    http://server/DataServices/launch/launch.do
    Once you have successfully logged on, click the Administrator button.
    On the left side there are some options, espanda the Central Repositories option and if you have properly created the Central Repository it will appear in the list.
    Click User and Groups note that by default comes a set created (digroup), select the User tab and click the option later add.
    Then enter the information which user, group, status and description and apply the changes.
    Made these procedures you can enable your central repository through the DS Designer and create new groups.
    Hope this helps.
    Hugs

  • What format to input $currentdate(datetime) Global Variable in Data Services Management Console?

    What is the correct input format for the datetime Global Variable in Data Services Management Console? 
    I've tried several formats and keep getting a syntax error. 
    The DSMC is Version: 14.0.3.451
    I'm a new user and learning as I go.  
    Thanks for your help. 

    Hi,
    if you get syntax error as below,
      Syntax error at line <1>: <>: near <.04> found <a float> expecting <+, ||, DIVIDE, MOD, *, SUBVARIABLE, a decimal>.
      1 error(s), 0 warning(s).
      Check and fix the syntax and retry the operation.
      Error parsing global variable values from the command line: <$sedate=2014.12.04 12:00:00;>.
    Check the syntax and try again.
    solution is simple
    Place the global variable value in single quotes '2014.12.04 12:00:00'

  • Change source path in batch Job in global variable in data services

    Hi Experts,
    my organization has created job in data services 3.2 to cleanse the data reading from excel flat files. the folder path was store in the global variable(I think) and now they have changed the directories hence is it throwing me below error.
    Error, Input file  does not exist please confirm existence and restart job, 16 ) >
    failed, due to error <50316>: <>>> Error, Input file  does not exist please confirm existence and restart job>. I want to update the folder path. I am sure it would be easy but I am very new to BODS.
    (12.2) 07-15-14 16:10:08 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> Sleeping for 35.000000 seconds...  '
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> Waking up......  '
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : 'Starting the timer loop number 6...'
    (12.2) 07-15-14 16:10:43 (14232:12656) WORKFLOW: Work flow <WF_Metadata_Files> is started.
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> $G_FILENAME_IN : ALL_Metadata_SALES.xls...'
    (12.2) 07-15-14 16:10:43 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>> looking for input file name
                                                     \\infra\finance\production\sales\Metadata\ALL_Metadata_SALES.xls'
    (12.2) 07-15-14 16:11:08 (14232:12656)  PRINTFN: > 'JOB DEBUG' : '>>>  Input file Name is '
    (12.2) 07-15-14 16:11:08 (14232:12656)  PRINTFN: > 'JOB ERROR' : '>>> Error, Input file  does not exist please confirm existence and restart job'
    I want to update the folder path\\infra\finance\production\sales\Metadata\ALL_Metadata_SALES.xls to \\Home\BIData\finance\production\sales\Metadata\ALL_Metadata_SALES.xls
    when i investigated WF_Metadata_files i saw there is a global called INPUT_DIR i assume I have to change the path there. I tried to find old directory in the batch job but i cant find it and even When i give value to global variable it is still pointing to old path.
    Can anybody please help me.
    Thanks
    Tim

    Hi Tim,
    If having specified the value in the global variable it is still pointing to the old path there can be a couple of scenarios applicable
    1. There is a different global varaiable being used for the file path
    2. The filepath is hardcoded in the file-format or Excel file definition despite the declaration of the global variable.
    Are you getting this error when running a dataflow within this workflow or in a script? It will be better to run the workflow in debug mode and look through the stages to find out where exactly in the workflow it fails.
    kind regards
    Raghu

  • Variable input help-Not able to see-Specify Data Service Runtime Parameters

    Hi Team,
    i am doing R&D on input help for Variables in SAP NetWeaver Visual Composer.
    The issue i am facing is :
    After selecting Master data table for Get data from, in select data service window.
    It is not taking me to Specify Data Service Runtime Parameters screen.
    I am getting finish option even before i do this setting
    Is there a place where i can actualy do this input output selection.
    Please Help me.
    I have gone through the docs & blogs in sdn so please don't give links of the same.
    Thanks in advance.
    Regards,
    Raghu
    Edited by: Raghu tej harish reddy on Sep 16, 2008 12:50 PM

    Hi,
    this is due to the Chcek Box : Hide advanced configuration options (BI systems only)
    Configure the advanced options on the Specify Data Service Runtime Parameters screen (optional for BI systems u2013 this screen appears only if you have deselected the Hide advanced configuration options (BI systems only) checkbox on the Add Value Help for Select Input Field screen)
    Check below link
    http://help.sap.com/saphelp_nw04s/helpdata/en/b5/036d391f074f769e00602634ee9960/frameset.htm
    Govindu

  • Unable to create records in database using PHP Data Service

    Hello, I've been stuck on this for a few days and search up and down for this on the net, no response I've found has worked, so I come to you...
    Here are the steps I've taken, I think it's pretty standard
    1. I have a macbook pro running osx 10.7.3
    2. I installed MAMP all default (I've acually reinstalled this because someone suggested this might fix it)
    3. Thru phpMyAdmin I created a database called my_test
    4. In that database I created a table, this is the export of that table: (I've also tried this with InnoDB which is the default)
    CREATE TABLE `customer` (
      `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
      `name` varchar(50) NOT NULL,
      `email` varchar(150) NOT NULL,
      PRIMARY KEY (`id`),
      UNIQUE KEY `id` (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
    5. I created a new Flx Project (Running Flash Builder 4.5.1 Premium)
         Project Name: PHPTest
         Application Type: Desktop (Although I've done the same thing with Web and got the same results)
         >> Next
         Application Server Type: PHP
         Web Root: /Applications/MAMP/htdocs/
         URL Root: http://localhost:8888/
         Clicked 'Validate Configuration' and that worked
         Output Folder: /Applications/MAMP/htdocs/PHPService (default by Flash Builder)
         >> Finished
    6. On the Data/Services tab on the bottom I click 'Connect to Data/Service...'
         Select 'PHP'
         >> Next
         Select 'Click here to generate a sample'
         Select 'Generate from database' radio button
         Username: root
         Password: root (default for MAMP)
         Host name: localhost
         Server port: 8889 (default for MAMP MySQL port, the HTTP port default is 8888 which in both cases seem to work but every video I've seen that uses MAMP on youtube uses 8889)
         Database: my_test
         Click 'Test Connection' (works)
         Table: customer
         Primary Key: id (this field is greyed out and Flash Builder selects 'id' which it figures out from the SQL table)
         >> Click OK
    7. Then if I don't have the Zend Framework folder in my /Applications/MAMP/htdocs/ folder it tells me its going to create that and I say alright. Then Flash Builder says stuff about how this is really only for testing and not production server ready and I say alright.
    8. Then it takes me back to the Form from Step 6 when I get the chance to select 'Click here to generate a sample'
         These fields are now filled with this data automaticly:
         PHP Class: /Applications/MAMP/htdocs/PHPTest/services/CustomerService.php
         Service name: CustomerService
         Service package: services.customerservice
         Data type package: valueObjects
         >> Click Next (shows all the functions that will be now availible)
         >> Click Finished (End of the forms and it opens Dreamweaver to the php file it created CustomerService.php which I have no need to edit so I close that down)
    9. Back in Flash Builder I switch to design view and drag a datagrid onto the big white area in the middle, whatever that is called.
    10. Then below in Data/Services tab on the bottom I click drag the function 'GetAllCustomer' on top of the datagrid.
         I say yes to rebound and click ok and the view of the datagrid is updated with the colums from the 'customer' table in mySQL.
    (Now let me say that when I hit save and compile this, if I actually had records in this table that I insert thru phpMyAdmin, this does show in the datagrid. So for the whole CRUD thing I am able to get the R which is Read)
    11. Now going back to the design view in Flash Builder I will create a form to create records in the table... (I guess this isn't really a step)
    12. In the Data/Service tab on the bottom I select 'createCustomer' function and then there is an icon called 'Generate Form' that looks like a white piece of paper with a gear on the bottom of it.
    13. This opens up a new form and since I don't have a crazy bunch of fields in my table I just click Finished (If you click next you can specify which fields you want to exclude from the form but this time I don't need to)
    14. This actually creates 2 forms if you look at the code, the second just shows the return type from when you click 'CreateCustomer' button on the first form. Because they overlap in design view I drag the form out of the way so you can see the input form, the return form, and the datagrid
    15. Then I save and compile...
    (Also if your actually reading this I didn't remove the id form field, I get the same result either way, but if you do remove the form field in the code/design you also have to update the button function to not deal with the id before it gets sent off to the php page since in this case the MySQL table is set to auto_increment the id, sorry this doesn't make much sence but this little area doesn't matter much either way)
    16. Now fill in whatever data you want for name and email, try differnt numbers in the id field like 0, nothing, 1, 1000 and click 'CreateCustomer'
    (For me nothing happens, no return is put in the return field, no error pops up and the datagrid is not updated with the new record, also going over to phpMyAdmin and checking out the table browse doesn't show any changes either, I know the button is calling the function because if I add a state change in that function it changes, it would seem that the line:
    createCustomerResult.token = customerService.createCustomer(customer2); doesn't do anything)
    So any idea what is wrong here, I'm convenced it's something stupid easy simple I just can't see it.

    In case you need more info, here is a code dump on a mxml project that has this problem:
    <?xml version="1.0" encoding="utf-8"?>
    <s:WindowedApplication xmlns:fx="http://ns.adobe.com/mxml/2009"
                           xmlns:s="library://ns.adobe.com/flex/spark"
                           xmlns:mx="library://ns.adobe.com/flex/mx"
                           xmlns:customerservice="services.customerservice.*"
                           xmlns:valueObjects="valueObjects.*"
                           currentState="State1">
        <fx:Script>
            <![CDATA[
                import mx.controls.Alert;
                import mx.events.FlexEvent;
                protected function dataGrid_creationCompleteHandler(event:FlexEvent):void
                    getAllCustomerResult.token = customerService.getAllCustomer();
                protected function button_clickHandler(event:MouseEvent):void
                    var customer2:Customer = new Customer();
                    customer2.id = parseInt(idTextInput.text);
                    customer2.name = nameTextInput.text;
                    customer2.email = emailTextInput.text;
                    currentState = "Test";
                    createCustomerResult.token = customerService.createCustomer(customer2);
            ]]>
        </fx:Script>
        <s:states>
            <s:State name="State1"/>
            <s:State name="Test"/>
        </s:states>
        <fx:Declarations>
            <s:CallResponder id="getAllCustomerResult"/>
            <customerservice:CustomerService id="customerService"
                                             fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                             showBusyCursor="true"/>
            <valueObjects:Customer id="customer"/>
            <s:CallResponder id="createCustomerResult"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>
        <s:DataGrid id="dataGrid" includeIn="State1" x="330" y="10" width="392"
                    creationComplete="dataGrid_creationCompleteHandler(event)" requestedRowCount="4">
            <s:columns>
                <s:ArrayList>
                    <s:GridColumn dataField="id" headerText="id"></s:GridColumn>
                    <s:GridColumn dataField="name" headerText="name"></s:GridColumn>
                    <s:GridColumn dataField="email" headerText="email"></s:GridColumn>
                </s:ArrayList>
            </s:columns>
            <s:typicalItem>
                <fx:Object id="id1" email="email1" name="name1"></fx:Object>
            </s:typicalItem>
            <s:AsyncListView list="{getAllCustomerResult.lastResult}"/>
        </s:DataGrid>
        <s:Form includeIn="State1" defaultButton="{button}">
            <s:FormItem label="Id">
                <s:TextInput id="idTextInput" text="{customer.id}"/>
            </s:FormItem>
            <s:FormItem label="Name">
                <s:TextInput id="nameTextInput" text="{customer.name}"/>
            </s:FormItem>
            <s:FormItem label="Email">
                <s:TextInput id="emailTextInput" text="{customer.email}"/>
            </s:FormItem>
            <s:Button id="button" label="CreateCustomer" click="button_clickHandler(event)"/>
        </s:Form>
        <s:Form includeIn="State1" x="0" y="204">
            <s:FormItem label="CreateCustomer">
                <s:TextInput id="createCustomerTextInput" text="{createCustomerResult.lastResult as int}"/>
            </s:FormItem>
        </s:Form>
    </s:WindowedApplication>

  • Flash Builder 4.5 Data Services Wizard, setting up REST service call returns Internal Error Occurred

    Dear all -
    I am writing with the confidence that someone will be able to assist me.
    I am using the Flash Builder Data Services Wizard to access a Server that utilizes REST type calls and returns JSON objects. The server is a JETTY server and it apparantly already works and is returning JSON objects (see below for example). It is both HTTP and HTTPS enabled, and right now it has a cross-domain policy file that is wide open (insecure but its not a production server, it's internal).
    The crossdomain file looks like this:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE cross-domain-policy SYSTEM "http://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
    <cross-domain-policy>
       <allow-http-request-headers-from domain="*" headers="*" secure="false"   />
       <allow-access-from domain="*" to-ports="*" secure="false"/>
       <site-control permitted-cross-domain-policies="master-only" />
    </cross-domain-policy>
    The crossdomain file is in the jetty server's root directory and is browseable via HTTP and HTTPS (i.e. browsing to it returns the xml)
    Now before all of you say that using wizards sucks (generally) I thought I would utilize the FB Data Services Wizard as at least it would provide a template for which I could build additional code against, or replace and improve the code it produces.
    With that in mind, I browse to the URL of the Jetty Server with any web browser (for example, Google Chrome, Firefox or IE) with a URL like this (the URL is a little confidential at the moment, but the structure is the same)
    https://localhost:somePort/someKey/someUser/somePassword/someTask
    *somePort is the SSL port like 8443
    *someKey is a key to access the URL's set of services
    returns a JSON object as a string in the web browser and it appears like the following:
    {"result":success,"value":"whatEverTheValueShould"}
    Looks like the JSON string/object is valid.
    I went through the Flash Builder Data Services Wizard to set up HTTP access to this server. The information that I filled in is described below:
    Do you want to use a Base URL as a prefix for all operation URLs?
    YES
    Base URL:
    https://localhost:8443/someKey/
    Name                    : someTask
    Method                    : POST
    Content-Type: application/x-www-form-urlencoded
    URL                              : {someUser}/{somePassword}/someTask
    Service Name: SampleRestapi
    Services Package: services.SampleRestapi
    datatype objects: valueObjects:
    Completing the wizard, I run the Test Operation command. Remember, no authentication is needed to get a JSON string.
    It returns:
    InvocationTargetException: Unable to connect to the URL specified
    I am thinking - okay, but the URL IS browseable (as I originally was able to browse to it, as noted above).
    I continue to test the service by creating a Flex application that accepts a username and password in a form. when the form is submitted, the call to the service is invoked and an event handler returns the result. The code is below (with some minor changes to mask the actual source).
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                                     xmlns:s="library://ns.adobe.com/flex/spark"
                                     xmlns:mx="library://ns.adobe.com/flex/mx"
                                     xmlns:SampleRestapi="services.SampleRestapi.*"
                                     minWidth="955" minHeight="600">
              <fx:Script>
                        <![CDATA[
                                  import mx.controls.Alert;
                                  import mx.rpc.events.ResultEvent;
                                  protected function button_clickHandler(event:MouseEvent):void
                                            isUserValidResult.token = SampleRestAPI.isUserValid(userNameTextInput.text,passwordTextInput.text);
                                  protected function SampleRestAPI_resultHandler(event:ResultEvent):void
                                            // TODO Auto-generated method stub
                                            // print out the results
                                            txtAreaResults.text = event.result.message as String;
                                            // txtAreaResults.appendText( "headers \n" + event.headers.toString() );
                        ]]>
              </fx:Script>
              <fx:Declarations>
                        <SampleRestapi:SampleRestAPI id="SampleRestAPI"
                                                                                                 fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)"
                                                                                                 result="SampleRestAPI_resultHandler(event)"
                                                                                                 showBusyCursor="true"/>
                        <s:CallResponder id="isUserValidResult"/>
                        <!-- Place non-visual elements (e.g., services, value objects) here -->
              </fx:Declarations>
              <s:Form defaultButton="{button}">
                        <s:FormItem label="UserName">
                                  <s:TextInput id="userNameTextInput" text="q"/>
                        </s:FormItem>
                        <s:FormItem label="Password">
                                  <s:TextInput id="passwordTextInput" text="q"/>
                        </s:FormItem>
                        <s:Button id="button" label="IsUserValid" click="button_clickHandler(event)"/>
                        <s:FormItem  label="results:">
                                  <s:TextArea id="txtAreaResults"/>
                        </s:FormItem>
              </s:Form>
    </s:Application>
    It's a simple application to be sure. When I run it , I get the following returned in the text area field txtAreaResults:
    An Internal Error Occured.
    Which is equivalent to the following JSON string being returned:
    {"success":false,"value":"An Internal Error Occured"}
    It appears that the call is being made, and that a JSON object is being returned... however it does not return the expected results?
    Again the URL constructed is the same:
    https://www.somedomain.com:somePort/someKey/someUser/somePassword/someTask
    So I am wondering what the issue could be:
    1) is it the fact that I am browsing the test application from an insecure (http://) web page containing the Flex application and it is accessing a service through https:// ?
    2) is the JSON string structurally correct? (it appears so).
    3) There is a certificate enabled for HTTPs. it does not match the test site I am using ( the cert is for www.somedomain.com but I am using localhost for testing). Would that be an issue? Google Chrome and IE just asks me to proceed anyway, which I say "yes".
    Any help or assistance on this would be appreciated.
    thanks
    Edward

    Hello everyone -
    Since I last posted an interesting update happened. I tested my  Flex application again, it is calling a Jetty Server that returns a JSON object, in different BROWSERS.  I disabled HTTPS for now, and the crossdomain.xml policy file is wide open for testing (ie. allowing every request to return data). So the app accessing the data using HTTP only. Browsers  -  IE, Opera, Firefox and Chrome. Each browser contained the SAME application, revision of the Flash Player (10.3.183.10 debugger for firefox, chrome, opera, safari PC; 11.0.1.129 consumer version in IE9,) take a look at the screen shot (safari not shown although the result was the same as IE and chrome)
    Note that Opera and Firefox returned successful values (i.e. successful JSON objects) using the same code generated from the Data Services Wizard. Chrome, IE and, Safari failed with an Internal error. So I am left wondering - WHY? Is it something with the Flash Player? the Browsers?  the Flex SDK? Any thoughts are appreciated. Again, the code is found in the original thread above.

  • Data Services 4.0 Job Server ODBC DB2 library error

    I have followed the instructions in the SBO 401 DS Admin Guide for configuring ODBC data sources on UNIX. I have gotten the unixODBC part working from the LINUX DS Job server host using isql DNS UID PWD. I am able to connect to the DB2 9.7 UDB server and I run queries successfully. My problem is when I go to submit a column profile request I get the following error back in the profiler monitor:
    ErrorSystem call <LoadLibrary> to load and initialize functions failed for <libdb2.so>. Ensure the shared library is installed and located correctly.
    This library is contained in the /opt/sapds/DB2_Conn/odbc_cli/clidriver/lib directory which is contained in the LD_LIBRARY_PATH. I have these 2 entries in the ds_odbc.ini file:
    [DB2TEST]
    Driver = /opt/sapds/DB2_Conn/odbc_cli/clidriver/lib/libdb2.so
    [DB2]
    Description = IBM DB2 Adapter
    Driver = /opt/sapds/DB2_Conn/odbc_cli/clidriver/lib/libdb2.so
    There is a troubleshooting section in the admin guide that states "To determine whether all dependent libraries are set properly in the environment variables, you can use the ldd command on the ODBC driver manager library and the ODBC driver library."
    For example: ldd tdata.so
    Is this a real thing to check or just an example?
    When I check the db2 library I receive the following:
    $ ldd libdb2.so
            linux-vdso.so.1 =>  (0x00007fffd13fc000)
            libcrypt.so.1 => /lib64/libcrypt.so.1 (0x00002b5ab3d36000)
            libdl.so.2 => /lib64/libdl.so.2 (0x00002b5ab3f6e000)
            libpthread.so.0 => /lib64/libpthread.so.0 (0x00002b5ab4172000)
            librt.so.1 => /lib64/librt.so.1 (0x00002b5ab438e000)
            libpam.so.0 => /lib64/libpam.so.0 (0x00002b5ab4597000)
            libm.so.6 => /lib64/libm.so.6 (0x00002b5ab47a2000)
            libstdc+.so.6 => /usr/lib64/libstdc+.so.6 (0x00002b5ab4a26000)
            libgcc_s.so.1 => /lib64/libgcc_s.so.1 (0x00002b5ab4d26000)
            libc.so.6 => /lib64/libc.so.6 (0x00002b5ab4f34000)
            /lib64/ld-linux-x86-64.so.2 (0x0000003791400000)
            libaudit.so.0 => /lib64/libaudit.so.0 (0x00002b5ab528d000)
    I believe that the DB2 ODBC DNS is working correctly because I can connect and run queries from the server host.
    Does anyone have an idea on what I might check to get this working? Should I open up a support message for further help? Let me know, thanks.
    Additionally, we have our Oracle profiler job working without issue.
    But, we are having another issue in the Data Services Designer when leaving the options screen we get the following error:
    "The Job Server in not responding. Cannot save modifications to the job execution options. Make sure the Job Server is running and accessible from the Designer, and then make make your changes again. (BODI - 1260016)." I do not think that this is related to running the DB2 profiler jobs because, as I said we can run Oracle jobs without issue.
    Edited by: John Joiner on Oct 18, 2011 1:31 AM

    Hey John
    We are having a similar issue. Can you please let me know how the issue was fixed (i.e. what were the missing pieces in the setup)?
    Thanks!

  • Problem while calling a web service in BOBJ Data services

    Hello Experts,
    I am trying to call a web service in bobj data services. A real time job has been scheduled and published as a web service. I want to consume this service in web dynpro java.
    I tried both the methods the adaptive web services and depricated version. I also tried calling the url directly and with the metadata and execution destinations.
    No matter what I do, I keep getting the following error.
    Exception on execution of web service with WSDL URL 'http://XXXXX:28080/DataServices/servlet/webservices?ver=2.0&wsdl' with operation 'SERVICE_<NAME>' in interface 'Real-time_Services'
    The call never reaches data services system.  If I try to call the service from soapUI (web service testing tool) it works fine.
    I am using SAP NW 7.0 SP22 .
    Here is my code in dynpro to call the service.
         AdaptiveModel mod = new AdaptiveModel();
         Request_SERVICE_MDM_LOOKUP request = new Request_SERVICE_MDM_LOOKUP(mod);
         Query1 query1 = new Query1(mod);
         Response_SERVICE_MDM_LOOKUP response = new Response_SERVICE_MDM_LOOKUP(mod);
         request.setQuery(query1);
         request.setResponse(response);
         List list = new ArrayList();
         DefinitionsTypes_XsdSchema_1__XsdElement_1__XsdComplexType_Sequence1 element = new DefinitionsTypes_XsdSchema_1__XsdElement_1__XsdComplexType_Sequence1(mod);
         element.setCustomer_Name(wdContext.currentContextElement().getCustomerName());
         element.setZip_Code(wdContext.currentContextElement().getZipcode());
         element.setAddr1("");
         element.setAddr2("");
         element.setCity("");
         element.setCountry("");
         element.setState("");
         list.add(element);
         query1.set$002fDefinitions$002fTypes$002fXsdSchema$005b1$005d$002fXsdElement$005b1$005d$002fXsdComplexType$0023Sequence1(list);
         wdContext.nodeRequest_SERVICE_MDM_LOOKUP().bind(request);
          wdContext.currentRequest_SERVICE_MDM_LOOKUPElement().modelObject().execute();
          wdContext.nodeResponse().invalidate();
          wdContext.nodeQueryResponse().invalidate();
          wdContext.nodeSequenceResponse().invalidate();
    Please let me know if you have any pointers on how to solve this.
    Thanks in advance
    Praveen.

    have you create the destination?
    do  you use the wizard to generate code?
    usually there is catch clause for this line of code
    wdContext.currentRequest_SERVICE_MDM_LOOKUPElement().modelObject().execute();
    Edited by: John Wu on Dec 16, 2010 11:51 PM

  • Problems on Windows 7 Professional 64 with PHP data service

    I've created a data service using PHP in a PHP Eclipse project and I'm trying to connect to it from my new Flash project. When I try to create a custom data type via the Configure Return Type dialog, "Auto detect the return type from sample data" radio button, I get the following error:
    There was an error while invoking the operation. Check  your operation inputs or server code and try invoking the operation again. 
    Reason:
    Warning: mysqli::mysqli() [mysqli.mysqli]: (HY000/2003): Can't connect to MySQL  server on 'localhost' (10061) in  C:\Users\davidk\workspace\php-global-includes\mysqlAccess.inc.php on line  11
        /0/onStatusÿÿÿÿ �SIflex.messaging.messages.ErrorMessage extendedData faultCode faultDetail faultString rootCause correlationId clientId destination messageId timestamp timeToLive headers  body  „m …a#0  C:\Zend\ZendServer\share\ZendFramework\library\Zend\Amf\Server.php(550):  Zend_Amf_Server->_dispatch('getProductVersi...', Array, 'GetPlayData')#1  C:\Zend\ZendServer\share\ZendFramework\library\Zend\Amf\Server.php(626):  Zend_Amf_Server->_handle(Object(Zend_Amf_Request_Http))#2  C:\Zend\Apache2\htdocs\play-debug\gateway.php(69):  Zend_Amf_Server->handle()#3 {main} ‚UError instantiating class GetPlayData to  invoke method getProductVersions: Error connecting to database server as user  via password configured in  config_cdna_testdb.php  IE83D9958-920E-E203-54BC-E5365BD85289 I5496259E-8C36-AC89-E234-00000D37FD49  I7E8A1BD7-9D60-9329-DBFB-00001B5BE8C7  126823334100     
    Note that I've tested the GetPlayData class and the getProductVersions() method with some simple "unit testing" code and it works fine when I execute it directly. It just won't run when called from this dialog.
    I tried to debug the gateway.php process that is used to do this connecting without much success so far.
    Is Windows 7 supported for PHP data service development in this beta release? I'm using Version 4.0 build 253292

    One more clue: the message from the exception shows that the global variables I'm using to configure the MySQL connection parameters are not set somehow. Maybe I need to upgrade my Zend Framework?
    Nope. I upgraded to the latest Zend Framework and it still did not work. The global variables are not working. When I hard coded the connection parameters into the constructor of the GetPlayData class, then it worked fine. I just switched to using define() to create constants instead of using the globals and that worked, too.
    It is as if globals set in one include file are not available in another include file. I agree that using them might be a bad programming practice of sorts, but it seems wrong to disallow / not support something that is part of the core language!
    So, I don't know if this is a Windows 7 thing or just a general behavior. Globals within the same file seem to work fine still, but not from another include file.
    So the answer for me is to not use these cross-include file globals in code that is going to be used from Flash Builder.

  • Directory structure for the new Data Services Project

    1) I do as prescribed in the manual "Building and deploying
    Flex 2 Applications", page 325
    "To create a web application make a copy of the /flex
    directory and its contents. Rename the copy and store it in the
    same location under /servers/default directory."
    ("flex" is an empty Flex Data Services application that
    serves as a template for creating your custom application)
    2) I create a corresponding project from Flex Builder 2 :
    Project type: Flex Data Services
    Root folder: C:\fds2\jrun4\servers\default\MyDS
    Root URL:
    http://localhost:8700/default/MyDS
    Project name: MyDS
    Project contents: C:\fds2\jrun4\servers\default\MyDS
    2) I build the project
    Immediately after "build project" the directory structure at
    C:\fds2\jrun4\servers\default\MyDS becomes the following:
    .settings
    bin
    ----------------META-INF
    ----------------WEB-INF
    ---------------- --------------- classes
    ---------------- ---------------flex
    --------------------------------jsp
    --------------------------------lib
    -------------------------------sessions
    html-template
    META-INF
    WEB-INF
    ----------------classes
    ----------------flex
    ----------------jsp
    ----------------lib
    ----------------sessions
    Notice that bin directory now contains another pair of
    META-INF and WEB-INF in addition to those already existing in the
    template project "flex".
    Can anybody comment on this directory structure?
    Which META-INF and WEB-INF are supposed to be used for
    configuration?
    What is the purpose of having two pairs of META-INF and
    WEB-INF in the same web app?

    Hello -
    first, those folders are necessary in deployment - You need
    only the contents of the bin folder for deployment, not the
    sources. Since you're compiling the application locally in FB2 it
    places all of the supporting and necessary files into one location
    namely the "bin" folder. You'd deploy the "bin" folder's contents
    to the FDS server, perhaps another FDS server that is not your
    "development" server -- like a production server. The data and
    configuration information that your app needs for FDS services are
    stored in the WEB-INF and META-INF folders so these need to travel
    with the final product. On the production server you'd just cop the
    "bin" folder and it's contents to the /servers/default folder -
    where you could then rename your bin folder to "MyDS"
    HTH, Bill

  • Database Type field in Data Services 3.0

    Hi,
    Now I'm using the IDSServer 4.5 JDBC-ODBC driver type 3 to connect BEA Acqualogic Data Services 3.0 to MS-Access 2003.
    I configured the IDSWaldbottDS DataSource with those parameters:
    Driver class name: ids.sql.IDSDriver
    URL: jdbc:ids://psnb161:12/conn?dsn=WaldbottDS
    I created the system DSN ODBC datasource called 'WaldbottDS' in Windows XP
    Based on the AdminServer log file, I can demostrate that the BEA connect successfully with MS Access:
    ####<Mar 5, 2008 9:14:37 AM ACT> <Info> <JDBC> <psnb161> <AdminServer> <[ACTIVE] ExecuteThread: '0' for queue: 'weblogic.kernel.Default (self-tuning)'> <<WLS Kernel>> <> <> <1204726477248> <BEA-001516> <Connection Pool "IDSwaldbottDS" connected to Database: "ACCESS", Version: "04.00.0000".>
    Now, In the project Explorer, I executed those commands:
    New -> Physical Data Service.
    Inside the Create Physical Data Service dialog box, the Relational database objects is set to Tables and views.
    I select the Data Source Type as Relational. When I select IDSwaldbottDS as Data Source, nothing appears in "Database Type" field. If I press the next button, an error message appears:
    "Cannot obtain connection: driverURL = jdbc:weblogic:pool:IDSwaldbottDS, props = {EmulateTwoPhaseCommit=false, connectionPoolID=IDSwaldbottDS, jdbcTxDataSource=true, LoggingLastResource=false, dataSourceName=IDSwaldbottDS}.
    Nested Exception: java.lang.RuntimeException: Failed to Generate Wrapper Class
         at weblogic.utils.wrapper.WrapperFactory.createWrapper(WrapperFactory.java:213)
         at weblogic.jdbc.wrapper.JDBCWrapperFactory.getWrapper(JDBCWrapperFactory.java:173)
         at weblogic.jdbc.pool.Driver.allocateConnection(Driver.java:247)
         at weblogic.jdbc.pool.Driver.connect(Driver.java:164)
         at weblogic.jdbc.jts.Driver.getNonTxConnection(Driver.java:647)
         at weblogic.jdbc.jts.Driver.connect(Driver.java:137)
         at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:359)
         at weblogic.jdbc.common.internal.RmiDataSource_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:550)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:224)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:440)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:147)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:436)
         at weblogic.rmi.internal.BasicServerRef.access$300(BasicServerRef.java:58)
         at weblogic.rmi.internal.BasicServerRef$BasicExecuteRequest.run(BasicServerRef.java:975)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
    I recognize that the "Database Type" must be filled with the database version so I can continue configuring the physical Data Source for MS Access 2003.
    How can I solve this problem?

    [ There original post I made is incorrect.  The classes/shared libraries need only to be available to the server - they do not need to be available to ALDSP Studio, since the database is access via the server. Double check that the required classes/shared libraries for your jdbc driver are available to your server ]
    I searched our CR database for the stacktrace/error that you have and found serveral CR. Most of them indicate the problem was jar file(s) for the jdbc driver were not present in the client classpath. So - whatever you added to the server classpath (and PATH - if there were also shared object libraries) - we need to add those to the ALDSP Studio (eclipse) classpath (PATH).
    you can put the jar(s) in
    aldsp_3.0\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.external_3.0.0
    and modifying
    aldsp_3.0\eclipse-plugins\dsp\eclipse\plugins\com.bea.dsp.ide.external_3.0.0\META-INF/manifest.mf.
    There are two places in manifest.mf you will need to add the jar file - once under Bundle-Classpath and once under Export-Package.
    Edited by mreiche at 03/07/2008 10:48 AM

Maybe you are looking for

  • XP as server, and Win 7 as client

    I have a windows XP desktop and a Thinkpad on Windows 7. I want to turn my desktop into a server and access the hard drive from my laptop when im at work. Is there any way to do this from within in windows? or a way to do this for free? I only want t

  • Safari will  not play streaming video or audio

    Hi everyone, I have had my iBook for a year and never even tried to take advantage of streaming video or audio b/c I had a dial-up connetion until very recently. Now that I have a high speed connection I would like to watch trailers and listen to mus

  • Schema Questions?

    I was wondering if this RFI works. I am trying to link two tables together but each exist in diff. schemas //Schema1 create tablename( JobOrderID Number(6) PRIMARY KEY, JobOrderNumber varchar(15), Location varchar(20), JobDate Date); //Schema2 create

  • Validation function, PL/SQL is not being executed

    Hello there, In one of my APEX listener setups I want to give access to only one application and block the rest. Basically I am following this nice post from Kris Rice: http://krisrice.blogspot.com.ar/2013/01/apex-listener-plsql-validations.html My p

  • Reminders duplicate or don't acknowledge edits

    I'll add a task to Reminders. When I oepn the app again though, its there twice. If I delete one of the Reminders, both disappear. Also, sometimes I edit the date and time of a reminder and save it, but when I look at the app again, it's reverted to