COM Client in C

I have some C++ sample client code which uses COM objects
Below is the code flow in C++.
1)Creates an instance of base INIT class(INIT is a class/interface)
2)passes the IUnknown to QueryInterface function and gets the interface pointer of the specific event
(the returned interface pointer will be inherited of the required event type)
3) registers the events.....
I got a requirement to implement the same in C , used the activex Controller template and generated the .c file , .h file and fp file
for the registered active X server
Step 1) NewIINIT class function and will get the CAObjHandle for the INIT interface(class)
after this step i am befuddled about how to go !
Please anyone help me out ASAP.
Can the above process be implemented in CVI ..is it feasible
Thanks in advance
Satish

Hi
I'll send you an example of how I retreve a 2D array from an ActiveX control
in C++ an how it is wired in LV
Hans
wrote in message news:892sjt$c0i$[email protected]..
> Hi!
>
> I have constructed a com-object in visual c++. This object will just
> return an array of variants. The method connected to the interface has
> one out parameter that consists of a pointer to a variant. I dont know
> how labview handles this type. It seems that it doesnt recognize the
> type. It just gives the error message, "A null reference pointer was
> passed through the stub"?!?! I have also written a com-client in c++
> that communicates with this com-server. This one works fine! How does
> labview handles arrays?! I have also tried to just return one "Var
iant
> value" from the server. Same problem here, "A null....".#"¤%"%
>
> com-server implementation:
>
> STDMETHODIMP CTEEServices::TestVariant7(VARIANT inData, VARIANT
> *pOutData)
> {
> VariantInit(pOutData);
> LPVOID pvdata;
> int *pElement;
>
> pOutData->vt=VT_ARRAY;//Set VARIANT type to array
> SAFEARRAYBOUND rgsabound[1];
> rgsabound[0].lLbound=0;
> rgsabound[0].cElements=10;//10 elements
> pOutData->parray=SafeArrayCreate(VT_I4,1,rgsabound); file://Create a
> safearray in VARIANT
> pvdata=pOutData->parray->pvData; file://Get address to array
> pElement=(int*)pvdata;
>
> for(int i=0;i<10;i++) file://Fill it up!
> {
> *pElement=i;
> pElement+=1;
> }
>
> return S_OK;
> }
>
> regards,
> Peter
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.
[Attachment C2 test.vi, see below]
[Attachment ActiveX.txt, see below]
Attachments:
C2_test.vi ‏29 KB
ActiveX.txt ‏1 KB

