Problems returning complex objects from a php data service

either the data services tool is buggy or i am doing something wrong. here is the code:
<?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/halo"
     minWidth="1024" minHeight="768"
     xmlns:personservice="services.personservice.*"
     initialize="init()">
     <fx:Script>
          <![CDATA[
               import mx.rpc.events.ResultEvent;
               import mx.controls.Alert;
               import mx.collections.ArrayCollection;
               public var people:ArrayCollection;
               private function init():void {
                    getPeopleInMyWorldResult.token = personService.getPeopleInMyWorld();
               protected function getPeopleInMyWorldResult_resultHandler(event:ResultEvent):void {
                    people = new ArrayCollection(event.result as Array);
          ]]>
     </fx:Script>
     <fx:Declarations>
          <s:CallResponder id="getPeopleInMyWorldResult" result="getPeopleInMyWorldResult_resultHandler(event)"/>
          <personservice:PersonService id="personService"
               destination="PersonService"
               endpoint="http://localhost/photoapp/Test3-debug/gateway.php"
               fault="Alert.show(event.fault.faultString)"
               showBusyCursor="true"
               source="PersonService"/>
     </fx:Declarations>
</s:Application>
<?php
class Person {
     public $name;
     public $cars;
class Car {
     public $year;
     public $make;
     public $model;
class PersonService {
     public function getPeopleInMyWorld() {
          $person1 = new Person();
          $person1->name = "John Doe";
          $car1 = new Car();
          $car1->year = 2005;
          $car1->make = 'audi';
          $car1->model = 'A6 Quattro';
          $car2 = new Car();
          $car2->year = 1970;
          $car2->make = 'datsun';
          $car2->model = '510';
          $person1->cars = array($car1, $car2);
          $person2 = new Person();
          $person2->name = "Jane Doe";
          return array($person1, $person2);
create a new "flex" project in FB Beta1 with a php server. Setup the application and php script as normal, then configure the return type for the getPeopleInMyWorld function. I created a new return type called "Person" and was quite please to see that FB automagically created a "Cars" class with the all the right properties.
Unfortunately, if you run the code (try debug mode and put a breakpoint on the result handler) you'll notice that "john doe" has lost his cars and that you also get the silent (check console) error:
TypeError: Error #1034: Type Coercion failed: cannot convert []@1226bc49 to mx.collections.ArrayCollection.
any ideas??
i can get this to work by using json, but it's extra work, the com.adobe.serializers.json.JSONDecoder has little documentation, and the method outlined above is just begging to work.
so, how are the rest of you getting complex data back from your servers? json?? amfphp?? xml (but surely not)??
also, since i'm here discussing data services, if any adobe ppl are about, please throw one extra voice behind the following feature requests:
1) support for optional service call arguments (http://bugs.adobe.com/jira/browse/FB-19659)
2) a button for automatically 'generating service calls' from within the data services panel.
thanks,
- e

Thank you Gaurav for pointing me in the right direction. There was some debate in the blogs as to which data transferring method (amfphp, json, or xml) was best. See
http://blogs.adobe.com/mikepotter/2006/07/php_and_flex_js.html
and
http://www.5etdemi.com/blog/archives/2006/12/clearing-the-fud-on-amfphps-speed-versus-json -and-xml/
I used json yesterday
php:  json_encode(array($p1, $p2));   // observation: you only have to encode once as opposed
                                      // to using amf on each array...
FB:   private var jsonD:JSONDecoder = new JSONDecoder();
      var jsonString:String = {{{return result from service call}}}
      myPeople:ArrayCollection = jsonD.decode(jsonString, services.personservice.Person);
Note that in FB you can use the services.personservice.Person class as an optional argument in the jsonD.decode function. This class can be automatically generated using FB's built-in data service's panel when you try to configure the return type (as I described above). The json data should unserialize correctly with Cars objects automagically created and everything (a huge time saver!!).
It worked for me, though I'm not sure how deep the unserialization process is capable of going (objects within objects w/in objects, for example). Also I had some trouble with adobe's jsonDecoder; it had trouble eating (uhm parsing) hollow objects (i.e. objects with null properties), whereas the php_encode / php_decode handled these objects w/o fail.
Anyway, will be reading up on amf. Tanx again Gaurav,
- e

Similar Messages

  • Using PHP Data Services to create an object and accessing that objects data in an unbound way in AS

    Hello,
    I've been able to use the php data services and bind the results of a function to a component. However I am having a hard time figuring out the syntax to use the data services to create an object out of the results, and then use that object as an array of filenames to provide the current index of the filename to a new sound object.
    My problem is obviously in not being able to figure out the specific syntax, I have declared the service and and object of the services returned type and in the creationComplete() function I have assigned object.token = service.getData();
    I've tried various ways of then pulling that data out of the object, with no success.
    Can someone point me in the right direction?
    This code probably looks horrible because it doesn't work yet.
    - Joel
                import flash.media.Sound;
                import flash.media.SoundChannel;
                import mx.controls.Alert;
                var playing:Sound = new Sound();
                var channel:SoundChannel = new SoundChannel();
                var sndIndex:int=0;
                var skpTr:String;
                public function init():void{
                 mp3Array.token = mp3service.getData();
                 currentTrack(mp3Array.lastResult.filename); 
                     trace(mp3Array.lastResult.filename[sndIndex]);
                public function currentTrack(t:String):void{
                    playing = new Sound();
                    playing.load(new URLRequest("mp3/" +t));
                public function skip():void{
                    stop();
                    if (sndIndex != mp3Array.lastResult.length-1){
                        sndIndex++;
                        var skipTr:String=mp3Array.lastResult.filename[sndIndex].data;
                        currentTrack(skipTr);
                        play();
                    } else {
                        sndIndex=0;
                        skipTr=mp3Array.lastResult.filename[sndIndex].data;
                        currentTrack(skipTr);
                        play();
                public function stop():void{
                    channel.stop();
                public function play():void{
                    channel = playing.play();
        <fx:Declarations>
            <s:CallResponder id="mp3Array"/>
            <mp3services:Mp3Service id="mp3service" fault="Alert.show(event.fault.faultString + '\n' + event.fault.faultDetail)" showBusyCursor="true"/>
            <!-- Place non-visual elements (e.g., services, value objects) here -->
        </fx:Declarations>

    Hello Joel;
    In retrieving your data - what is your php returning to FB, an object, object array, an array?  Either way, I have a brief example below that an object(s) is being returned.  Pull the data from the lastResult in a ResultEvent.  The object instantiated in the resultEvent will contain your data and you can do what you want from there. 
    Also, I always use Network Monitor to see what data (if any) is being returned from the server, you can also see how it is being sent back.
    John
    private function init():void
         mp3Array.token = mp3service.getData();
         mp3Array.addEventListener(FaultEvent.FAULT, faultHandler);
         mp3Array.addEventListener(ResultEvent.RESULT, mp3Array_resultHandler);
    protected function faultHandler(event:FaultEvent):void
         Alert.show("There was a fault error!" + event.message, "Fault Error", Alert.OK);
    protected function mp3Array_resultHandler(event:ResultEvent):void
         // Not sure if your service is sending back an object or an array or ?
        var info:Object = mp3Array.lastResult;
         doSomeFunction(info)
    protected function doSomeFunction(data:Object):void
         trace(info.filename);

  • 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.

  • How to return a object from a method in a java program to a C++ call (JNI )

    Sir,
    I am new to java and i have been assigned a task to be done using JNI.
    My question is,
    How can i return an object from a method in a java program to a call for the same method in a C++program using JNI.
    Any help or suggesstions in this regard would be very useful.
    Thanking you,
    Anjan Kumar

    Hello
    I would like to suggest that JNI should be your last choice and not your first choice. JNI is hard to get right. Since the JNI code is executing in the same address space as the JVM, any problems (on either side) will take down the entire process. It dilutes the Write Once Run Anywhere (WORA) value proposition because you need to provide the JNI component for all hardware/OS platforms. If you can keep your legacy code(or whatever you feel you need to do in JNI) in a separate address space and communicate via some inter-process channel, you end up with a system that is more flexible, portable, and scalable.
    Having said all that, head over to the Java Native Interface: Programmer's Guide and Specification web page:
    http://java.sun.com/docs/books/jni/
    Scroll down to the Download the example code in this book in ZIP or tar.gz formats. links and download the example source. Study and run the example sources. The jniexamples/chap5/MyNewString demo creates a java.lang.String object in native code and returns it to the Java Language program.

  • [svn:osmf:] 14486: Add stream metadata support by extracting the actual metadata object from the binary data stream .

    Revision: 14486
    Revision: 14486
    Author:   [email protected]
    Date:     2010-03-01 14:27:41 -0800 (Mon, 01 Mar 2010)
    Log Message:
    Add stream metadata support by extracting the actual metadata object from the binary data stream.
    Fix bug 466
    Modified Paths:
        osmf/trunk/framework/OSMF/org/osmf/elements/f4mClasses/ManifestParser.as
        osmf/trunk/framework/OSMF/org/osmf/elements/f4mClasses/Media.as
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/HTTPStreamingUtils.as
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/f4f/HTTPStreamingF4FIndexHandler.as
        osmf/trunk/framework/OSMF/org/osmf/net/httpstreaming/f4f/HTTPStreamingF4FStreamInfo.as

    same problem, data not replicated.
    its captured,propagated from source,but not applied.
    also no apply errors in DBA_APPLY_ERROR. Looks like the problem is that LCRs propagated from source db do not reach target queue.can i get any help on this?
    queried results are as under:
    1.at source(capture process)
    Capture Session Total
    Process Session Serial Redo Entries LCRs
    Number ID Number State Scanned Enqueued
    CP01 16 7 CAPTURING CHANGES 1010143 72
    2. data propagated from source
    Total Time Executing
    in Seconds Total Events Propagated Total Bytes Propagated
    7 13 6731
    3. Apply at target(nothing is applied)
    Coordinator Session Total Total Total
    Process Session Serial Trans Trans Apply
    Name ID Number State Received Applied Errors
    A001 154 33 APPLYING 0 0 0
    4. At target:(nothing in buffer)
    Total Captured LCRs
    Queue Owner Queue Name LCRs in Memory Spilled LCRs in Buffered Queue
    STRMADMIN STREAMS_QUEUE 0 0 0

  • Passing complex object from JavaScript to Flex

    Is it possible to call a Flex function (defined with ExternalInterface.addCallback) and pass a complex object from Javascript?  The properties of the object are all simple types, but the object itself is an array of objects.  For example:
    <script type="text/javascript">
    var arrayOfObj = [ { one: "one", two: 2, three: "blah" }, { one: "xyz", two: "abc", three: 3.141 } ];
    callSomeFunctionInFlex(arrayOfObj);
    </script>
    What would I do on the Flex side to make this happen?

    Complex object passing works as expected in Blazeds. 
    There are certain cases where you need to write custom bean proxy classes to marshall an object, but your case is very simple and will not require it.
    Make sure that you set the full java package and class name in your remote alias statement on your client value object.  The class has to be fully qualified.  The AS value object also needs the correct import of the nested value object or you will get a compile error.
    Make sure that the blazeds server has the full class path set to your java objects.
    To debug, you can turn on Blazeds logging in the services-config.xml file like this:
       <logging>
            <!-- You may also use flex.messaging.log.ServletLogTarget -->
            <target class="flex.messaging.log.ConsoleTarget" level="DEBUG">
                <properties>
                    <prefix>[BlazeDS]</prefix>
                    <includeDate>false</includeDate>
                    <includeTime>false</includeTime>
                    <includeLevel>true</includeLevel>
                    <includeCategory>false</includeCategory>
                </properties>
            </target>
        </logging>

  • Flash Builder 4.5 Auto-Gen Code For PHP Data Service Produces Errors

    Hello
    I'm currently running a fresh install of MAMP on my Mac and when I start a new flex project, add a php data service that pulls from a mysql database I have. Everything works fine until I try to compile. The error I'm getting is 'uid' being the primary key which is a bigint(20). The file _Super_Users.as (auto-gen based on the user table below) reports 2 errors: [Managed] requires uid to be of type 'String'. (same error on 2 lines of code) Now the MySQL table wants it to be a int, the auto gen code seems to want it to be an int as well but for some reason its putting in these requires for String on the getter and setters for 'uid'. The is before I even add any of my own code, just auto-gen then compile.
         * data/source property getters
    [Bindable(event="propertyChange")]
        public function get uid() : int /*error line*/
            return _internal_uid;
         * data/source property setters
        public function set uid(value:int) : void /*error line*/
            var oldValue:int = _internal_uid;
            if (oldValue !== value)
                _internal_uid = value;
    This is what my database looks when I export it:
    CREATE TABLE `users` (
      `uid` bigint(20) unsigned NOT NULL,
      `name` varchar(150) NOT NULL,
      `first_name` varchar(50) NOT NULL,
      `middle_name` varchar(50) NOT NULL,
      `last_name` varchar(50) NOT NULL,
      `gender` tinyint(1) NOT NULL,
      `locale` varchar(5) NOT NULL,
      `link` varchar(255) NOT NULL,
      `username` varchar(50) NOT NULL,
      `email` varchar(255) NOT NULL,
      `picture` varchar(255) NOT NULL,
      `friends` text NOT NULL,
      `created` datetime NOT NULL,
      `updated` datetime NOT NULL,
      PRIMARY KEY (`uid`)
    ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
    It's empty right now...
    Apache 2.0.64
    MySQL 5.5.9
    PHP 5.2.17 & 5.3.5
    APC 3.1.7
    eAccelerator 0.9.6.1
    XCache 1.2.2 & 1.3.1
    phpMyAdmin 3.3.9.2
    Zend Optimizer 3.3.9
    SQLiteManager 1.2.4
    Freetype 2.4.4
    t1lib 5.1.2
    curl 7.21.3
    jpeg 8c
    libpng-1.5.0
    gd 2.0.34
    libxml 2.7.6
    libxslt 1.1.26
    gettext 0.18.1.1
    libidn 1.17
    iconv 1.13
    mcrypt 2.5.8
    YAZ 4.0.1 & PHP/YAZ 1.0.14
    I tried to give as much info as possible, if you need more let me know...

    I discovered my problem was uid seems to be a built in global or something and was filling in that data field with a bunch of letters and number, like the device id. Because of the letters flex was throwing a fit. So if you're using Facebook API in flex be sure to not go with uid for the user id, which is was facebook api calls it.

  • Tutorial: Flash Builder 4 beta 2 and PHP Data/Services for beginners

    Hi fellas,
    I've written this tutorial for total beginners to get quickly to FB4 and PHP. Comments welcome
    Flash Builder 4 and PHP Data/Services for beginners
    http://www.flashrealtime.com/flash-builder-4-and-php-data-services/

    Hi,
    The first issue will be the pathing differences between wamp/mamp/xampp, some use www as root others htdoc you need to setup the php services on your local machine rather than importing a project.
    The created services will have a connection array declared at the top of the code that points to the mysql server, in the project default debug folder you will have the config file that has the zend and webserver path
    top of service file
    ============
    var $username = "root";
    var $password = "";
    var $server = "localhost";
    var $port = "3306";
    var $databasename = "zend";
    var $tablename = "clients";
    var $connection;
    amfconfig.ini
    =========
    [zend]
    ;set the absolute location path of webroot directory, example:
    ;Windows: C:\apache\www
    ;MAC/UNIX: /user/apache/www
    webroot =C:/wamp/www
    ;set the absolute location path of zend installation directory, example:
    ;Windows: C:\apache\PHPFrameworks\ZendFramework\library
    ;MAC/UNIX: /user/apache/PHPFrameworks/ZendFramework/library
    ;zend_path =
    [zendamf]
    amf.production = false
    amf.directories[]=Zender-debug/services
    In your main project folder you have a .model folder the file there is an *.fml file that contains your channel endpoints etc.
    David.

  • Insert problems with Php Data Services

    Hi All,
    I am using Flex Data wizards to create a simple CRUD application and i am having problems adding data. It works the first time i start my application but subsequent calls to the insert fail.
    I am using FB2 Beta with MAMP. The php classes are being generated using the data wizard. i have tried commenting out mysqli_close but still it doesn't work.
    public function createDive_events($item) {
    $stmt = mysqli_prepare($this->connection, "INSERT INTO $this->tablename ( divedate, divesite, divecost, description, totalDays) VALUES ( ?, ?, ?, ?, ?)");
    $this->throwExceptionOnError();
    mysqli_bind_param($stmt, 'ssdsi', $item->divedate, $item->divesite, $item->divecost, $item->description, $item->totalDays);
    $this->throwExceptionOnError();
    mysqli_stmt_execute($stmt);
    $this->throwExceptionOnError();
    $autoid = mysqli_stmt_insert_id($stmt);
    mysqli_stmt_free_result($stmt);
    //mysqli_close($this->connection);
    return $autoid;
    Any ideas, what i am doing wrong. I have tried using the update and it works only once as well, it seems that the connection to the function is lost after the first call.
    thank you,
    Nayan

    Ok, this is what I got.
    create a mysql table (`people`) with columns id (auto increment), first_name, last_name, age
    in the data/service panel connect to a php service, generate a php service from the database and the people table
    generate a form from the createPeople service call
    observe that in source view we have something like this: <fx:Script>
      <![CDATA[
           protected function button_clickHandler(event:MouseEvent):void {
              createPeopleResult.token = peopleService.createPeople(people);
      ]]>
    </fx:Script>
    <fx:Declarations>
      <valueObjects:People id="people"
                           people_id="{parseInt(people_idTextInput.text)}"
                           age="{parseInt(ageTextInput.text)}"/>
      <peopleservice:PeopleService id="peopleService"/>
      <s:CallResponder id="createPeopleResult"/>
    </fx:Declarations>
    If you now try to execute the code, you will find that you can only insert one person, where each successive addition silently fails.
    There is nothing really wrong with the php code (well actually since it's auto incrementing on id you should pull all id reference out of the insert statements...) rather there is a problem with the flex people object.
    If you make the following changes the code will work
    protected function button_clickHandler(event:MouseEvent):void {
      var myPerson:People = new People();
      myPerson.first_name = people.first_name;
      myPerson.last_name = people.last_name;
      myPerson.age = people.age;
      createPeopleResult.token = peopleService.createPeople(myPerson);
    - e

  • Passing complex object from bpel process to web service

    I have deployed my web service on apache axis.The wsdl file looks like as follows,
    <?xml version="1.0" encoding="UTF-8" ?>
    - <wsdl:definitions targetNamespace="http://bpel.jmetro.actiontech.com" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:impl="http://bpel.jmetro.actiontech.com" xmlns:intf="http://bpel.jmetro.actiontech.com" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    - <wsdl:types>
    - <schema targetNamespace="http://bpel.jmetro.actiontech.com" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    - <complexType name="ADLevelBpelWS">
    - <sequence>
    <element name="adLevelStr" nillable="true" type="xsd:string" />
    <element name="id" type="xsd:int" />
    </sequence>
    </complexType>
    - <complexType name="TransResultWS">
    - <sequence>
    <element name="description" nillable="true" type="xsd:string" />
    <element name="id" type="xsd:long" />
    <element name="responseType" type="xsd:int" />
    <element name="status" type="xsd:boolean" />
    </sequence>
    </complexType>
    - <complexType name="NamespaceDataImplBpelWS">
    - <sequence>
    <element name="ADLevel" nillable="true" type="impl:ADLevelBpelWS" />
    <element name="appdataDef" nillable="true" type="apachesoap:Map" />
    <element name="description" nillable="true" type="xsd:string" />
    <element name="name" nillable="true" type="xsd:string" />
    </sequence>
    </complexType>
    - <complexType name="CreateSharedNamespaceBpelWS">
    - <sequence>
    <element name="actor" nillable="true" type="xsd:string" />
    <element name="comment" nillable="true" type="xsd:string" />
    <element name="from" nillable="true" type="xsd:string" />
    <element name="namespaceData" nillable="true" type="impl:NamespaceDataImplBpelWS" />
    <element name="priority" type="xsd:int" />
    <element name="processAtTime" nillable="true" type="xsd:dateTime" />
    <element name="replyTo" nillable="true" type="xsd:string" />
    <element name="responseRequired" type="xsd:boolean" />
    </sequence>
    </complexType>
    </schema>
    - <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
    <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
    - <complexType name="mapItem">
    - <sequence>
    <element name="key" nillable="true" type="xsd:string" />
    <element name="value" nillable="true" type="xsd:string" />
    </sequence>
    </complexType>
    - <complexType name="Map">
    - <sequence>
    <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem" />
    </sequence>
    </complexType>
    </schema>
    </wsdl:types>
    + <wsdl:message name="createNamespaceRequest">
    <wsdl:part name="createNs" type="impl:CreateSharedNamespaceBpelWS" />
    </wsdl:message>
    - <wsdl:message name="createNamespaceResponse">
    <wsdl:part name="createNamespaceReturn" type="impl:TransResultWS" />
    </wsdl:message>
    - <wsdl:portType name="JMetroWebService">
    - <wsdl:operation name="createNamespace" parameterOrder="createNs">
    <wsdl:input message="impl:createNamespaceRequest" name="createNamespaceRequest" />
    <wsdl:output message="impl:createNamespaceResponse" name="createNamespaceResponse" />
    </wsdl:operation>
    </wsdl:portType>
    - <wsdl:binding name="NAMESPACEWITHMAPSoapBinding" type="impl:JMetroWebService">
    <wsdlsoap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    - <wsdl:operation name="createNamespace">
    <wsdlsoap:operation soapAction="" />
    - <wsdl:input name="createNamespaceRequest">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://bpel.jmetro.actiontech.com" use="encoded" />
    </wsdl:input>
    - <wsdl:output name="createNamespaceResponse">
    <wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" namespace="http://bpel.jmetro.actiontech.com" use="encoded" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    - <wsdl:service name="JMetroWebServiceService">
    - <wsdl:port binding="impl:NAMESPACEWITHMAPSoapBinding" name="NAMESPACEWITHMAP">
    <wsdlsoap:address location="http://localhost:7001/axis/services/NAMESPACEWITHMAP" />
    </wsdl:port>
    </wsdl:service>
    </wsdl:definitions>
    My NamespaceDataObjectImplBpelWS object contains element appDataDef which is of type java.util.Map.My bpel wsdl file is as below,
    <?xml version="1.0"?>
    <definitions name="NsWithMap"
    targetNamespace="http://bpel.jmetro.actiontech.com"
    xmlns:tns="http://bpel.jmetro.actiontech.com"
    xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:apachesoap="http://xml.apache.org/xml-soap"
    >
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    TYPE DEFINITION - List of services participating in this BPEL process
    The default output of the BPEL designer uses strings as input and
    output to the BPEL Process. But you can define or import any XML
    Schema type and us them as part of the message types.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <types>
         <schema targetNamespace="http://bpel.jmetro.actiontech.com" xmlns="http://www.w3.org/2001/XMLSchema">
         <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
              <element name="createNamespace" type="tns:CreateSharedNamespaceBpelWS"/>
              <element name="transResult" type="tns:TransResultWS"/>
              <complexType name="TransResultWS">
                   <sequence>
                        <element name="description" type="string" />
                        <element name="id" type="long" />
                        <element name="responseType" type="int" />
                        <element name="status" type="boolean" />
              </sequence>
              </complexType>
              <complexType name="ADLevelBpelWS">
                   <sequence>
                        <element name="adLevelStr" type="string" />
                        <element name="id" type="int" />
                   </sequence>
              </complexType>
              <complexType name="NamespaceDataImplBpelWS">
                   <sequence>
                        <element name="ADLevel" type="tns:ADLevelBpelWS" />
                        <element name="description" type="string" />
                        <element name="name" type="string" />
                        <element name="appdataDef" type="apachesoap:Map" />
                   </sequence>
              </complexType>
              <complexType name="CreateSharedNamespaceBpelWS">
                   <sequence>
                        <element name="namespaceData" type="tns:NamespaceDataImplBpelWS" />
              </sequence>
              </complexType>
         <element name="desc" type="string"/>
         </schema>
         <schema targetNamespace="http://xml.apache.org/xml-soap" xmlns="http://www.w3.org/2001/XMLSchema">
                   <import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
                        <complexType name="mapItem">
                             <sequence>
                                  <element name="key" type="string" />
                                  <element name="value" type="string" />
                        </sequence>
                        </complexType>
                        <complexType name="Map">
                             <sequence>
                             <element maxOccurs="unbounded" minOccurs="0" name="item" type="apachesoap:mapItem" />
                             </sequence>
                        </complexType>
              </schema>
    </types>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    MESSAGE TYPE DEFINITION - Definition of the message types used as
    part of the port type defintions
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <message name="NsWithMapRequestMessage">
    <part name="payload" element="tns:createNamespace"/>
    </message>
    <message name="NsWithMapResponseMessage">
    <part name="payload" element="tns:transResult"/>
    </message>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PORT TYPE DEFINITION - A port type groups a set of operations into
    a logical service unit.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <!-- portType implemented by the NsWithMap BPEL process -->
    <portType name="NsWithMap">
    <operation name="initiate">
    <input message="tns:NsWithMapRequestMessage"/>
    </operation>
    </portType>
    <!-- portType implemented by the requester of NsWithMap BPEL process
    for asynchronous callback purposes
    -->
    <portType name="NsWithMapCallback">
    <operation name="onResult">
    <input message="tns:NsWithMapResponseMessage"/>
    </operation>
    </portType>
    <!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    PARTNER LINK TYPE DEFINITION
    the NsWithMap partnerLinkType binds the provider and
    requester portType into an asynchronous conversation.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
    <plnk:partnerLinkType name="NsWithMap">
    <plnk:role name="NsWithMapProvider">
    <plnk:portType name="tns:NsWithMap"/>
    </plnk:role>
    <plnk:role name="NsWithMapRequester">
    <plnk:portType name="tns:NsWithMapCallback"/>
    </plnk:role>
    </plnk:partnerLinkType>
    </definitions>
    I am trying to set this map data using java code ,
         HashMap procADMap1 = new HashMap(5);
                   PropertyTypeWS pType = new PropertyTypeWS();
                   pType.setTypeIndex(2);     
              AppdataDefImplWS appData1 = new AppdataDefImplWS();
              appData1.setName("Project");
              appData1.setType(pType);
              appData1.setMaxSize(400);
              appData1.setLOB(false);
         appData1.setDefaultValue("Project Default value");
              procADMap1.put(appData1.getName(), appData1);
              setVariableData("request","createNs","/createNs/namespaceData/appdataDef",procADMap1);     
    Then I am passing request object to the method which I want to invoke from bpel process.
    I am able to deploy the application but when I do post message I am getting following exception,
    NamespaceWithMap (createNamespace) (faulted)
    [2004/09/09 18:35:54] "{http://schemas.oracle.com/bpel/extension}bindingFault" has been thrown. Less
    faultName: {{http://schemas.oracle.com/bpel/extension}bindingFault}
    messageType: {{http://schemas.oracle.com/bpel/extension}RuntimeFaultMessage}
    code: {Server.userException}
    summary: {org.xml.sax.SAXException: SimpleDeserializer encountered a child element, which is NOT expected, in something it was trying to deserialize.}
    detail: {null}
    Is there any other way to handle Map type in bpel process?
    Thanks in advance,
    Sanjay

    Thanks for the quick reply.Actually the web service is already deployed on the server.What I want to do is use existing wsdl file of the deployed web service and invoke the method of the same using oracle PM.
    If I remove element which uses apachesoap:Map type it just works fine also I am getting the complex object returned by the web service method.But when I try to set appDataDef which is of type apachesoap:Map(Axis conversion for java.util.Map and it uses namespace xmlns:apachesoap="http://xml.apache.org/xml-soap") I am getting the error.
    Can you give me some direction to use this exising wsdl file to set map object or it is not possible.

  • Web Service not returning Boolean objects from DTO class

    Hi,
    I've seen posts reporting the same problem on other forums from a few years ago that are unresolved.
    I've created a service in NDS that has a method that returns some data via a DTO class. All the data is returned apart from those that are of type java.lang.Boolean. I thought the method names might be causing the problem so created a "get" method as well as an "is" method but it is still being ignored.
    I have tested this using the Portal Web Service Navigator and by using the service in Visual Composer 7.
    Is there a problem with Boolean data types in SAP Web Services ?
    Thanks
    Gary

    Hi Rich,
    No. In fact what happens is that in the se80 case, it returns 29 lines of results and in the wsadmin case it returns 25 lines of results. The web service/function module actually executes unit tests remotely by doing an RFC from the development system to the test system (where the unit tests are executed). In the se80 case, for one object, the unit tests execute correctly. In the wsadmin, the unit tests for that object don't execute hence returning less lines of result.
    In both cases, the users used to log in the web service or se80 are the same and the users for the RFC are the same.
    Thank you for your insight.
    Regards,
    Philon

  • Type of object from a database date/time column

    Hello everyone,
    I've got a concern regarding the way in which coldfusion is
    treating date/time columns in a database.
    In my opinion when I select a column that is let's say
    timestamp type - the object in a query is CF's date/time object.
    I've checked the query by getMetaData() and it looks like each
    column has its own database type (eq. varchar2, date, etc).
    My concern comes from a fact that I've heard that Coldfusion
    is treating the date-time columns in a database as strings and in
    each case it parses them. So the difference in a locale between a
    database server and a Coldfusion server may result in a wrong
    date/time object.
    Example:
    Locale of database EU: yyyy/mm/dd
    Locale of Coldfusion US: yyyy/dd/mm
    The date like 1st of February 2007 stored in a database would
    look then in Coldfusion like: 2nd of January 2007
    Could someone please confirm which version is valid?

    Johnny852 wrote:
    > In my opinion when I select a column that is let's say
    timestamp type - the
    > object in a query is CF's date/time object. I've checked
    the query by
    > getMetaData() and it looks like each column has its own
    database type (eq.
    > varchar2, date, etc).
    if you already know cf is returning a datetime from a
    datetime in the db, what's
    the question?
    > My concern comes from a fact that I've heard that
    Coldfusion is treating the
    "fact"? unless the datetime is stored as a string, that's not
    a "fact".
    > Example:
    > Locale of database EU: yyyy/mm/dd
    > Locale of Coldfusion US: yyyy/dd/mm
    btw neither of your example "locales" are in fact locales.
    > The date like 1st of February 2007 stored in a database
    would look then in
    > Coldfusion like: 2nd of January 2007
    if you pass a numeric string representation (2/1/2007 for
    instance) of a date to
    cf, it will be interpreted via the cf server's "default"
    local (ie en_US,
    month/day/year) unless you use one of the LS functions like
    LSParseDateTime() &
    specifically set the the locale (like setLocale("th_TH")) or
    make the date
    non-ambiguous (2-feb-2007) or build the date yourself from
    user input using
    createDate() or createDateTime(). you just need to convert
    the user's string
    representation to a valid cf datetime object (or i guess
    force to database to
    follow the user's locale date mask).

  • Return NamingEnumeration object from the webservice method.

    I am developing a webservice for creating a connection with LDAP and get user first name from LDAP. For this I developed the following webservice in netbeans 6.0 by using Glass Fish V2 server.
    package san.exam;
    import javax.jws.WebMethod;
    import javax.jws.WebParam;
    import javax.jws.WebService;
    import javax.naming.*;
    import javax.naming.directory.*;
    import java.util.*;
    @WebService()
    public class LDAP {
    @WebMethod
    public NamingEnumeration getUser(@WebParam(name = "firstName") String firstName) throws Exception {
    // TODO implement operation
    Hashtable env = new Hashtable();
         env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
         env.put(Context.PROVIDER_URL, "ldap://chdsez89674d:389/");
    env.put(Context.SECURITY_AUTHENTICATION,"simple");
         env.put(Context.SECURITY_PRINCIPAL,"cn=root"); // specify the username
    env.put(Context.SECURITY_CREDENTIALS,"vicky123");
         // Create the initial context
         DirContext ctx = new InitialDirContext(env);     
         Attributes matchAttrs = new BasicAttributes(true); // ignore attribute name case
         matchAttrs.put(new BasicAttribute("uid", firstName));
    NamingEnumeration answer = ctx.search("ou=white pages,dc=ibm",matchAttrs);
         ctx.close();
    return answer;
    We are not able deploy this webservice. I don�t know what the problem is. But we are able to make web service where we returned int or string or float and able to use this webservice by making webservice client.
    I think in this case we are trying to return NamingEnumeration object so the problem has come. Has anyone solve this problem or tell me how to return the NamingEnumeration object in the webservice?
    Any pointer regarding this problem is helpful for me.

    If you want to transfer an object through RMI it should be Serializable. Add 'implements Serializable' to your class. That's it
    import java.io.Serializable;
    class TransferObject implements Serializable {
    }

  • Returning cloned objects from EJB Local Interfaces

    We'd like to let our WAS 5/J2EE container manage our transactions/unit of work. However, we don't want to have our objects serialized, so we intend to use LocalInterfaces. Additionally, we want to return value objects that support Toplink indirection such that we are not returning the actual cache object but instead a clone.Our question is, how do we return a cloned object that supports indirection from Toplink that we can later do a deepMergeClone on in an explicit update method?

    Additional Information on the first post:
    The pattern we've been testing is as follows:
    1. We set up LocalInterfaces on our EJB's
    2. The EJB Getters are using acquireNonSynchronizedUnitOfWork() to get a NON-JTS transaction to perform a readQuery. This results in a Cloned Bis object being generated. We then release the UOW and return the object.
    3. The Returned Biz object Getters are using Indirection (probably using the released non-synchronized UOW).
    4. The pattern for UPDATE is that we allow the Web Container code (servlet) to change the Cloned Biz Object, they then submit the CLONED and changed object to an EJB update() method where we use getClientSession().getActiveUnitOfWork() to link to the JTS transaction and perform a uow.deepMergeClone(bizObjectClone);
    We are trying to use the pattern for the following reasons:
    1. Isolation of the Cache to upper layers
    2. Transaction Boundry is the EJB Container
    3. We understand that there is a performance overhead with CLoned Biz Objects but this more mirrors the ValueObject Pattern then anything else we've tried.
    BIG Question:
    1. Is this a supported TopLink Pattern?
    2. If its not supported, can it be?
    3. Do you have any other suggested patterns?

  • Newbie question on how to return java objects from java stored procedures

    Hi,
    As you may guess, i'm new to this.
    I have a stored procedure that does some calculations and creates a list of java objects as the result of the query.
    How would I return the list from the database to the client application?
    Would I have to create an Oracle type that maps to the java object?
    Please help.
    Jag

    Hi Jag,
    Your question is very vague (to me). Perhaps you could post what you have done so far? Have you tried looking through the Sample Code page of the Technet Web site, or tried searching the Ask tom Web site, or MetaLink?
    Good Luck,
    Avi.

Maybe you are looking for

  • Connecting Log & Capture to an External Display

    Forum, I am using FCP for my current project. While logging footage from my camera I thought it would be easier if I could hook up the Preview area of the Log & Capture window to an external device such as a display. Is this possible? How do I achiev

  • How to make repricing for specific conditions at the time of billing?

    Hello I'm SD Pricing person. Let me ask here experts below my concern. In EU countries, there is recycling fee in sales of electronics or Note PC with batteries....to keep our earth clean. So when customers buy such products, they have to pay more as

  • Error while copying Application in Citrix environment

    Dear all: We are on BPC 7.5 SQL2008 Multi-Server environment with Citrix access. When I tried to copy dimension A to B in Citrix's Admin Console, occasionally for some dimensions I would receive the error message: "Could not find "C:\PC_MS\...\'dimen

  • PDF via file to file

    Hi experts, I have now searched quite long in this forum to find some help for my problem but so far I did not succeed. My scenario is simple: one file sender to pick up a pdf file and on the other hand a file receiver to write this pdf document to a

  • My repaint( ) just re-paints but doesn't clear the back

    Hi, i am using repaint( ) with the timer method to randomly draw 100 randomly colored lines.But every time the timer calls actionperformed which contains repaint( ), the application just paints the new 100 lines on top of the old ones, not cleaning t