Controlling an existing application via webservices

Hi all,
I just came across labview webservices whilst at one of the NI Tech symposiums in the UK last week and I want to use them for a specific application. However my initial playing hasn't worked very well! I want to know if I'm doing something wrong, or if what I'm trying to do isn't possible!
We have an existing application which controls a piece of measurement kit. It has multiple moving axes and some data acquisition and automated measurements etc etc. The application is all based on queued state machines and event structures for UI etc. At the moment the system is controlled by a user next to the machine with a PC. For some of the measurement setup, it can be useful for the user to move around and view the system from different angles whilst positioning the moving axes. At the moment that means walking round the system, looking to see how the alignment is, jusdging what change needs to be made, going back to the pc, making the change walking round... you get the idea!
What I wanted to do was to set up a webservice "interface" to the system giving fairly basic control of the positioning system. My plan was to write an intermediate VI which is opened by the user on the PC (via the existing application) to enable "remote" operation. This intermediate VI would then wait for the webservice vi to be called by the user on his/her mobile web enabled device and then pass instructions directly into the main applications Queue. The use of the intermediate means we don't have to re-write any of the main application and also gives a layer of security since the user has to manually call that VI from the main application. 
In the ideal world that intermediate vi would be "event driven" i.e. it would either contain an event structure or Queue system and wait for the webservice to fire that event/queue (and send in instructions). However this is the bit that doesn't seem to work. I tried creating a user event within the intermediate vi and writing the reference to that event into a shared variable which the webservice could see, but that failed (apparently user events can't be written to shared variables?). Then I tried with a Queue, but nothing happened... I could of course have the intermediate vi just polling shared variables written by the webservice VI, but that doesn't sound great to me... 
Does anyone have any thoughts on this? Is there a sensible way to "tack on" a webservice to an existing application? Other than network shared variables is there any other communication method that works between webservices and other VIs running? (I think this may be the key question)...
Thanks in advance for your thoughts!
Paul

Getting data from your LabVIEW built web service over to your LabVIEW application is the trickies part of using LV web services because they run in seperate LabVIEW contexts.
Since you are using an event based and queue based archtiecture, you are in a good position to add remote support in. This is an excellent architecture for extensibility.
I can put forth 2 recommendations for you to try out. I agree with you that shared variables are a bad idea, they are lossy and would require you to add polling to your event driven architecture.
1) TCP/IP
You could open a TCP/IP port between the web service VI and your main application. I would recommend wrapping the TCP calls into a set of new API VIs that allows your application to block on a TCP request. For instance, you could create your own queue API that uses TCP under the hood to pass data. Your web service would use this new Queue API to put items into the queue, and your main app would then have another queued event handler to service items put into the queue. When this new queued event hanlder sees something on the queue, it could either fire user events in your main app's LV event handler, or just pass events over to your original queued state machine.
2) VI Server
create a simple VI that can invoke a user event on your main app's event handler, or can push something into your main app's queued state machine.  Then open and run this VI via VI Server from your web method.  This VI should just run once and exit, and all it does it pushes something into your state machine or queue. You can either have many of these VIs to match the specific events, or have one VI with a string on the front panel, then via VI server, put a value into that control from your web method. 
I personally find the 2nd option the easiest to implement.
Good luck.
-Jared