Similar Messages

  • Access EJB's in JServer from MS COM clients

    We need to access our EJB's from MS COM Clients (written in C++ currently using OCI)
    Any suggestions ?
    Thanks in Advance
    null

    I got the same problem.
    Some posts here suggest you should put weblogic.jar under /common/lib,
    I tried it but it didn't work. I also tried to put it under
    webapps/yourweb/web-inf/lib
    but it didn't work too. At last I had to unpack the weblogic.jar and put
    them under
    webapps/yourweb/web-inf/classes. This at least solved the problem you
    mentioned.
    I got other problem like ClassCastException that might be due to my own
    code.
    Anyway you can try the above approach. And please post your results here
    just let
    others know.
    Thanks.
    "Gary Bartlett" <[email protected]> wrote in message
    news:3ce3fdf1$[email protected]..
    >
    Question -
    Can anyone point me at documentation that will help me understand what jarfiles
    are required to allow access EJB's that are deployed in Weblogic 6.1 froma Servlet
    that is running under Tomcat.
    I am currently getting the following exception:
    javax.naming.NoInitialContextException: Cannot instantiate class:weblogic.jndi.WLInitialContextFactory.
    >
    >
    >
    Root exception is java.lang.ClassNotFoundException:weblogic.jndi.WLInitialContextFactory
    atorg.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.jav
    a:1394)
    >
    >
    Thanks,
    Gary Bartlett

  • CAN I WRITE "COM CLIENT" USING LABVIEW?

    I am trying to trnsfer data from Texas Instrument's Code composer to other software packages which in my case is Labview. In TI's tutorial it is mentioned that this can be done by writting "COM Client". Please suggest.
    Regards,

    There may be other easier ways too. If you can create DLLs with this Code Composer, you can access those from LabVIEW. That's the easiest way. You can also build CINs (Code Interface Nodes), though I would suggest not going this way, as it is much more tedious than just calling a DLL.
    J.R. Allen

  • AirPort Express sia come router wireless primario che come client AirPlay e USB printer

    Ciao.Se dovessi collegare AirPort Express ad un vecchio modem Alice con tariffa a consumo creando un network wireless, se le connetto sia una stampante USB che delle casse potrei utilizzarli a modem spento come se l'AirPort fosse in client?Grazie.

    Ciao. Io ho comprato da poco l'airport express e ho visto che se spengo il modem si stacca anche la airport. Quindi penso di no.
    Ma ė normale che deve restare collegata al vecchio modem? Mi puoi chiarire questo dubbio?

  • Raise an event with no arguments from a COM server to be consumed by a COM client

    In VB.net I can declare and raise an event like this
    Public Event SomeEvent()
    Public Sub SomeMethod
    RaiseEvent SomeEvent()
    End Sub
    I need to work out how to do this in c# however all of the examples of raising events include event handlers.  This won't work for me as I am raising this event over a COM interface, and so I can't send eventargs or non basic types through the interface
    to the client application.
    In my previous question it was suggested that I use Action and do the following
    public class MyClass
    public event Action MyEvent;
    public void RaiseMyEvent() {
    if(MyEvent != null) {
    MyEvent();
    MyClass myObject = new MyClass();
    myObject.MyEvent += () =>
    //handle...
    myObject.RaiseMyEvent();
    However when I tried this over the COM interface I got the following error
    An exception of type 'System.InvalidCastException' occurred in AdtakerInterfaceSampleCsharp.exe but was not handled in user code
    Additional information: Unable to cast object of type 'System.__ComObject' to type 'System.Action'."
    The reason that I need to do this is that I am registering application A on the running object table so that I can use
    Marshal.GetActiveObject in Application B to attach to the currently running process.  This is currently working fine for one way communication, however I need to be able to raise events from Application A that will be received by Application B.

    @CoolDadTX -That's because I've written com servers in the past using VB.net, however they were not registered with the Running object table.
     What I'm trying to do in this case is have an application that will be started by the user, and then they will start another application written in .Net to connect to that first application.  The reason for this is that we have an application
    written in an old version of smalltalk that doesn't seem to support getObject but can create an IUknown, and we already have base classes to attach to COM objects written in .Net.  As this new application needs to be started first it can't be tightly
    coupled to the legacy application, so we are trying to register the new application and then connect a Dotnet Client that is being started through a  COM Interface from the legacy application.  I know it's convoluted but we need to keep the legacy
    application alive for a bit longer while we rewrite it as an add-in for the new application.
    The article that you linked to has been very helpful on the server side, but do you have any ideas as to how I can connect the sink on the client side in C#?

  • Help using jCOM with a WLS6.1 server talking to a COM server instead of an VB/COM client

    Hi all,
    I successfully ran the BEA's EarlyBound example that has a VB Client talking to
    WLS6.1 Server via JIntegra. However, I been unsuccessful in trying to find an
    example that has WLS talking to the jCOM bridge to the Wrapper to a COM Server.
    How can I use the jCOM/jIntegra tools to reverse the EarlyBound example, if possible,
    and have an EJB talk to a "Wrapped" COM Server?

    To use GPO multitimbrally, first you create a new multi instrument and cable it directly into the audio instrument into which you've loaded GPO. Let's say it's audio instrument #1. The crucial next step is to set audio instrument 1's MIDI channel to ALL (done via the parameters section on the LH side of the screen).
    Next, name the multi something like GPO ( LOL ) and click on channels 1 - 8 on that multi-instrument in order to activate them. From this point on, instead of selecting Audio Instrument #1 in your arrange window, you select "GPO" (on whatever channel you want, in this case, 1 - 8).
    Message was edited by: iSchwartz

  • How come clients have to return to the original machine to access their photos and files? Why can't they access them from any client?

    When students login & upload images onto a client, they have to return to that same client. They cannot see their images if they log into another client the next day.
    Currently, I created uses as Local only on a server dns of ---- .server.private. via the "internet" not VPN. (as advised by a Apple Rep phone call).
    Do I change it to server HD? When I tried "Users" , they could not log into any client.
    Is it a permission issue on the client?  
    Are they pictures stored on the Client HD or the Server HD under users home folders? When I had Snowleopard, I could create folders outside their homes and see them on the server HD. Now I cannot see any folder created "ouside" the main Doc or Pictures Folder on the SERVER HD. They can, when they log into the same client each day.
    Advice?

    From what westhighphoto said "When I had Snowleopard, I could create folders outside their homes and see them on the server HD" it sounds like users have been saving files outside their home directory. In that case it does not matter whether they are using full-blown Network Home Directories or Portable Home Directories (with syncing) the files will not be copied back to the server.
    The users should be saving the photos inside the Photos folder inside their home directory. These will then be saved on to the server.
    Note: iPhoto if still being used should default to this.

  • Labview as COM client to my COM server. Class not found?

    Hello all,
    I have created a COM server in python, a type library and associated it with my python com server. I am able to access the com server from excel, vbs, python, TCL, etc. But not labview. The IDispatch interface seems to be working to the extent I've tested it... for example, GetIDsOfNames works. I presume it is the IDispatch interface which labview uses to automate stuff.
    According to labview the COM server cannot be found. I get the following error:
    Error -2147221164 occurred at Automation Open
    This error code is undefined. No one has provided a description for this code, or you might have wired a number that is not an error code to the error code input.
    which is REGDB_E
    _CLASSNOTREG = &H80040154
    From the labview side of things, the only difference I can tell between my COM server which fails to work and a working COM server like excel is when picking a com server to use there is some additional information in parathesis after the object I can create, like so:
    Type Library: Microsoft Excel 9.0 Object Library Version 1.3
    Objects: Application (Excel.Application.9)
    Here we have this extra info (Excel.Application.9), and I wonder if it is required for labview to find the com server. With my COM sever all I get is:
    Type Library: TestComServer 1.0 Type Library Version 1.0
    Objects: TestCom
    So I wonder where the information in the parathesis comes from. Perhaps I have something incorrected in my .IDL file used to create the type library which should provide this information? The type library definitely seems to be registered as I see it from both labview and oleview.
    To help me troubleshoot, can someone tell me the API calls the 'Autom
    ation Open' block runs? Perhaps if I know the exact API call failing I can fix the problem if it is with my server or at least replicate it in a vbs script.
    73,
    Timothy

    Hello, please see the attached jpgs to show what I think is the problem with labview being unable to 'find' my com server. What causes the parenthetical information to be displayed?? Does labview get this data from the registery somewhere? This is the ProgID - but for some reason there seems to be an association not being made which would normally permit labview to find the com server, which instead returns a component not registered error.
    I've been able to register my server in a debugging mode. From other applications I see it get loaded. With labview there is no connection made at all! Labview seems to fail to use the proper ProgID to instate the object. So where is it getting the ProgID from?
    73,
    Timothy
    Attachments:
    Excel.jpg ‏30 KB
    Example.jpg ‏26 KB

  • Problema com impostos - Cliente ZFM

    Boa tarde,
    Estou realizando alguns testes com clientes ZFM/ALC.
    Quando criamos a NF, o sistema está subtraindo o valor do ICMS Zona Franca no BC/IPI.
    Alguém sabe onde posso olhar?
    Já verifiquei os esquemas de cálculo e estão ok.

    Boa Tarde,
    Essse tipo de comportamento do sistema pode ser alterado via configuração da seguinte view: J_1BSDKONV (SM30).
    Lá você consegue manipular se o valor do IPI é excluido ou não da base de cálculo da condição de desconto zona franca (BXZF). É um flag.
    Espero poder ter ajudado,
    Ruy Castro

  • Aviso de Cliente devedor!

    Amigos,
    Preciso de uma alerta no B1, que não gere trava, mas que em todos os documentos de marketing gere a informação que aquele determinado PN tem saldo devedor...
    Por exemplo, ao criar um pedido de venda, ou uma cotação, ao inserir o PN, o sistema gera um alerta com "CLIENTE COM SALDO DEVEDOR" ou algo parecido..
    Acredito que uma TN poderia atender...
    Adicionei tb um campo no documento que mostra o saldo do PN no documento de marketing, porém tem usuário que ignora esse campo e passa batido...
    Com o alerta, em vermelho por exemplo, ele não pode alegar que não viu...  :-)
    Poderiam me ajudar???
    abs!

    Bom dia Raphael,
    entendo que cada um tem seus metodos de controle, mas do que adiantaria, efetivamente, tratar uma mensagem de SALDO DEVEDOR, e nao travar ou mandar para um processo de autorização?
    De qualquer jeito vai "passar batido", não acha?
    De qualquer forma segue ai um exemplo para Transaction:
    -- Variaveis nativas na Transaction:  @object_type; @transaction_type; @list_of_cols_val_tab_del
    If ( @object_type in ( '13', '14', '15', '16', '17', '18', '19', '20', '21', '22', '23') )  And ( @transaction_type in ( 'A', 'U' ) )
    --Documentos de Marketing - 17-Pedido de Venda, 13 - NF Saida, etc...
      Begin
      Declare
      @Balance Numeric(10,2)
      Set @Balance = (Select Balance from OCRD where CardCode=@list_of_cols_val_tab_del)
      If @Balance > 0
      Begin
      set @error = 1 -- Esta variavel é nativa na Transaction
      set @error_message = 'Cliente com Saldo devedor em Aberto!' -- Esta variavel é nativa na Transaction
      End
      End
    Abs

  • Writing a Standalone Client for EJB 3.0 Bean For Weblogic 10

    Steps for Writing a Standalone Client
    Client Code
    package com.client;
    import java.util.Properties;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import javax.rmi.PortableRemoteObject;
    import com.StatelessService;
    public class StatelessClient {
         public static void main(String [] args){
              Context ctx = null;
              try {
                   ctx = getInitialContext("t3://localhost:7001/protossbservice","weblogic","weblogic");
                   Object ref = ctx.lookup("StatelessService#"+StatelessService.class.getName());
                   StatelessService service = (StatelessService)PortableRemoteObject.narrow(ref,StatelessService.class);     
                   System.out.println("StatelessClient.getMessage() ++");
                   String  message = service.getMessage();
                   System.out.println("StatelessClient.getMessage --");
                        System.out.println("Message from Bean "+message);
         } catch (NamingException e) {
                   e.printStackTrace();
         private static Context getInitialContext(String url, String user, String password) throws NamingException {
            Properties h = new Properties();
            h.put(Context.INITIAL_CONTEXT_FACTORY,
                    "weblogic.jndi.WLInitialContextFactory");
            h.put(Context.PROVIDER_URL, url);
            h.put(Context.SECURITY_PRINCIPAL, user);
            h.put(Context.SECURITY_CREDENTIALS, password);
            return new InitialContext(h);
    Business Interface
    package com;
    public interface StatelessService {
         public String getMessage();
    Stateless Session Bean
    package com;
    import javax.annotation.PostConstruct;
    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    * Test Stateless Session Bean
    @Stateless(mappedName="StatelessService")
    @Remote(StatelessService.class)
    public class StatelessServiceBean implements StatelessService {
         public String getMessage(){
              return "I am invoked";

    emekaco wrote:
    Hi,
    I am a trainee although with a good background in java.
    I'm urgently in need of a free ebook for EJB 3.0 with the latest version of Netbean. Pls, help me with one if you have. my email is [email protected]
    http://www.theserverside.com/tt/books/wiley/masteringEJB3/index.tss
    Here's a good free e-book but without Netbean. It covers everything you would need to know about EJBs.
    >
    Again, is container managed bean good for a big project?
    The question is too vague to be answered. It's a design decision that needs more details.

  • How to invoke a proxy service from a java client

    Hi all,
    how could I invoke a proxy service from a java client ?
    The proxy service type is 'any xml service' with http protocol.
    For a proxy with web service type I can export the related WSDL and generate the java client source.
    With 'any xml service' there is no associated wsdl and I'm wondering how to do that.
    Thanks
    ferp

    Hi Ferp,
    I used ClientGEN to generate client files from WSDL deployed in ALSB. You can also use Axis for client file generation.
    You need to know the WSDL URL. Generate Client files from WSDL URL.
    Sample ANT Script
    <project name="simple-web" default="mytask" basedir=".">
    <taskdef name="clientgen" classname="weblogic.wsee.tools.anttasks.ClientGenTask" classpath="C:\bea92\weblogic92\server\lib\weblogic.jar"/>
    <target name="mytask" description="Generate web service client">
              <clientgen wsdl="http://<hostname>:<port>/URL?WSDL"
         destDir="src"
         packageName="com.client.mytask"
         classpath="${java.class.path}" />
         </target>
    </project>
    Use the following JAVA Code,
    try {
         ActivationService service = new ActivationService_Impl("http://<hostname>:<port>/url?WSDL");
    client = service.getActivationServicePort();
    } catch (Exception ex) {
    // Handle Exception
    client.activateNumber();
    Let me know if you need any more information.
    Thanks,
    Suman.

  • Setting Values in an Array of Clusters via COM

    Hello everybody,
    I need some help concerning LabView and COM (ActiveX).
    I'm working on NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual
    C++ 6.0 which controls LabView.
    I can set the values of normal Controls, Arrays and Clusters.
    But I'm not able to set values for an array of clusters.
    Does anybody know how to do this ?
    Or is it impossible ?
    Many thanks in advance,
    Ralf Erdmann

    >> I need some help concerning LabView and COM (ActiveX).>> I'm working on
    NT 4.0 with LabView 5.1 and I've written a COM-Client in Visual>> C++ 6.0
    which controls LabView.>> I can set the values of normal Controls, Arrays
    and Clusters.>> But I'm not able to set values for an array of clusters.>>
    Does anybody know how to do this ?>> Or is it impossible ?>> >>With no more
    information, the my answer is, I'm not sure. It is generally>possible to
    set controls by constructing a matching Variant. Make the>array a safe-array,
    the cluster a safe-array, and the elements of the>cluster be variants of
    compatible types to what is in the array.>>If you can't get it to work from
    this, you may want to include the>LV datatype in an email and contact support.>>
    Please allow
    me to get more precise.
    For my testings I used a cluster with just one element (type double)
    in an one-dim array with just this cluster as only element.
    A LV-Cluster is represented as an array of variants in COM.
    So I have an array of arrays. With an array beeing no datatype
    I don't know how to put an array into an array to
    construct a variant to pass to LV.
    How can I solve this?
    Thanks for help.
    Ralf Erdmann

  • Tomcat, servlet, cacerts, client authentication and Thawte...

    Hello all,
    the steps and code samples below (well known to you) work fine for a VeriSign Personal Digital Id trial and a GlobalSign PersonalSign demo certificate. However:
    1) how can I make Tomcat or JSSE use both my default keystore and the cacerts file?
    The VeriSign class 1 root is in this cacerts file, but still I need to import the very same root into my own keystore to accept the client certificate. Also, importing the GlobalSign root into cacerts does not help me; instead I am required to import it into my default keystore.
    I know I can set the keystore parameter in the Tomcat server.xml -- but that does not feel right... When I import a cert using "keytool -trustcacerts" then I get "Certificate already exists in system-wide CA keystore under alias <verisignclass1ca> Do you still want to add it to your own keystore?" This gives me the feeling that the system knows where to find the cacerts file, but Tomcat somehow does not use it...
    2) anyone used Thawte Personal Freemail with Tomcat?
    Even when I import the Thawte root certificate into my own keystore, a Thawte Personal Freemail cert is never accepted. In Internet Explorer, although having three certificates installed, the popup dialog that prompts me to choose one only shows the VeriSign and GlobalSign things. When using "TOMCAT_OPTS=-Djavax.net.debug=all" I see that Tomcat "proposes" all three roots to the client browser:
      *** CertificateRequest
      Cert Types: DSS, RSA,
      Cert Authorities:
      <CN=GlobalSign Root CA, OU=Root CA,
         O=GlobalSign nv-sa, C=BE>
      <OU=Class 1 Public Primary Certification Authority,
         O="VeriSign, Inc.", C=US>
      <[email protected],
         CN=Thawte Personal Freemail CA,
         OU=Certification Services Division,
         O=Thawte Consulting, L=Cape Town,
         ST=Western Cape, C=ZA>
      *** ServerHelloDoneAll details below.
    Thanks,
    Arjan.
    - JDK 1.4 beta. I also have 1.3 installed; I did not try 1.3 with the JSSE extension available at http://java.sun.com/products/jsse/index-102.html
    - JAVA_HOME and PATH are set allright.
    - Tomcat 3.2.1
    Steps taken:
    VeriSign
    - free trial at http://www.verisign.com/client/enrollment
    - export the VeriSign root certificate from the global CA certificates. The password defaults to changeit
    - import the exported root into the default key store
      cd /jdk1.4/jre/lib/security
      keytool -export -keystore cacerts -alias verisignclass1ca -file myverisignroot.cer
      keytool -import -alias myverisignroot -trustcacerts -file myverisignroot.cerAbove, the -trustcacerts is only added to show you the warning I mentioned above...
    GlobalSign
    - free trial at http://www.globalsign.com/secure_demo.cfm
    - get the root certificate at http://secure.globalsign.net/en/trust
    - import the root certificate into the default keystore
      keytool -import -alias myglobalsignroot -file root.cacert
    Thawte
    - free certificate at http://thawte.com/getinfo/products/personal
    - the Personal Freemail root certificate at http://www.thawte.com/certs/trustmap.html
    - import the Personal Freemail root certificate into the default keystore
      keytool -import -alias mythawteroot -file persfree.crt
    Tomcat
    - uncomment the SSL Connector section in server.xml, except for keystore and keypass (the password is still the default, being changeit)
    - to the very same Connector section, add
      <Parameter name="clientAuth" value="true"/>- create a security certificate, as mentioned in server.xml as well. When using JDK 1.4, one does not need to set the classpath or change java.security. So:
      keytool -genkey -alias tomcat -validity 180 -keyalg RSA- to see debug info:
      set TOMCAT_OPTS=-Djavax.net.debug=all- make sure the VeriSign etc. roots are imported
    - restart Tomcat
    - connect to the servlet at port 8443, using https. You will see security warnings because your browser does not know the Tomcat certificate.
    Servlet
    Finally the code, as you may know it:
    import javax.servlet.*;
    import javax.servlet.http.*;
    import java.io.*;
    import java.util.*;
    // For Tomcat: javax.security, not java.security
    import javax.security.cert.X509Certificate;
    import javax.security.cert.Certificate;
    import java.security.Principal;
    // JSSE classes
    import javax.net.*;
    import javax.net.ssl.*;
    public class sslTest extends HttpServlet
      private static final String CONTENT_TYPE = "text/html";
      public void init(ServletConfig config) throws ServletException
        super.init(config);
      private void printCert(PrintWriter pw, Object obj)
        if(obj instanceof Certificate)
          pw.println("<>---------------------------------------<>");
          if(obj instanceof X509Certificate)
            X509Certificate cert = (X509Certificate)obj;
            Principal principal = cert.getIssuerDN();
            pw.println("  Principal Name : " + principal.getName());
            pw.println("  Version        : " + cert.getVersion());
            pw.println("  Serial Number  : " + cert.getSerialNumber());
            pw.println("  Issue DN       : " + cert.getIssuerDN());
            pw.println("  Subject DN     : " + cert.getSubjectDN());
            pw.println("  Not Before     : " + cert.getNotBefore());
            pw.println("  Not After      : " + cert.getNotAfter());
            pw.println("<>---------------------------------------<>");
            pw.println(cert.toString());
          else
            Certificate cert = (Certificate)obj;
            pw.println(cert.toString());
      private void printCertificateDetails(String attributeName,
        HttpServletRequest req, PrintWriter pw)
        Object obj=req.getAttribute(attributeName);
        if(obj instanceof Certificate[])
          if(obj instanceof X509Certificate[])
            pw.println("<h1>Client X509Certificate Chain</h1>");
          else
            pw.println("<h1>Client Certificate Chain</h1>");
          Certificate[] array = (Certificate[])obj;
          for (int x=0; x < array.length; x++)
            printCert(pw, array[x]);
        else if(obj instanceof Certificate)
          if(obj instanceof X509Certificate)
            pw.println("<h1>Client X509Certificate</h1>");
          else
            pw.println("<h1>Client Certificate</h1>");
          printCert(pw, obj);
        else
          if (obj != null)
            pw.println("Client Certificate Attribute "
              + attributeName
              + ", type \""
              + obj.getClass().getName()
              + "\":\n" + obj);
          else
            pw.println (attributeName + " attribute not set");
      /**Process the HTTP Get request*/
      public void doGet(HttpServletRequest req, HttpServletResponse resp)
        throws ServletException, IOException
        PrintWriter pw = resp.getWriter();
        pw.println("<html><head><title>SSL Details</title></head><body><pre>");
        if (req.isSecure())
          pw.println("Got a secure connection.");
        else
          pw.println("This connection is not secure.");
        pw.println("IP address: " + req.getRemoteAddr());
        pw.println("User: " + req.getRemoteUser());
        pw.println("Subject: " + req.getHeader("CERT_SUBJECT")); // null for Tomcat
        pw.println("Issuer: " + req.getHeader("CERT_ISSUER"));   // null for Tomcat
        pw.println("\nAvailable attributes:");
        Enumeration attributeNames = req.getAttributeNames();
        while(attributeNames.hasMoreElements())
          pw.println("  " + attributeNames.nextElement().toString());
        pw.println("\n");
        Object obj;
        obj = req.getAttribute("javax.net.ssl.cipher_suite");
        if(obj instanceof String)
          pw.println("Cipher Suite: " + obj);
        else
          if(obj instanceof String[])
            pw.print("Cipher Suite: { ");
            String[] otherArray= (String[])obj;
            for (int x=0; x<otherArray.length; x++)
              pw.print(otherArray[x].toString() + " ");
            pw.println("}");
          else
            if (obj != null)
              pw.println("SSL Session Attribute javax.net.ssl.cipher_suite, type \""
                + obj.getClass().getName() + "\":\n" + obj.toString() );
            else
              pw.println ("javax.net.ssl.cipher_suite attribute not set");
        obj = req.getAttribute("javax.net.ssl.session");
        if(obj instanceof SSLSession)
          pw.println("SSL session:");
          SSLSession session = (SSLSession)obj;
          pw.println("Cipher Suite: " + session.getCipherSuite());
          pw.println("Peer Host: " + session.getPeerHost());
          pw.println("ID: " + new String(session.getId()));
        else
          if (obj != null)
            pw.println("SSL Session Attribute javax.net.ssl.session, type \""
              + obj.getClass().getName() + "\":\n" + obj);
          else
            pw.println ("javax.net.ssl.session attribute not set");
        // JSSE recommends �javax.net.ssl.peer_certificates� as the attribute name.
        // However, some web servers do not support these generic names. Like the
        // "javax.net.ssl.peer_certificates" is said to work for WebSphere 3.5 but
        // not for Tomcat 3.2.1.
        // "The javax.security.cert.X509Certificate class is similar to the newer
        // java.security.cert.X509Certificate. New applications should use the newer
        // java.security version". However, Tomcat does not support that:
        printCertificateDetails("javax.net.ssl.peer_certificates", req, pw);
        printCertificateDetails("javax.servlet.request.X509Certificate", req, pw);
        printCertificateDetails("tomcat.request.X509CertificateChain", req, pw);
        pw.println("</pre></body></html>");
      /**Clean up resources*/
      public void destroy()
    }

    Heya,
    Well, this is a pretty complete description of the problem, unfortunately I am not able to comment on the Tomcat side of things, but this makes for interesting reading nonetheless.
    One thing I must mention is that the Thawte Personal certs are indeed chained, and the Personal Freemail cert is the intermediate root CA which is in turn signed by the Personal Basic root (the link I have posted to you in your trouble ticket with us.)
    What may be happening is that the Personal Freemail cert is not completing the chain back to the Personal Basic root, and any cert signed with this may not be displayed as the Issuer is in doubt.
    If your Personal Cert has been issued within the last few months it has ben signed by the Personal Freemail 08.03.2000, and many versions of browsers have not got this particular root installed, could you verify that pls? I can send this particular root to you if you would like to test this theory out.
    There should bo no problems with using a Thawte certificate with your particular software, so we should hopefulyy be able to figure somehting out.
    Regards,

  • Complex number datatype in COM

    I am unable pass complex numbers to LabVIEW via its COM interface (LabVIEW.VirtualInstrument.Call) from Python using the win32com COM client.
    When LabVIEW returns complex numbers my client sees them as a tuple consisting of the real and imaginary components. However, when I make COM call to LabVIEW with tuple as the argument I get a COM type error. If I use Python's complex datatype instead, COM seems happy but then LabVIEW returns a type error.
    As I understand it, COM doesn't have a "complex" datatype, so the issue is how LabVIEW expects complex numbers to be represented in terms of COM types.
    Can anybody help?

    Would it help to convert it to a string while passing between Python and LabVIEW?
    Then you can typecast it accordingly in each environment.
    Cory K

Maybe you are looking for