Output table in XML format using web services

I use Labview 8.6 web services to try and a list of power provides a database as XML output. When I table of wire into the Terminal and set the URL for the web services mappings will not build because he says it is an unsupported data type. Any help would be appreciated.

A web service XML LabVIEW 8.6 supports several types of data. A table is not one of these.

The best way to work around this limitation is to use a string instead of the indicator table indicator. The antiderivative of flatten it to XML allows you to convert your table to an XML string.

Alternatively, you can choose your web service method to use the mode of stream instead of the Terminal mode. You can then use the VI of response write in the range of web services to control what to write to the client and when. This seems to be what you mean when you wrote "access to the exit.

By passerby-tables can serve as exits in LabVIEW 2009 Terminal mode.

Nathan

Tags: NI Software

Similar Questions

  • How to get out of scheduled using web service api report

    Hello

    By using the api service report I can run the report query and get the result and save it in a file. But as I'm under the report directly I don't see report running history in BIP UI. (Or there is a way to do what I don't know.)

    So I create a task report and the request for a change it and then call using the api planning service and it works properly gives me a return identification work and I see the history for a job at the BIP UI.

    But I can't find a api that gives me the result of this work.

    All of the suggestions.

    I use eclipse, cfx to generate stubs, and it's a simple java program with access to the web service

    Obtained, he works as below.

    1. Call scheduleReport on SchedulerService to schedule a report and get the scheduled_job_id.
    2. Call getAllScheduledReportHistory on SchedulerService using scheduled_job_id to get the work history that includes the work of the child created by the Scheduler for above child_job_id scheduled_job_id.
    3. Call getScheduledJobInfo on SchedulerService using child_job_id to check whether the job has finished if it is wait for a while, then try again until the work is either successful or failed. The api returns object JobDetails
    4. If the job is successful then check if xmlDataIsAviable for the above job details. If Yes, then call getXMLData on SchedulerService using child_job_id which gives a byte array, write this array of bytes on the disk using the java.io library
    5. Call getScheduledReportOutputInfo on SchedulerService using child_job_id for the information of reportOutput, which is a list of cases
      more than one output format is specified in the report definition to the bi pub. Scan the list for the output_id for the data to the desired output format.
    6. Call getDocumentData on SchedulerService using the output_id above, which gives an array of bytes of report data, and save it using the java.io library

    If you want to avoid voting in step 3 you can configure a httpserver in bi publiher, which is basically a servlet url of a Web application deployed on a server

    Select Server Name URL Default Delete
    BiPubReportsWebApp http://hostname:PortName/webappnameWebApp/servleturi

    and when planning the report in step 1, you can specify these options in the ScheduleRequest element

    scheduleRequest.setNotificationServer (notificationHttpServerName) / /notificationHttpServerName = BiPubReportsWebApp

    scheduleRequest.setNotifyHttpWhenFailed (true);

    scheduleRequest.setNotifyHttpWhenSkipped (true);

    scheduleRequest.setNotifyHttpWhenSuccess (true);

    scheduleRequest.setNotifyHttpWhenWarning (true);

    So when the work is done bi publisher will make a post to you request httpservlet with jobid, reporturl, jobstatus, so you can use this jobid (which corresponds to the id of child labour) to perform steps 4 and following

    Another thing to note is step 6 gives the byte array return which may be huge in big reports and you can go outofmemeory in this case

    (1) request to the server to save the xml data and output on the server and returns the path where these files have been saved by using downloadXMLData and downloadDocumentData to the SchedulerService, and then tokensize the string to get the last piece

    (2) call downloadReportDataChunk of the report (in a loop) service to get the data for the xml data and the document into segments giving him the name of the file in step 1, a start index and chunksize

    While (offset! = - 1) {}

    LOG.debug ("Getting chunck number :->" + counter + "index :->" + beginIdx);

    ReportDataChunk reportDataChunk = getReportDataChunks (tmpFileNameOnServer, beginIdx, util.chunkSize);

    data = reportDataChunk.getReportDataChunk ();

    output. Write (Data);

    beginIdx = beginIdx + util.chunkSize;

    offset = reportDataChunk.getReportDataOffset ();

    counter ++;

    }

    public ReportDataChunk (String starts, int beginIdx, int size) getReportDataChunks survey com.oracle.xmlns.oxp.service.v2.reportservice.OperationFailedException_Exception,

    {com Oracle.xmlns.OXP.service.v2.ReportService.AccessDeniedException_Exception}

    ReportDataChunk reportDataChunk is getReportServicePort () .downloadReportDataChunk (starts, beginIdx, size, getUsername(), getPassword());.

    Return reportDataChunk;

    }

    Note: when you schedule a report using schedulereport pub bi api back you a job id but matching so that it creates a Collard work with a different id that does the job and this childjobid is given when using the method of notification httpserver.

  • How to expose a function that returns a XML as a Web Service?

    ---------------------------------------------------------------------------------
    Oracle Database 11 g Release 11.2.0.3.0 - 64 bit Production
    PL/SQL Release 11.2.0.3.0 - Production
    "CORE 11.2.0.3.0 Production."
    AMT for 64-bit Windows: Version 11.2.0.3.0 - Production
    NLSRTL Version 11.2.0.3.0 - Production
    ---------------------------------------------------------------------------------

    After reviewing the documentation of oracle on the generation of xml data in the database, I managed to select normal tables and return a result xml exactly as I want:
    -- My types
    create or replace 
    TYPE CHILD_T AS OBJECT ("@ID" VARCHAR2(20), "@NAME" VARCHAR2(20));
    
    create or replace 
    TYPE CHILDREN_T AS TABLE OF CHILD_T;
    
    create or replace 
    TYPE PARENT_T AS OBJECT ("@ID" VARCHAR2(20), CHILDREN CHILDREN_T );
    
    -- The actual select
    SELECT XMLFOREST (
                PARENT_T(d.id,
                CAST ( MULTISET (SELECT c.id, c.name
                                 FROM child c
                                 WHERE c.parent_id = p.id) AS CHILDREN_T )
                ) AS "Parent"
            ) 
    FROM parent p;
    That gets me this:
    <Parent ID="1">
        <CHILDREN>
            <CHILD_T ID="1" NAME="xxxxx" />
            <CHILD_T ID="2" NAME="yyyyy" />
            <CHILD_T ID="3" NAME="zzzzz" />
        </CHILDREN>
    </Parent>
    It's perfect, but how to expose this result as a Web Service like this link?
     http://localhost:8080/orawsv/MY_USER/GET_CHILDREN?wsdl
    I tried this function:
    FUNCTION GET_CHILDREN (
        PARENT_ID IN VARCHAR2
    ) RETURN CLOB
    AS
        L_RESULT CLOB;
    BEGIN
        SELECT to_clob(XMLFOREST (
                PARENT_T (p.id,
                CAST ( MULTISET (SELECT c.id, c.name
                                 FROM child c
                                 WHERE c.parentId = p.id) AS CHILDREN_T )
                ) AS "ParentObj"
          )) AS MY_XML INTO L_RESULT
        FROM parent p
        WHERE p.i = PARENT_ID;
    
        RETURN (L_RESULT);
    END GET_CHILDREN;
    But when I access although .NET Compact Framework, I get this: "'Element' is an invalid XmlNodeType.

    As you can see, I just need a simple way to transport information between a Windows CE handheld computer and our database. Use functions that return simple values.
    Do I have to return the data as xml?
    What return value I should use? Varchar2 throws a buffer error output.

    ---------
    It is my first post here, also my first contact with OracleDB, and Web Services.

    Hello

    Welcome to Oracle and XML DB!

    After reviewing the documentation of oracle on the generation of xml data in the database, I managed to select normal tables and return a result xml exactly as I want:

    Have you also read about the SQL/XML functions?
    You don't have to create objects of type SQL to generate XML data.

    Using only XMLElement, XMLAgg, XMLAttributes, etc., you should be able to generate any kind of structure complex relational data and with total control over the names (which you don't have with the types of objects).
    Your example can be rewritten to:

    SELECT XMLElement("Parent",
             XMLAttributes(p.id as "Id")
           , XMLElement("Children",
               (
                 SELECT XMLAgg(
                          XMLElement("Child",
                            XMLAttributes(
                              c.id as "Id"
                            , c.name as "Name"
                            )
                          )
                        )
                 FROM child c
                 WHERE c.parent_id = p.id
               )
             )
           )
    FROM parent p
    WHERE p.id = :parent_id ;
    

    It's perfect, but how to expose this result as a Web Service like this link?
    [...]
    Do I have to return the data as xml?

    Yes.
    Define the return as XMLType data type:

    FUNCTION GET_CHILDREN (
        PARENT_ID IN VARCHAR2
    )
    RETURN XMLTYPE
    AS
        L_RESULT XMLTYPE;
    BEGIN
    
      SELECT XMLElement("Parent",
               XMLAttributes(p.id as "Id")
             , XMLElement("Children",
                 (
                   SELECT XMLAgg(
                            XMLElement("Child",
                              XMLAttributes(
                                c.id as "Id"
                              , c.name as "Name"
                              )
                            )
                          )
                   FROM child c
                   WHERE c.parent_id = p.id
                 )
               )
             )
      INTO L_RESULT
      FROM parent p
      WHERE p.id = PARENT_ID ;
    
      RETURN (L_RESULT);
    
    END GET_CHILDREN;
    
  • XPath with XML from a Web Service

    Hello

    I've been tweaking data traction of a webservice and have managed to get the results that I need so I'm now at the stage where I want to do something useful with the XML that is returned, so I played with Xpath.

    I understand I can use Xsearch to draw the nodes of the XML object rather than having to write the XML to a file and then look in the file. The problem I have is that when I use Xsearch it does not extract data I'll be waiting.

    Here is the XML that is returned by the web service, which I attribute to the variable xmlReturned:

    <? XML version = "1.0" encoding = "utf-8"? >

    " < envelope soap: xmlns:soap = ' http://schemas.xmlsoap.org/SOAP/envelope/ "" xmlns: xsi = " " http://www.w3.org/2001/XMLSchema-instance "container =" " http://www.w3.org/2001/XMLSchema ">

    < soap: Body >

    " < GetChildLocationsResponse xmlns =" http://tempuri.org/VillarentersWebService/villa_search ">

    < GetChildLocationsResult >

    < RequestedParentID > 3924 < / RequestedParentID >

    < VRF / >

    < ChildLocations >

    < location >

    < LocationRef > 10 < / LocationRef >

    the Argentina < LocationDescription > < / LocationDescription >

    < ParentID > 3924 < / ParentID >

    < / location >

    < location >

    < LocationRef > 30 < / LocationRef >

    Brazil < LocationDescription > < / LocationDescription >

    < ParentID > 3924 < / ParentID >

    < / location >

    < / ChildLocations >

    < / GetChildLocationsResult >

    < / GetChildLocationsResponse >

    < / soap: Body >

    < / envelope soap: >

    So, when I use:

    < cfset locDescription = XmlSearch (xmlReturned, "//LocationDescription") / >

    < cfdump var = "#locDescription #" >

    I expect to see an array of 2 elements, the Argentina and the Brazil. What I actually get is an empty array. I tried using a Xpath Checker convenient online at http://www.zrinity.com/xml/xpath/index.cfm and I get the same result. I tried a little research different but every time the table is empty.

    Does anyone know why it is not pulling the knots required in the table? Am I missing something simple here?

    Or you could represent the namespaces in your xpath xmlsearch properties.

    Here is the first link that I got from a Google search for"namespace xmlsearch.

    http://www.aftergeek.com/2006/08/xmlSearch-XPath-and-XML-namespaces-in.html

  • Download image pieces bmp to xml from the web service

    You try to download a bmp, in blocks of 10,000 bytes, using a .net web service.

    I get an error because of the bmp bytes.

    How the octets must be encoded?

    XML uses utf8 text, you'll have to urlencode (base64) bytes, similar to an email.

  • How to create the data control to a custom object of sale cloud using web service.

    Hi all

    I'm working on a requirement I need to display the common custom object data and their children object. After the display of the data user will be able to select multiple records by using the check box and then update the State to close.

    So basically, I need to create a table in which the data will fill with the checkboxs and when the user clicks on the button update then I need to update a field in the parent object.

    Any help would be appreciated.

    Thank you

    You must follow the steps below

    1. right click on the template project, select the new option

    2 Select the data control in the left hand side of the tab "All Technologies"

    4 Select "control of data from the Web Service" in the right side panel

    3. Enter the name of the data control (custom name)

    4. provide your WSDL to the URL https://crm-domain.oracleoutsourcing.com/foundationCustExtn/CrmCommonReferenceService?wsdl

    5. click Next, next if all methods to winow than wsdl, mix to the right and click Finish button

    6 refresh "data control" in your right side panel to request

    7 expand control of data and select only control data that you have already given

    8. then you can see the methods that comes from your wsdl.

    9. Select the method and expand it, you will get the return values

    10. drag and drop the return as a table value, you will get the af:table on the page

    11. don't want to operatet this table.

  • Need help in generating XML data to a table in XML format

    Hi all

    I need help to generate an xml file using the data below.

    The table name is T_Data have 4 columns as shown below with data.

    Neighbourhood region Division
    ---------- ----------------------- ----------- -----------
    Northwest Northern California San Jose SJStore1
    Northwest Northern California San Jose SJStore2
    Northwest North of California to the North of THE LAStore1
    Northwest North of California to the North of THE LAStore2
    Northwest North of California to the North of THE LAStore3

    I want to generate an XML file using SQL/XML functions and the XML file should look like as below.

    <>region
    < name of region > Northwest < / name of the region >
    < Division >
    Northern California < division name > < / Division name >
    District of <>
    SanJose < district name > < / District name >
    <>store
    < store name > SJStore1 < / name >
    < store name > SJStore2 < / name >
    < / store >
    < / district >
    < / division >
    < / region >

    Very much appreciate your help here.

    Thank you.

    I tried to group the lines, but they did not then provide a correct output.

    To unflatten dataset, we can use nested GROUP-BY subqueries.

    The following will produce a line by region.
    If all regions must be grouped in a single root element (does not so appear according to the directives of the sample), we just add an another XMLAgg.

    SQL> with sample_data as
      2  (
      3    select 'Northwest' reg, 'Northern California' div, 'San Jose' district, 'SJStore1' st from dual union all
      4    select 'Northwest' reg, 'Northern California' div, 'San Jose' district, 'SJStore2' st from dual union all
      5    select 'Northwest' reg, 'Northern California' div, 'North LA' district, 'LAStore1' st from dual union all
      6    select 'Northwest' reg, 'Northern California' div, 'North LA' district, 'LAStore2' st from dual union all
      7    select 'Northwest' reg, 'Northern California' div, 'North LA' district, 'LAStore3' st from dual
      8  )
      9  select reg
     10       , xmlserialize(document
     11           xmlelement("Region"
     12           , xmlelement("RegionName", reg)
     13           , xmlagg( division_xml )
     14           )
     15           indent -- for display purpose
     16         ) as region_xml
     17  from (
     18      select reg
     19           , xmlelement("Division"
     20             , xmlelement("DivisionName", div)
     21             , xmlagg( district_xml )
     22             ) as division_xml
     23      from (
     24          select reg
     25               , div
     26               , xmlelement("District"
     27                 , xmlelement("DistrictName", district)
     28                 , xmlelement("Store"
     29                   , xmlagg(
     30                       xmlelement("StoreName", st)
     31                     )
     32                   )
     33                 ) as district_xml
     34          from sample_data
     35          group by reg
     36                 , div
     37                 , district
     38      )
     39      group by reg, div
     40  )
     41  group by reg ;
    
    REG       REGION_XML
    --------- --------------------------------------------------------------------------------
    Northwest 
                Northwest
                
                  Northern California
                  
                    North LA
                    
                      LAStore1
                      LAStore3
                      LAStore2
                    
                  
                  
                    San Jose
                    
                      SJStore1
                      SJStore2
                    
                  
                
              
     
    
  • from xml to a web service

    Hi all

    I'm trying to capture some xml that is passed to a web service that I've created. I put the argument of a type XML. When I go back to the argument, the contents of the returned file seems to approximate the XML passed to the web service. However, I can't access XML from webservice.

    I tried to do a cfdump to a file inside of the XML web service and all I get are all statements of java object, no XML. I try to call the java object functions and I get nothing. I tried access to content the XML elements using the ColdFusion syntax, and it said that items doen't exist.

    If someone has an idea, it would be appreciated.

    Thank you
    Jim

    OK, thank you Adam for wasting your time to help me. Yes, it worked. I don't have any ZIP code because everything I had, it was like four lines, I tried to publish a webservice for ColdFusion, another is the part of your. So, this is all it is:





    The problem was that the discharge was the definition of the java object, not the XML. I didn't know how to access the XML component, or if he existed, that makes the xmlsearch. Also, any namespace prefixes are changed when the XML arrives, so if you have a tag like , when it comes into service web CF it is changed to .

    If the combination of these two throw me off the coast.

    Thanks for the help,
    Jim

  • Best way to escape from insert on string literals by using web services

    I have a case where an opportunity name contains something like: "example of Texas-scanning-5/19/11 ' and the web service that creates work orders because it returns java.lang.Exception: field 'Opportunity name' in the case of ' OnDemand custom object 1' integration component contains an invalid query expression: ="example of Texas-Scanning-5/19/11 '(SBL-EAI-13002),»»

    I want to escape
    opportunity.setOpportunityName (StringEscapeUtils.escapeSql (opportunity.getOpptyName ())); Opportunity name

    But now, it returns
    Can not find the entry "=" example "s of Texas-scanning-5/19/11" in the list of choices limited for the 'Opportunity name' field 'custom object 1' integration component (SBL-EAI-04401) < / siebelf:errormsg > < / siebelf:error > < / siebelf:errorstack >

    Nobody knows the right way to escape this string?

    Edited by: kroberts may 20, 2011 12:23

    I think you should replace each tick with two ticks, but only in the value of the current field.

    Your original search term
    = "Example of Texas-scanning-5/19/11 '.

    Should be
    =' Example "s of Texas-scanning-5/19/11 '

  • Tween &amp; amp; Using Web Service component.

    I am trying to build a component for which I enter a parameter value, and he calls a web service, retrieves the data, then tweens a movieclip based on value.

    I can't be able to access the label in the component to display data, call webservice.onResult. I'm so lost!

    I'd like to help! I'm in a period too! Aaah actionscript!

    "Thi" inside an event normally refers to the object that holds this event, so inside "onResult", it refers to the PendingCall object. It is not property _parent in that, if you can not the component in this way. Instead, try to pass a reference to the component to the event:

    var = me this; in openService()
    wsGetAllVals.onResult = function (result)
    {
    me.sensorMax = '400 ';
    trace ("all the received values");
    var splitArr:Array = result.split(";");

    me.sensorMax = this.lblMax splitArr = [6] .substring (9.15);
    me.sensorMin = this.lblMin splitArr = [5] .substring (9.15);
    sensorUnit = lblUnit splitArr = [3] .substring (6.25);
    trace (splitArr);
    trace (sensorMax);

    _root.sensorMax = me.sensorMax;

    trace (_root.sensorMax);
    }

    I also noticed that the init() function is nested in the openService() function in the code, is that correct? Don't know if it's important, but I thought it should be part of the class, not a feature in this class.

    HTH,
    blemmo

  • Using Web Services query retrieves the lookup ID

    Hello
    I noticed that querying via webservices retrieves the lookup ID value and not the value indicated in the application (if the ID is different from the value). Could not retrieve the value? I need this emergency information as its impact on some of our Web based service applications.

    Thank you
    m

    Hello

    It's true on the question of field lookup on an object, it retrieves only the Ids and not values, but if you intend to match it with display value that you can use GetPicklistValues of the Service API that retrieves the ID and display value that can be sought for a particular ID.

    Messer

  • After you generate a table in xml format, how can I save the result in an XML table?

    Hi all
    I used this feature to create a table in the XML schema:
    example:
    SELECT xmlelement ("State", xmlattributes (http://www.opengis.net/gml as "xmlns:gml"),)
    XMLFOREST (name as "Name", "Population" of the population)) of the State;
    result:
    < Statexmlns:gml = "http://www.opengis.net/gml" >
    < name > Wilkopolska < / name >
    the population of 35000 <>< / Population >
    < / state >
    Now I need to insert the result in an XML table, because I need to save the result to use the latter, I hope someone can help, and if there is other way to do this, it would be great.
    Thanks an ot and best regards,
    Lama.

    Just insert in a table...

    insert into t
    SELECT xmlelement("State", xmlattributes( 'http://www.opengis.net/gml' as "xmlns:gml"),
    xmlforest(name as "Name", population as "Population")) from state; 
    

    and a complete example:

    SQL> create table t (test xmltype)
      2  /
    
    Table created.
    
    SQL>
    SQL> create table state
      2  (name varchar2(10)
      3  ,population number
      4  )
      5  /
    
    Table created.
    
    SQL>
    SQL> insert into state values ('WI', 35000)
      2  /
    
    1 row created.
    
    SQL>
    SQL> SELECT xmlelement("State", xmlattributes( 'http://www.opengis.net/gml' as "xmlns:gml"),
      2  xmlforest(name as "Name", population as "Population")) from state; 
    
    XMLELEMENT("STATE",XMLATTRIBUTES('HTTP://WWW.OPENGIS.NET/GML'AS"XMLNS:GML"),XMLFOREST(NAMEAS"NAME",P
    ----------------------------------------------------------------------------------------------------
    WI35000
    SQL>
    SQL> insert into t
      2  SELECT xmlelement("State", xmlattributes( 'http://www.opengis.net/gml' as "xmlns:gml"),
      3  xmlforest(name as "Name", population as "Population")) from state; 
    
    1 row created.
    
    SQL> select *
      2    from t
      3  /
    
    TEST
    ----------------------------------------------------------------------------------------------------
    WI35000
    
  • using Web services

    I need to know a simple way to connect the webservice with SOAP and as json. can anyone help the simple way to create SOAP ws, with the exception of the sample code.

    in the code example (soapxml) hard to find the new value(eg: weatherid) statement. can any body help concepts ws...

    Please mark the thread as solved if you solved your problem.

    You must include qtsoap.h/MPC in each project that you want to use.
    Optionally, you can create a stand-alone library of her, but I'm not sure it's worth the hassle.

  • Web services with xml file

    Hello

    How read xml file using web services?

    Here's my cfc web services: (I just want to see how to read the xml file)

    < cfproperty >

    < name cffunction = "getBooks" access = "remote" returntype = "string" output = "no" >

    < cfargument "xmlObject" type = name = "xml" required = "yes" >

    < cfset BookResponse = "" > "".

    < cfset var arrIndx = "" > "".

    < cftry >

    < = cfloop '1' to = "#ArrayLen (arguments.xmlObject.XmlChildren)" # "index ="arrIndx">"

    < cfset BookResponse = arguments.xmlObject.XmlChildren [arrIndx]. XmlName >

    < / cfloop >

    < cfcatch type = "any" >

    < cfset BookResponse = ' #cfcatch.message # #cfcatch.detail # ' >

    < / cfcatch >

    < / cftry >

    < cfreturn BookResponse >

    < / cffunction >

    < / cfproperty >

    Here my code to test web services:

    1. define the XML

    <!-installation of the XML to work with->

    < cfsavecontent variable ="XMLFile"><? XML version ="1.0"? >

    < root >

    < header >

    < user > 1 < / user >

    < / header >

    < book >

    0321330110 < isbn >< / isbn >

    < title > Macromedia ColdFusion MX 7 Certified Developer Guidestudy / < /title >

    < author > BenForta / < / author >

    < / book >

    < header >

    < user > 2 < / user >

    < / header >

    < book >

    0596004206 < isbn >< / isbn >

    < title > Learning XML, secondedition / < /title >

    < author > ErikRay / < / author >

    < / book >

    < header >

    < user > 3 < / user >

    < / header >

    < book >

    0782140297 < isbn >< / isbn >

    < title > ColdFusion Developer's GuideMX / < /title >

    < author > RaymondCamden / < / author >

    < / book >

    < / root >

    < / cfsavecontent >

    2 call web services

    < cfinvoke

    method = "getBooks".

    returnvariable = "rawXMLBookList."

    " webservice =" http://localhost/Hoteleria/WebServices/books.cfc?wsdl "> "

    < name cfinvokeargument = "xmlObject" value = "#XMLFile #" >

    < / cfinvoke >

    <!-< cfset XMLDocResult = XmlParse (rawXMLBookList) >

    < cfdump var = "#XMLDocResult #" >-->

    < cfdump var = "#rawXMLBookList #" >

    3 error: Element XMLOBJECT. XMLCHILDREN is undefined in ARGUMENTS.

    I also try using XMLParse without success.

    Any ideas?

    Thank you

    Sorry about that. It worked for me!

    What about doing it on the basis of chains, as follows:

    Books.CFC

    #arguments.xmlString #.

    testPage.cfm


    1

    0321330110

    Certified Macromedia ColdFusion MX 7 Developer Study Guide

    Ben Forta

    2

    0596004206

    Learning XML, second edition

    Erik Ray

    3

    0782140297

    ColdFusion MX Developer's Handbook

    Raymond Camden

    <>

    method = "getAuthors".

    returnvariable = "authorList.

    "WebService ="http://localhost/Hoteleria/webServices/books.cfc?wsdl ">

  • How send to an XML web service?

    I am brand new to Flex. I am writing a program that uses web services to send and receive data. I got so that he can receive the XML of the web service. However, I also need to send it, and I'm stuck.

    I tried the following code:

    < mx:WebService id = "MyService".
    "WSDL =" http://localhost/FlexTest/service1.asmx?WSDL "
    useProxy = "false".
    result = "resultHandler (Event)" >

    <!-Entry: XML Document... Output: String->
    < mx:operation name = "HelloPersonAcceptsXmlDocumentReturnsString" >
    < mx:request >
    < personXmlDoc > xmlPerson < / personXmlDoc >
    < / mx:request >
    < / mx:operation >

    <!-Entry: XML node... Output: String->
    < mx:operation name = "HelloPersonAcceptsXmlNodeReturnsString" >
    < mx:request >
    < personXmlNode >
    xmlPerson.Person
    < / personXmlNode >
    < / mx:request >
    < / mx:operation >

    <!-Entry: String (XML Format)... Output: String->
    < mx:operation name = "HelloPersonAcceptsXmlStringReturnsString" >
    < mx:request format = "xml" >
    "< personXmlString > < p1:Person xmlns:p1 =" http://impact-tech.com/schemas/FlexTest "> < p1:ID > f1bd45fc - 544 b-489 d-83cf-349d1f9740ec < / p1: I D > < p1:FirstName > Joe < / p1:FirstName > < p1:MiddleName > c. < / p1:MiddleName > < p1:LastName > kick < / p1:L astName > < p1:BirthDate > 2006-09-11 T 14: 03:04.4755443 - 04:00 < / p1:BirthDate > < p1:IsMarried > < /p1:IsMarried > false < p1" : NumChildren > 0 < / p1:NumChildren > < p1:NetWorth > 100000 < / p1: NetWorth > < / p1: Pers on > < / personXmlString >
    <!-{xmlPerson.toXmlString ()} < personXmlString > < / personXmlString >->
    <!-{txInput.text} < personXmlString > < / personXmlString >->
    < / mx:request >
    < / mx:operation >

    < / mx:WebService >

    In the first operation, 'HelloPersonAcceptsXmlDocumentReturnsString', I try to send an XML object. During the second operation, 'HelloPersonAcceptsXmlNodeReturnsString', I try to send the root node, xmlPerson.Person. In both cases, what is actually sent is literally the text that I put in the node < application >, not the object the text refers. For the first, "xmlPerson" then gets sent to the target, not the XML doc what it refers to.

    In the third operation, I tried three different things, and two are commented. I tried to refer to the XML object using the toXmlString() method, but again, it has literally sent the text "xmlPerson.toXmlString ()". I tried the brace link, but then nothing is sent to the web service. I also tried to build the XML node and with values, but I get an error from the web service saying that it cannot be analyzed because there is an illegal line 1, position 1 character. The only thing that worked was to add a text entry box, copy - paste the exact same structure XML that I tried to build manually and then use binding to the text property of the control InputText. Then it works fine. But I can't actually do, it's just to test.

    So my question is how a < application > node that is part of the web service operation that makes reference to an object and sends the value of this object to the web service, not literally all text is typed into this node. I looked at Web Services and sections of the help data binding and did not see examples on this. Everything was much more simplistic with binding to controls. Can someone help a newbie, please?

    I do not understand how this isn't a matter of Flex Builder, since it has to do with how Flex Builder interacts with web services and how objects are used in the binding in MXML.

    But anyway, I got this code for future reference of someone else to research work in this forum:

    Declare a custom in MXML class has been the key to allow the correct link:


    "WSDL =" http://66.129.123.211/FlexTest/service1.asmx?WSDL "
    useProxy = "false".
    result = "resultHandler (Event)" > "




    {testPerson.GetXmlDoc ()}

Maybe you are looking for