Send a json string to an HTTP in labview

Hi,
I need to assing values to an HTTP site by sending a json string, I have been trying using the HTTP client PUT vi with no success, does anyone have an easy way of sending a json string to an HTTP site in labview thru the PUT method???
Thank you

What have you tried?
This should work as a basic example:
If you have LabVIEW 2013 or newer, there are built-in VIs for encoding/decoding JSON strings to/from LabVIEW clusters.
Certified LabVIEW Architect, Certified TestStand Developer
NI Days (and A&DF): 2010, 2011, 2013, 2014
NI Week: 2012, 2014
Knowledgeable in all things Giant Tetris and WebSockets

Similar Messages

  • Adding a JSON string to an outbound RESTful call in OSB 11.1.1.6

    Inside my Proxy Service Message Flow (OSB 11.1.1.6) I have generated a JSON string and stored it in a variable named $jsonReq.
    In my Routing action, I point to a Business Service whose Service Type is "Messaging Service" with both Request/Response Message Types as "Text".
    What is the proper way to assign the $jsonReq variable's contents to the outbound request body (I am doing a POST)?
    I have tried a number of configurations, but to no avail (though I see the JSON contents when I dump it out in a Log action), such as:
    Insert
    Expression: $jsonReq
    Location: as first child of
    XPath: .
    In Variable: outbound
    Please advise.
    Thank you,
    Michael

    Hello Prabu,
    Thank you for the suggestion. Assigning it to the body didn't work. I changed my configuration to this:
    Insert
    Expression: $jsonReq
    Location: as first child of
    XPath: .
    In Variable: outbound
    The net effect that I can see via the Test Console invocation tracing is that the change from:
    RouteToMyBusinessService -> Message Context Changes -> changed $body
    <soap:Body xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <!-- our original body from the proxy service inbound SOAP message -->
    </soap:Body>
    to
    RouteToMyBusinessService -> Message Context Changes -> changed $body
    <soap:Body xmlns:soap="http://www.w3.org/2003/05/soap-envelope"/>
    I know that the $jsonReq has data in it (per a log statement I made: <Jun 6, 2013 7:55:40 AM CDT> <Debug> <ALSB Logging> <BEA-000000> < [RouteToSCCreateBAMLabsProfileBusSvc, null, null, REQUEST] Inserted {"firstName":"string","lastName":"s","email":"stringstring","Login":"string","timeZone":"America/Montevideo","address":{"streetOne":"string","streetTwo":"string","city":"string","state":"st","zipCode":"string","country":"string"},"equipment":{"e":{"type":"Bed","code":"string","serial":"string","sku":"string","version":"string","dateOfPurchase":"2013-11-23T08:44:07"}}} into body> ).
    So why would the body be empty when I use the Insert action listed above?
    On a side note, is there only one 'body' variable in a proxy message flow? How do I distinguish between the body of the incoming request, the body of the [transformed] outgoing business service request, the body of the business service response and the body of the [transformed] proxy service response?
    Thanks again,
    Michael

  • Problem after upgrade 11.1.1.6 - "Invalid JSON String"

    Dear All,
    after upgrade OBIEE to 11.1.1.6 I'm receiving an error message: "Invalid JSON string: 0 {t:1}:" when I'm trying to populate Dashboards, Catalog or even Help option.
    I've check with firebug that POST data are send and in fact I'm getting all data in a background - server response is correct,
    but instead of getting a correct view I have "Invalid JSON string :0 {t:1}:" message. Message comes from res/b_mozilla/common.js file.
    Cache has been also cleared.
    Any ideas what went wrong?
    Thanks'
    Regards.
    Edited by: user623575 on Mar 29, 2012 1:13 AM

    Hi,
    The error message "Invalid JSON string: 0 {t:4}" due to your Analytics Application was not re-deployed properly and also sometimes your javascript is still 11.1.1.5 version catched.
    1) to resolve this issues can you please Clear the browser cache and re-load the page or log in to OBIEE.
    2)if its not working then try to Re-deploy the Analytics Application, using the file $Middleware_Home\Oracle_BI1\bifoundation\jee\analytics.ear
    know Bug Ref:
    This is a known bug in OBIEE 11.1.1.6.0
    BUG:13845528 - UPGRADING TO 11.1.1.6, ANALYTICS DOES NOT WORK IN FIREFOX 10.0.2 ON WINDOWS 7 PC
    Please refer the below doc
    OBIEE 11g: Error: "Invalid JSON string: 0 {t:4}" Logging into OBIEE 11.1.1.6.0 after Upgrade [ID 1439063.1]
    Thanks
    Deva

  • Parse JSON string

    Hi,
    I'm parsing this JSON string with the libs in org.json and I can't understand why I get the output below into the log.
    ArrayList<String> al = new ArrayList<String>();
    JSONObject demo = new JSONObject("{\"00408C88A2E6\":{\"id\":\"00408C88A2E6\",\"name\":\"Lab\"},\"00408C91188B\":{\"id\":\"00408C91188B\",\"name\":\"Lab1\"},\"00408C944B99\":{\"id\":\"00408C944B99\",\"name\":\"Lato1\"},\"00408C944BA0\":{\"id\":\"00408C944BA0\",\"name\":\"Lato\"}}");
    Iterator<String> iterator =  demo.keys();
    while (iterator.hasNext() ){     
         al.add((String)iterator.next());
         Log.i(LOG_TAG, "size al into while " + al.size());
         Log.i(LOG_TAG, "MAC " + iterator.next() + " for the user " + userId);
    }Log output
    07-12 08:55:34.056: INFO/parse(285): size al into while 1
    07-12 08:55:34.056: INFO/parse(285): MAC 00408C91188B for the user nweb
    07-12 08:55:34.066: INFO/parse(285): size al into while 2
    07-12 08:55:34.066: INFO/parse(285): MAC 00408C944B99 for the user nweb
    07-12 08:55:34.066: INFO/parse(285): size al 2Should not have 4 elements in my ArrayList?
    Thank you

    mlipreri wrote:
    Thank you, I'm really new on this and it's a newbie error, I wasted 2 days for it :)In those two days, did you ever take the time to read the javadocs of the classes you are using?
    If not, then that would be a big improvement right there that will seriously shorten the times you have to struggle, plus give you more possibility to resolve issues yourself.
    [http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/|http://download.oracle.com/docs/cd/E17409_01/javase/6/docs/api/]

  • Using SKPTSMTPMessage how to send a variable String?

    I am using SKPTSMTPMessage to send an email in the background but I need to send a variable string. I have tried putting a %@ in the text but it just sends the %@ and not a variable. Please Help?
    Hopefully, iCrazy23

    Did you ever figure out how to do this?  Because actually I'm trying to do pretty much exactly the same thing.  I'm actually having trouble even outputting the digital signal at all with my USB-6501.  I was initially trying to use DAQ Assistant, but then found out I probably shouldn't be using this and instead should be using the DAQmx individual functions.  I was directed by NI Support to look at the example "Gen Dig Pulse Train-Continuous.vi," but I haven't been able to figure out how to use this for my application.   For my project I  want to send a TTL signal to vavles that release fluids as well.  I have 3 2-way liquid releasing valves that I want to be synced so that only one is open at a time (for a user specified amount of time), and they open in a regular repeating sequence.  I also have another 3-way valve controlling a vacuum that I would like to be continuously pulsing, but for specified amounts of time (e.g., 3 seconds open, 3 seconds closed, and so on).
    I believe I can figure out the logic and the programming involved with figuring out the exact sequencing and timing manipulation, however, I'm having trouble just being able to output any digital signal with a varying time.  If you could offer any help on this, it would be greatly appreciated.  Thanks!

  • How to Call HTTP Sender Adapter of Other Scenar from HTTP Receiver Adapter?

    Hi,
    I have a requirement to call HTTP Sender Adapter of Other Scenario from HTTP Receiver Adapter?
    or
    call SOAP Sender Adapter of Other Scenario from SOAP Receiver Adapter?
    i.e
    SOME SENDER - > PI - > HTTP Receiver - > calling -> HTTP Sender -> PI -> SOME RECEIVER
    SOME SENDER - > PI - > SOAP Receiver - > calling -> SOAP Sender -> PI -> SOME RECEIVER
    if any one can provide me the screen shot for those SOAP / HTTP Sender or Receiver ADAPTER.
    or Point me to Some article with Screenshots .
    That would be appreciated with Point.
    Regards
    PS.

    Solved .  .

  • Problem - insert JSON string into table in CLR function

    Hi
    I create a CLR function to insert JSON string into table.
    With this line 
    mt = JsonConvert.DeserializeObject<MyTable>(jsonStr.ToString());
    The class is OK (no error), but when I try to add the Assembly in Microsoft SQL Server Management Studio, it has error :
    Assembly 'newtonsoft.json, version=4.5.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed.' was not found in the SQL catalog.
    (I have Newtonsoft.Json in the Reference)
    Please help !
    Thanks

    Hi Bob
    Could you elaborate a bit more?
    I think the code is ok. The problem is when I deploy the Visual Studio creates/alters the assembly, and get the error
    Error:  SQL72014: .Net SqlClient Data Provider: Msg 6503, Level 16, State 12, Line 1 Assembly 'newtonsoft.json, version=6.0.0.0, culture=neutral, publickeytoken=30ad4fe6b2a6aeed.' was not found in the SQL catalog.
    ALTER ASSEMBLY [Database1]
        FROM 0x4D5A90000300000004000000FFFF0000B800000000000000400000000000000000000000000000000000000000000000000000000000000000000000800000000E1FBA0E00B409CD21B8014CCD21546869732070726F6772616D2063616E6E6F742062652072756E20696E20444F53206D6F64652E0D0D0A2400000000000000504500004C0103000DE411540000000000000000E00002210B010B000012000000060000000000008E3000000020000000400000000000100020000000020000040000000000000006000000000000000080000000020000000000000300608500001000001000000000100000100000000000001000000000000000000000003C3000004F00000000400000A802000000000000000000000000000000000000006000000C000000042F00001C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000200000080000000000000000000000082000004800000000000000000000002E7465787400000094100000002000000012000000020000000000000000000000000000200000602E72737263000000A8020000004000000004000000140000000000000000000000000000400000402E72656C6F6300000C0000000060000000020000001800000000000000000000000000004
    An error occurred while the batch was being executed.
    Done building project "Database1.sqlproj" -- FAILED.
    This is my FillRow function. Without the bold line, the everything is fine. I can create the assembly, then create the SQL function. Done. When I call select from the SQL function, it returns 10 rows as expected.
    public static IEnumerable getTable(SqlString jsonStr)
            ArrayList resultCollection = new ArrayList();
            MyTable mt;
            //mt = JsonConvert.DeserializeObject<MyTable>(jsonStr.ToString());
            int c = 1;
            while (c < 10)
                mt = new MyTable();
                mt.GlobalId = c.ToString();
                mt.DateSet = "DS=!=" + c.ToString();
                mt.Timestamp = "TS==" + c.ToString();
                mt.PartnerId = "PI==" + c.ToString();
                mt.PartnerUserId = "PUI=" + c.ToString();
                mt.UserIP = "UIP=" + c.ToString();
                mt.UserAgent = "UG=" + c.ToString();
                mt.Referer = "R=" + c.ToString();
                resultCollection.Add(mt);
                c++;
            //resultCollection.Add(mt);
            return resultCollection;

  • Storing JSON string into Oracle table

    Hi,
    What is appropriate way to store JSON string into Oracle table?
    Regards
    Peter

    If JSON becomes more popular, ORACLE might write data cartridge extension for JSONDB (in the same way as XMLDB).
    Till then CLOB and NCLOB is your best choice, and leave the parsing in your application layer.

  • Cfchart and JSON string representation

    I am trying to pass a JSON string representation for the attribute "plotarea" in this way :
    <cfchart
    chartWidth="800"
    chartHeight="600"
    showLegend="yes"
    format="png"
    title="Commandes"
    plotarea='#{"margin-top":"dynamic"}#' >
    But I got following error :
    Error casting an object of type to an incompatible type. This usually indicates a programming error in Java, although it could also mean you have tried to use a foreign object in a different way than it was designed.
    Is there any documentation explaining how to use "JSON string representation" in cfchart attributes ?

    Code_Worm wrote:
    Is it possible for me to call my toString method of Manager class within Branch class?Sure as long as it is public. There is no magic or any difference in regards to the toString method to any other method that you create. So somewhere in your Branch class you have:
    String blah = manager.toString();

  • Naive Bayes Training - CLOB as output data type for JSON string?

    Hello everyone,
    My training model outputs a large JSON string that doesn't fit into one row, so the string is split across multiple rows. Default - or only possible output data type for that matter - is varchar according to the official documentation on PAL. Is there any chance I could use CLOB for the output?
    Regards
    Henry

    The property you provided is for applying an NB model, not for building one.
    For build, you should have used Sample_NaiveBayesBuild property file.
    I ran the NB apply sample program with your property, and was able to get past the point where you have problem.
    Please double check if you really used the property you provided and if it matches to the program you wanted to use.

  • HT3529 I have i0S7.0.2 on my iPhone 5.  I want to to send a new string of messages to someone but every time I type in the recipient's phone number, the old string of messages pop up.  Is there any way to start a new, fresh string?

    I have i0S7.0.2 on my iPhone 5.  I want to to send a new string of messages to someone but every time I type in the recipient's phone number, the old string of messages pop up.  Is there any way to start a new, fresh string?

    SadisticIron wrote:
    i just baught my first iphone and it is a jalbroken
    Buzz! Thank you for playing!
    Discussing jailbroken devices is forbidden here by the Terms of Service.
    You can not get help here.

  • How to send a command from a vc++.exe to LABVIEW.exe in order to control the button on the LABVIEW.exe

    Hello, everyone. Using VC++, I have gotten the handle of a *.exe(built by Labview), but I cannot get the button handle. I want to get the button handle and post the message to control the button. How can I do that? When I use the SPY++, the *.exe(built by Labview) have not any child windows which is very different from the *.exe(built by VC++). In SPY++, what is the LVDChild class? How can I send the message to control the button on *.exe(built by Labview)???
    That is  to send a command from a vc++.exe to LABVIEW.exe in order to control the button on the LABVIEW.exe. How can I get it ?
    Thank you!

    hummingbird wrote:
    Thank you! But I dont kown how to use vi server to raise a value signalling event. Can we put vi server into the vc program? Can you give me some more information or some examples, hehe!
    hummingbird
    Checkout the LabVIEW ActiveX server interface in the User Manual in Chapter 20, Windows Connectivity and the VI Server Reference in Chapter 17, Programmatically Controlling VIs.
    There is a sample for Visual Basic under examples/comm/VBtoLV.frm, which should be quite simple to translate to Visual C as long as you can figure out the basics of ActiveX programming in VC (I have never done anything with ActiveX in VC). For those basics I would recommend some text book or MSDN.
    Rolf Kalbermatter 
    Rolf Kalbermatter
    CIT Engineering Netherlands
    a division of Test & Measurement Solutions

  • Sending/Reading custom Strings in HTTP Header

    Hey people,
    I'm developing a J2ME application in which I'm trying to send a Message object (a few Strings such as Content, Nickname etc) to a Servlet. Serialization would be nice but since J2ME doesn't support it, I would have to come up with a custom one. I am looking for an easier way to send the strings I need to the other side.
    Can I use some of the HTTP headers in a POST request set to my custom Strings (using setRequestProperty when constructing them)?
    I know it's probably inefficient or "unethical" but if a dirty trick is what it takes... Since I'm controlling both sides of the connection, I am prepared to make it happen, one way or the other.
    Can someone come up with a viable solution?
    Any help would be greatly appreciated!

    Thank you for your prompt answer.
    I will give it a shot but I fear there's bound to be some trouble:
    1. Since the text messages sent can be of arbitrary size and I will definitely need some extra fields (such as smileys ;), color, etc - you get the gist) the header can be long. Thus, big overhead on a small device. But it sure beats creating byte[] for serialization.
    2. Some of the characters used in the "encoding" of the message, such as ",<,>,?,& etc cannot be used by in the actual body of the message - it would confuse the "decoding" on the other side.
    I might be trying to hit two birds with one stone here but the goal is to get a few "text" attributes across as painlessly as possible (for the device, not me..)
    You gave me food for thought tho, have some $ ;).

  • Problem sending (or receiving) strings

    Hi, I am trying to send a string using the following code.
    temp = new StringBuffer();
    temp.append("NEWUSER;").append(num).append(';').append(nick).append("\n");
    streamConnection = (StreamConnection) Connector.open(host);
    fromUser = streamConnection.openOutputStream();
    dataFromUser = new DataOutputStream(fromUser);
    dataFromUser.writeChars(temp.toString());
    dataFromUser.flush();and receive it on my pc running a java server:
    in = new BufferedReader(new InputStreamReader(incoming.getInputStream()));
    String inputMsg;
    while ((inputMsg = in.readLine()) != null) {
           System.out.println("Received: " + inputMsg);
           StringTokenizer st = new StringTokenizer(inputMsg, ";");
           ui.updateMsg("Received:" + inputMsg);
            while (st.hasMoreTokens()) {
                        String tk = st.nextToken();
                        System.out.println(tk);
                        System.out.println(tk.compareTo("NEWUSER"));
    }Everything seems ok when sending it:
    Sent: NEWUSER;6912345788;TQ
    but the result is printed like this
    I changed writeChars() to writeUTF, and there only to "boxes" at the beginning of the string
    Edited by: antonis_wrx on Jan 13, 2009 12:24 PM

    Hi Pisteuon,
    Thank you for your question.
    We assume the version of Exchange is 2007, if we misunderstand, please be free to let me know.
    Did you try to disable all transport rule to test it?
    Have you try to logon OWA to check if we could see attachment?
    Did all uses and all domains not send/receive attachments to/from your organization?
    Have you try to send attachment which has small size? For example 1KB.
    We could create a new account without public folder to check if the issue persist?
    If there are any public folders in organization, please make sure the correct replication among public folders,
    We could also check the public folder if it miss hierarchy on Exchange administrator group.
    We could update Exchange 2007 to CU3 or later by the following link:
    https://support.microsoft.com/kb/932515/?wa=wsignin1.0
    If there are any questions regarding this issue, please be free to let me know. 
    Best Regard,
    Jim

  • Send Idoc to AS2 System via HTTP using XI

    Hi,
    We need to send Invoice Idocs as XML files from SAP R/3 system to external AS2 system using XI. The communication will happen over HTTP using certificate. I tried using Plain HTTP adapter , but the message went into error 'ATTRIBUTE_CLIENT'. Why this error ?
    I came across some blogs saying about Seeburger AS2 adapter , but is this the only possible way ?
    Kindly guide.
    Thanks.
    Tushar

    Yes , AS2 adapter is the solution for it.
    Refer all the below threads for AS2 information and configuration which need to do for B2B integration:
    SEEBURGER EDI adapter
    Re: Pls.. Help Needed.. Seeburger Mapping Names..!!
    Re: Seeburger AS2 adapter...
    Re: AS2 Module tab.. Mapping Names for modified Standard Msg types ? ? BIC ??
    AS2 adpater-- Configuration details for both SND and RCV.
    AS2 Sender Adapter -- Need few details.

Maybe you are looking for