Similar Messages

  • Installing Grid control with existing IAS

    Is it possible (and how) to install Grid control into existing Application Server installation? Or integrate it somehow?

    yes u can install Grid control into existing Application Server installation

  • How can I make my application as webservice

    Hi All,
    I'd like to know ,how can I make my application as webservice which has built on strut framework.
    with regards
    Babu H

    I'm not quite sure what you mean by application, but you can not turn whole applications to webservices. What you can do easily is to turn your services, e.g. the public methods in your stateless session bean layer as web services. There is different ways to do this, but you might want to check out Axis (http://ws.apache.org/axis ), which is a OS tool for creating WS call stacks over existing objects.

  • Link invoice to existing payment via DI Server?

    Hi all,
    I can not link invoice to existing payment via DI Server, please see following code:
            sCmd = "<?xml version=""1.0"" encoding=""UTF-16""?>"
            sCmd += "<env:Envelope xmlns:env=""http://schemas.xmlsoap.org/soap/envelope/"">"
            sCmd += "<env:Header>"
            sCmd += "<SessionID>" & msSessionID & "</SessionID>"
            sCmd += "</env:Header>"
            sCmd += "<env:Body><dis:UpdateObject xmlns:dis=""http://www.sap.com/SBO/DIS"">"
            sCmd += "<BOM>"
            sCmd += "<BO>"
            sCmd += "<AdmInfo>"
            sCmd += "<Object>oIncomingPayments</Object>"
            sCmd += "</AdmInfo>"
            sCmd += "<QueryParams>"
            sCmd += "<DocEntry>468</DocEntry>"
            sCmd += "</QueryParams>"
            sCmd += "<Payments_Invoices>"
            sCmd += "<row>"
            sCmd += "<DocEntry>2558</DocEntry>"
            sCmd += "<InvoiceType>it_Invoice</InvoiceType>"
            sCmd += "<SumApplied>12.19</SumApplied>"
            sCmd += "</row>"
            sCmd += "<row>"
            sCmd += "<DocEntry>2556</DocEntry>"
            sCmd += "<InvoiceType>it_Invoice</InvoiceType>"
            sCmd += "<SumApplied>14.69</SumApplied>"
            sCmd += "</row>"
            sCmd += "</Payments_Invoices>"
            sCmd += "</BO></BOM></dis:UpdateObject></env:Body></env:Envelope>"
    It does not work, return error "Cannot link invoice to existing payment via DI".
    Please help!
    Thanks.
    John

    Hi John!
    You cannot update an existing payment and link it to invoices.
    You can only do the link during the Add operation.
    This is true for DI server, DI and to B1 Application.
    Once a payment is created it cannot be changed.

  • I have an existing application need to add LabVIEW OPC Server

    I have an existing application written in LabVIEW which controls a Device. The data from the device is currently logged to the local drive. 
    It is desired to upgrade this application to become an OPC Server so that the manager can remotely acquire data and control the Application.
    What would be the easiest approach to accomplish this task?
    Thanks and Best Regards,
    Gary

    Hello Dan,
    1. The operator specifies a time interval to save the data to disk. The data is stored in a csv file.
     2. The manager is the Engineer who is managing the data collection system remotely.
    3.The desired end result is to have the LabVIEW with an OPC server provide the connectivity to an OPC client so that they can collect the data, that they desire from the system, and control the system.
    4. Controlling the system is secondary. Providing the connectivity so that an OPC client can specify what data is to be sent and the update interval is the first priority.  For example, they may only be interested
    in 10 of say 30 parameters, and want that data sent over every 10 seconds or so. The data once they receive it will be logged to a central data base.
    We suggested using TCP/IP but they do not want a custom interface.
    We also suggested Modbus, but they perfer to use OPC. The want to integrate it with their OSI PI.
     Thanks and Best Regards,
    Gary

  • Starting and stopping applications via a Java-application on Windows/Unix

    Hello,
    I want to start java and other applications via a java application.
    This java application should start several different applications on windows and
    on unix systems and take care of their current state (e.g. running/not running).
    For all applications to be started there are .sh-scripts for unix and .bat-scripts
    for windows. In the scripts there could be a java call, e.g. "java someApplication",
    or some executables could be called. These scripts set the applications' environment etc.
    and start the application finally.
    My java application calls these scripts via the ProcessBuilder API, which is working fine.
    But there is the following problem: on windows, when executing a script that starts
    some other application, the ProcessBuilder gives me process-handle to the started
    process. If calling destroy() on this handle, only the cmd.exe gets killed which
    started the application. The application itself is running on. This is undesired behaviour
    since I want to be able to control the started applications, at least start and stop it which
    is impossible that way.
    On unix, it is working when using
    "exec java someApplication"
    instead of just
    "java someApplication"
    in the .sh-scripts. The exec command substitutes the shell process with the underlying
    process started in the script, so everything is working as expected on unix.
    But how could I get this working on windows systems? Is there any equivalent to the exec
    command on unix? Any suggestions appreciated.
    If something's unclear in my description, please let me know.

    Yes - after looking at this option - I think that's the direction I am going to go. It probably makes sense to give my JMS topics and my BPEL server their own OC4J instances anyway - for a number of reasons.
    Lon

  • USB interface locked for windows-based application via VMWare fusion 3

    recently I found some applications based on windows XP (I used Vmware fusion 3 on mac OS X 10.6.3, macbook pro) can't find the h/w connected to USB interface..e.g.
    I have a 3G wireless modem card, the console in windows (of course based on virtual machine VMWARE) says no any modem card founded when I connected to my mac pro with USB interface..
    another case is I use ebank client s/w with U-key.. of course doesn't find any U-KEY when i insert it too..
    It seems that the USB interface is locked when I use windows-base application via virtual machine, right?

    yes, your suggestions are very useful.. I tried again..it asked me to select if connecting to "windows" or "mac".. I made the mistakes before.. Now I selected "windows" and it was okay..
    btw, one more question about the bridge connection.. when I dial through my 3G modem card (based on windows XP), I just only use IE as the web browser.. Safari is not ok. I assumed that I should make a bridge connection between 3G modem card and LAN connection, right? If yes, how to do it? I can't select two connections once a time in control panel..
    Thanks for your answer!

  • How to extract data via webservices and configure webservices in BI 7

    Hi to all,
    Can any body tell me How to extract data via webservices and configure webservices in BI 7.
    i have created a remote functionmodule which extract data from R/3 , now i want to upload data to BI 7 using that remote function module.
    i have use webservice (push) as adapter mode, as i want to connect function module with SOAP , via web services.
    please can any body tell how to do that.
    also how to configure the webserive , what is it .
    I SHALL BE THANKFULL TO YOU FOR THAT
    Regards
    Pavneet rana

    Hi,
    1. Using the function library (transaction SE37), call the Web service creation wizard.
    To do this, select the desired function module in the function library and choose Utilities ®Generate Web Service ® From the Function Module.
    2. Go through the following steps, shown in the wizard:
    a. Create a virtual interface.
    The virtual interface represents the interface between the Web Service and the outside.
    b. Choose the end point.
    The name of the function module that is to be offered as Web service is already entered here.
    c. Create the Web service definition.
    The Web service definition helps with assigning the Web service features, such as how security can be guaranteed in data transfer.
    d. Release the Web service.
    The wizard generates the object virtual interface and Web service definition in the object navigator.
    The function group that was generated when the XML DataSource was created is not transportable and is thus assigned to a local package. To prevent errors due to transports, make sure that the objects that were generated in the Web service creation wizard are assigned to a local non-transportable package.
    The Web service is released for the SOAP runtime.
    3. In the virtual interface for the import parameter DATASOURCE, define the name of the XML DataSource as the fixed value.
    A separate function group is generated for each XML DataSource. It makes sense to pre-assign the parameter DATASOURCE with the name of the XML DataSource in the virtual interface of the Web service for which the function group was generated.
    If you do not pre-assign the parameter, it will be necessary to transfer the data sent with the appropriate filled DataSource element, for example, by setting the value in the application that implements the Web service.
    a. In the object navigator, choose the name of the package in which the Web service was created and choose Enterprise Services ® Web Service Library ® Virtual Interfaces.
    b. Choose Change in the context menu for the virtual interface.
    c. For the virtual interface, remove the flags exposed and initial and enter the name of the XML DataSource in apostrophes, for example u20196ADATASOURCENAMEu2019.
    d. Activate the virtual interface.
    Regards,
    Marasa.

  • New page on existing application

    Hi,
    How can I add new page report on the existing application?
    Thank you

    What did you have in mind? The Enter key? The Tab key?
    Keep in mind that APEX applications are web-based, ie they run within the confines of the browser. The Browser is the actual application, and it already has predefined what many of the keyboard keys mean, such as F5 (page refresh), etc. You can't re-map these meanings without knowing exactly which browser you are dealing with and a whole lot of pain. The simplest way to do things in APEX is with buttons and clicks, as these can be easily translated into exact actions you can control within the APEX environment and which are generally browser-agnostic.

  • "Out of memory" error when receiving "Bytes" via Webservices.

    When I receive Byte content via Webservices over 3.5MB, I get Out of memory error.
    Does Everybody know how to solve this problem?
    I'm using TomCat 4.1 [and 5.0.28 too] with Axis.

    Then you are not using them correctly. If I set up my stream to read into 2K buffers, then my memory overhead should not significantly exceed 2K when reading the file. My bet is you are reading everything into memory and then writing it.
    Post some code. Not the whole application or even the whole class, just the part performing I/O. And please use the 'code' formatting button above when doing so. Then, perhaps, we can help diagnose your issue.
    - Saish

  • Install windows application via JWS

    We want to install our (non-Java) application via Java Web Start on Windows systems.
    Up to now, we've used InstallShield to install our appl. on the client machine.
    Has anyone a suggestion, how this can be possible with Java Web Start/JNLP?
    Access to the system (copying files, writing registry etc.) must be.
    Regards, Marko.

    We want to install our (non-Java) application via Java
    Web Start on Windows systems.
    Up to now, we've used InstallShield to install our
    appl. on the client machine.
    Has anyone a suggestion, how this can be possible with
    Java Web Start/JNLP?It is not impossible, but still a misuse of Web Start, with other deployment tools very likely to be better suited
    for your job. (You didn't tell the specifics.. mass distribution, or if you have control about deployment, server and clients)
    If you really insist, you might end up using the Java version of InstallShield with a very small wrapper written in Java that does the extension installer plumbing with Web Start.
    Regards,
    Marc

  • Remote-Conrol a COM-Application via JNI Error: RPC_E_WRONG_THREAD

    hi,
    we have written a DLL which launches and remotecontrols an application via Microsoft COM. This DLL is called by a Swing-GUI-Application via JNI. It works fine over years. Now we have rewritten our application as an rcp-plugin. The COM-Appplication still launches fine, but when I call a COM-function of the remote-controlled application i get back an error:
    RPC_E_WRONG_THREAD
    ...which means that the wrong threading model is used. Does anyone know about differnt threading models of a swing application and an rcp-plugin?
    thanks for your help
    robert

    Kapila_Shantha wrote:
    But they are saying that they can use and do program using it but they are using RHEL 4 . They are wrong.
    A well done JNI library, regardless of how it is used, should not cause system exceptions.
    That would be true whether you created the library or whether someone else creates it.
    Although if they don't wish to certify it for specific configurations then that could be the cause. If that and only that is the cause then you are out of luck.
    If the real problem is that you are using it incorrectly (which should still not cause that problem) then you need to figure out how to use it correctly.

  • Start using headstart with CAPI-TAPI-packages in an existing application

    I want to start using the capi-tapi principle to implement new business rules in an old existing application.
    In this application there are already "normal" triggers. Will this coexist? Or can this cause troubles?
    Can anyone say something about this?

    As long as these triggers do not have the same name, there'll be no problem. It's possible to create multiple triggers that fire at the same time (i.e. "before insert row"). But beware: you cannot control the order of firing!
    Also beware of doubling your business rules: probably there are allready rules defined in the existing triggers...

  • Custom de disponibilizacao do XML via WebService

    Srs.
    Preciso da ajuda de vocês em uma solução custom que estou criando via WebServices de disponibilizacao do arquivo XML gerado pelo SEFAZ.
    O problema que estou tendo é que, informando um ID de uma NFe, não estou conseguindo ler todos os dados do XML que está armazenado no GRC, durante a leitura está ocorrendo salto entre os dados e não entendo ainda o que pode estar errado.
    Segue abaixo o codigo da RFC que estou criando que através do ID ( como eu disse ) me retornaria o XML completo dentro de um unico campo de texto, o que nao esta ocorrendo.
    FUNCTION Z_GETXML_BY_MFEID.
    ""Local Interface:
    *"  IMPORTING
    *"     VALUE(I_NFEID) TYPE  /XNFE/ID
    *"  EXPORTING
    *"     VALUE(E_XML) TYPE  CHAR30K
      TYPES: begin of typ_tab_xml,
                id    TYPE string,
                docid TYPE SDOK_DOCID,
             end of typ_tab_xml.
        TYPES: begin of typ_tab_string,
                str  TYPE Xstring,
             end of typ_tab_string.
      DATA: wa_xml       TYPE typ_tab_xml,
            wa_dokobject TYPE SDOKOBJECT,
            itb_fileinfo TYPE TABLE OF SDOKFILACI,
            wa_fileinfo  TYPE SDOKFILACI,
            itb_fileBinary TYPE TABLE OF SDOKCNTBIN,
            wa_fileBinary TYPE SDOKCNTBIN,
            str_xml      TYPE string,
            tab_string   TYPE TABLE OF SDOKCNTASC.
      SELECT SINGLE id
                    docid
        FROM /XNFE/XML
        INTO wa_xml
       WHERE id = I_NFEID.
      IF sy-subrc <> 0.
      ENDIF.
      wa_dokobject-class = '/XNFE/XML1'.
      wa_dokobject-objid = wa_xml-docid.
      CALL FUNCTION 'SDOK_PHIO_LOAD_CONTENT'
        EXPORTING
          OBJECT_ID                 = wa_dokobject
          CLIENT                    = SY-MANDT
      AS_IS_MODE                =
          RAW_MODE                  = 'X'
      TEXT_AS_STREAM            =
       TABLES
         FILE_ACCESS_INFO          = itb_fileinfo
         FILE_CONTENT_BINARY       = itb_fileBinary
    EXCEPTIONS
      NOT_EXISTING              = 1
      NOT_AUTHORIZED            = 2
      NO_CONTENT                = 3
      BAD_STORAGE_TYPE          = 4
      OTHERS                    = 5
      IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
      ENDIF.
      READ TABLE itb_fileinfo INTO wa_fileinfo INDEX 1.
      DATA: linha       TYPE i,
            linha2      TYPE i,
            linha_fim   TYPE i,
            tabela      TYPE TABLE OF typ_tab_string.
      linha = wa_fileinfo-first_line.
      linha_fim = wa_fileinfo-last_line.
      Data: len TYPE i.
      WHILE linha <= linha_fim.
        linha2 = linha + 1.
        data LXSTRING type XSTRING.
        CALL FUNCTION 'SCMS_BINARY_TO_XSTRING'
          EXPORTING
            INPUT_LENGTH       = 4096
           FIRST_LINE         = LINHA
           LAST_LINE          = LINHA2
         IMPORTING
           BUFFER             = LXSTRING
          TABLES
            BINARY_TAB         = itb_fileBinary
        EXCEPTIONS
          FAILED             = 1
          OTHERS             = 2
        IF SY-SUBRC <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
            WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
        ENDIF.
       Data: str TYPE string.
       CALL FUNCTION

    Eu uso essa  função para recuperar o XML:
        CALL FUNCTION '/XNFE/CORE_KPRO_XML_READ'
          EXPORTING
            is_dokobject     = ls_dokobject
          IMPORTING
            ev_content       = EV_STRING
          EXCEPTIONS
            no_existing      = 0
            no_authorization = 0
            no_content       = 0
            read_failure     = 0
            convert_failure  = 0
            OTHERS           = 0.
    Onde:
        ls_dokobject-class = '/XNFE/XML1'.
        ls_dokobject-objid = lv_docid .
    At.,
    Bernardo Braga

  • SSO to a weblogic application via a header variable, possible?

    Hi
    Is it possible to provide single sign on to a weblogic application via a header variable?
    We would like to follow a similar model to what's used with OC4J at:
    http://download.oracle.com/docs/cd/E10761_01/doc/oam.1014/e10356/osso.htm#BJFJBCHB
    Any feedback is appreciated.

    Yes this is possible via a custom Identity Assertion Provider if you are using Weblogic security. You can write the J2EE provider to extract the header and map the user to a LDAP user when you configure the authentication provider to use the same user store as OAM.

Maybe you are looking for

  • Is the imessage server down? because is not working in my ipod and my friend's one

    because is not working in my ipod and my friend's one, then i logoff but now it doesnt let me log in :/

  • Why does it lag so much when I scroll in Safari? (OS X Lion)

    I've noticed that ever since the OS X Lion update, webpages in general are pretty laggy when scrolling.  I let the page completely load and when I scrollthere is stuttering and lag.  It is made most apparent when I use momentum to scroll a long webpa

  • J1INCHLN  Remittance Challan

    hi all Withholding tax deducted under section 194j while creating in challan  J1INCHLN  the amount appear under two sections 194C and 194J as both are attached in vendor master . if we remitt the amount as per register  it amounts to double . so kind

  • Problem importing XDCAM-EX IN After Effects CC or Premiere Pro

    We have recently installed  CC in our labs, and now we can't import XDCAM-EX, using the media browser neither in Premiere Pro nor in After effects. We get "Usupported format or damaged file" error I have made all the last upgrades, but still getting

  • Render-out of memory

    Hi I have a short project, only 7 minutes. All stills/pdf files. None are horribly big. Using Motion to add some movement. First couple of shots I'm trying to render after adding a small move in FCP 7.0.1 and it gets to about 55% then says 'Out of me