4 Replies Latest reply on Aug 4, 2009 5:17 AM by Chandru.BS

    Help needed with Flex Client for a C++ based server(using GSoap)

    Chandru.BS

      Hi,

       

      I have created a C++ application, and exposed its functions as a webservice using Gsoap and hosted it on a server.

      Now i want to be able to access the webservices through Flex from different computers ( in the lan).

       

      I'm using Flex builder 3. My problem is the C++ based webservice makes use of datatypes such as vectors of complex datatypes which  consist of other complex datatypes and so on.. ( and are made of of strings and ints at the innermost level)..

      How do i pass the complex datatype as parameters through Flex?

       

      Please do reply.

      Let me know if any more info is needed from my side.

       

      -

      ChandruBS

      chandru.bs4@gmail.com

        • 1. Re: Help needed with Flex Client for a C++ based server(using GSoap)
          JeffryHouser Level 4

          I haven't delt with SOAP web services in quite a while; but wouldn't you just return the data as XML and parse it out in Flex as HTML?

           

          Most server side development platforms have an AMF implementation that can automatically convert backend objects to AS3 objects, even if those objects are nested.  I do not know of a C++ solution for this, but you could create one in theory.  I doubt it is any harder than creating your own application server.

           

          I don't know anything about GSoap, nor why you chose C++ for this application.  But, I have to wonder if you have chosen the best tool for the job.

          • 2. Re: Help needed with Flex Client for a C++ based server(using GSoap)
            Chandru.BS Level 1

            Hi,

            Thanks for ur response.

             

            I have a function in my webservice, which takes no parameters.

            When i make a call to it from Flex, the fault handler is called and

            event.target.toString() shows up the following.


            [WebService  destination="DefaultHTTP" wsdl="http://chandras/CInterface.wsdl" channelSet="[ChannelSet direct_http_channel ]"]

             

            chandras is the name of the machine( both server and client).

             

            my webservice tag in mxml looks like this.

            <mx:WebService id="WSCE" wsdl="http://chandras/CInterface.wsdl" fault="WSfaultHandler(event)">
                    <mx:operation name="CE__cleargData" resultFormat="object" result="WSResultHandler(event)">
                    </mx:operation>
                </mx:WebService>

             

            and i invoke the function ike this.

            WSCE.CE__cleargData.send();

             

            If any1 knows wher the attributes of the webservice tag is explained with examples please share it.

            i want to clearly understand wat destination and channelSet attributes are for..

            Thanks.

            • 3. Re: Help needed with Flex Client for a C++ based server(using GSoap)
              Chandru.BS Level 1

              i solved tat error. i called webservice using only AS.( nothing in mxml).

               

              But still got to figure out how to send and receive complex datatypes.

              The new SDK has support for vector datatypes.

              • 4. Re: Help needed with Flex Client for a C++ based server(using GSoap)
                Chandru.BS Level 1

                i decided to transfer data in terms of structs( not vectors ), and then write wrapper functions to convert to vectors.

                ( using __ptr and __size, which is reqd by GSoap)

                 

                the client generates the required AS classes from the WSDL generated by GSoap.

                I dont need to parse the xml or any such thing now.

                 

                Now i'm able to exchange complex data between Server and Client.