Instantiating interfaces???

since an interface is not a real object but just a behavior an object has, why is it okay to, say,
addActionListener(new ActionListener(){actionPerformed(ActionEvent ae){}}); since ActionListener is merely an interface. or for instance adding a Runnable to the event dispatchin thread?
SwingUtilities.invokeLater(new Runnable(){public void run(){}}); since runnable is an interface.
what's really going on here? is there an implied anonymous class that has extended Object and implemented the Runnable/ActionListener etc interface and the syntax simply doesn't force the user to specify this?
Thanks, sorry I was just wondering.

The anonymous class isn't really implied, it's quite explicit. That is what an anonymous class is by definition. Were you to declare a class with a name and which implemented Runnable it would no longer be anonymous.
On a side note, I love how there's yet another page in the tutorial that is misleading at best. The page implies that an anonymous class is an inner class which isn't necessarily true. It implies the same about a local class as well, yet both can be used in a static context and are by definition not inner classes when used that way.

Similar Messages

  • Instantiating Interface

    Hello,
    I have a piece of code like this:
    ChatInterface chi;
        public void init()
                     chi = (ChatInterface)Naming.rmi.lookup("localhost:1099/RmiService");
        }When I am trying to compile, I get an error:
    javac -classpath "./servlet.jar" ChatServlet.java
    ChatServlet.java:18: cannot find symbol
    symbol : class ChatInterface
    location: class ChatServlet
    ChatInterface chi;
    ^
    ChatServlet.java:19: cannot find symbol
    symbol : class ChatInterface
    location: class ChatServlet
    chi = (ChatInterface)Naming.lookup("rmi://127.0.0.1:1099/ChatService");
    I will very much appreciate if somebody would tell me how to fix this problem. I am already using -classpath for servlet.jar so not sure how to add another classpath, or some other way to fix it.
    Thank you,
    Victor.

    Hi,
    I tried this command:
    javac -classpath "./servlet.jar;./ChatInterface.class" ChatServlet.java
    But now I have more compilation errors:
    javac -classpath "./servlet.jar;./ChatInterface.class" ChatServlet.java
    ChatServlet.java:5: package javax.servlet does not exist
    import javax.servlet.*;
    ^
    ChatServlet.java:6: package javax.servlet.http does not exist
    import javax.servlet.http.*;
    ^
    ChatServlet.java:10: cannot find symbol
    symbol: class HttpServlet
    class ChatServlet extends HttpServlet
    ^
    ChatServlet.java:18: cannot find symbol
    symbol : class ChatInterface
    location: class ChatServlet
    ChatInterface chi;
    ^
    ChatServlet.java:19: cannot find symbol
    symbol : class ChatInterface
    location: class ChatServlet
    chi = (ChatInterface)Naming.lookup("rmi://127.0.0.1:1099/ChatService");
    ^
    5 errors
    Not sure how to fix that :-(
    Victor.

  • JavaCode as String to RMI Task.

    I am creating a load balancing application that consists of many clients and one server. The client will read in a JOB file that consists of "java functions" I then want to remotely execute this function using RMI. The problem however is how do I take the function code and use it with RMI without a wrapper class and compiling (if possible)
    Weldon

    the suggestion is the standard client invokes methods to execute at the server.
    my understanding of your requirement is to load balance, with one server, where is the load balancing with this approach?
    you could export the clients and have the servers pass an instantiated interface with arguments, and have client call the method to execute it at the client side. the server must know how to dispense work.
    Hi.
    I think the simplest solution is :
    You have Remote interface of your server with amethod
    known to all client, for example "Object
    performJob(String jobName, Object[]jobParameteres)".
    Where jobName is name of java function, and
    jobParameteres is necessary data to pass in thisjava
    function.
    In implementation of performJob(..) method (onserver
    side) you may call right method using reflectionapi
    (you know method name and parameters)
    If it is acceptable for you, I may respond to your
    additional questions. :)Is there a way to take actual java code (not compiled)
    and then run it with RMI?

  • Practical meaning of Retention policies

    Could anybody explain me practical usage for RetentionPolicy.CLASS ?
    I see quite clearly usage of RUNTIME policy, I could understand practical meaning of SOURCE but what about CLASS ? What for?
    Maybe explanation of practical usage of all would be best.
    thanx a lot

    I have a marker annotation @Instantiable and associated processor.
    The semantics of this is that the processor checks that any concrete class extending or implementing a target of @Instantiable will be checked to make sure that it has a publicly accessible no argument constructor.
    For example, in this case compiling these
    @Instantiable interface Foo {
        int getBar();
    class Baz implements Foo {
        public int getBar() { return 0; }
    }will cause a build time error from the annotation processing tool (maybe javac for instance) because Baz does not have a public no args constructor.
    Now if @Instantiable's retentionPolicy was SOURCE, then the annotation processor would not know that Foo was @Instantiable when Foo was in a library that Baz was being compiled against.
    @Instantiable does not need a RUNTIME retention policy because we only need this at build time.
    This is a case where retention policy CLASS is useful.
    More generally, it is useful where a tool needs to see the annotation via an arms length reflection API, (e.g. com.sun.mirror or javax.lang.model.*), and the source might not be available, but not via the runtime reflection API (java.lang.reflect).
    Bruce

  • Looks like instantiation of interfaces; what is it?

    Some of the code examples I see look like instantiation of interfaces. But this is not possible. I would like to know what is happening here 'under the hood' and would appreciate it if anyone can shed some light on this.
                jchkBold.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    setNewFont();
            });This looks like an attempt to instantiate an anonymous ActionListener.
    In the following example, which works fine, it appears that AudioClip has been instantiated.
    import java.net.URL;
    import java.applet.Applet;
    import java.applet.AudioClip;
    import javax.swing.JLabel;
    import javax.swing.JApplet;
    import javax.swing.ImageIcon;
    public class DisplayImagePlayAudio extends JApplet {
        private AudioClip audioClip;
        URL urlImage = this.getClass().getResource("./images/denmark.gif");
        URL urlAudio = this.getClass().getResource("./audio/denmark.mid");
        public DisplayImagePlayAudio() {      
        @Override
        public void init() {
            this.add(new JLabel(new ImageIcon(urlImage)));
            audioClip = Applet.newAudioClip(urlAudio);
            audioClip.play();
        @Override
        public void start() {
            if (audioClip != null) {
                audioClip.play();
        @Override
        public void stop() {
            if (audioClip != null) {
                audioClip.stop();
    }

    Equitus wrote:
    Thank you jverd. You explanation is clear. I had guessed that some kind of implicit instantiation of another object must be underneath this construction. I speculated that it might be a copy of its outer class, with the new instance implementing the interface. You have called it object X. Is this an instance of Object? Every instance of every class is an instance of Object. But no, it's not just "plain ol' Object." It's a new class that's defined on the fly that is a direct subclass of Object (in the case of implementing an interface) or a direct subclass of whatever parent class you specified with new (in the case of extending a class).
    Thanks also warnerja. I guess from your answer that there is a new copy of Applet class instantiated. The line here:
    private AudioClip audioClip;seems to declare an object AudioClip.It declares a variable of type "reference to AudioClip."
    Presumably the declarations do not determine if the entity is to become a primitive, object or object that extends or implements something else until the next step,It can't be a primitive unless the type you declare is one of the primitives, none of which have subtypes. If you declare it as a reference type (class or interface), as is done here, then all that say is that it's a reference that will either be null or will point to an object that is a concrete instance of the indicated type or a subtype. That is it will be that class or a subclass, or a class that implements that interface.
    in which the declaration becomes an entity of some kind. Now you're just making up terms. It's just a variable, and the variable has a type. This is true for all variables. There's no "entity of some kind" voodoo.
    Am I correct to conclude that you can cast Applet as AudioClip?Er, no. Why would you think that?

  • BasicFileAttributes---can interfaces be instantialized?

    Hi,
    I have a question regarding the "BasicFileAttributes".
    It is an interface? Or is there any class with the same name? As I know interface can not be instantialized, but I find this line from the sample code provided in java tutorials:
    "BasicFileAttributes attr = Attributes.readBasicFileAttributes(file);"
    anyone can help me to solve this problem for me? thanks

    Tian123 wrote:
    Thank you very much for your reply. I think I misunderstood the definition of instantiation. But what is the point of this line:
    Foo foo = new Bar();what effect does it have on "foo"? The variable foo is declared to hold a reference to an instance of Foo. If Foo is a class, then an instance of any subclass of Foo is also an instance of Foo. If Foo is an interface, then an instance of any class the implements the interface is also an instance of Foo.
    The point is coding to the interface. You should be able to google that phrase for details, but the basic idea is that you don't care what the actual implementation is, only what the type is.
    One example is JDBC. In the java.sql package, Connection, Statement, RestultSet, and a whole bunch of others are interfaces. When we do Connection con = DriverManager.getConnection(...); we don't know or care what implementation class will be provided by the vendor, or even what vendor will be supplying it--Oracle, MySQL, etc.
    Another example is this:
    List list = new ArrayList();By declaring it as List instead of ArrayList, I'm saying that when I use the list variable, I don't care which implementation it is, as long as it meets List's contract. Later, if I decide that a LinkedList is more appropriate, I only have to change new ArrayList() to new LinkedList(). Nothing that uses the list variable needs to know or care.
    >
    And in these three lines:
    Path file = ...;
    BasicFileAttributes attr = Attributes.readBasicFileAttributes(file);
    TimeUnit resolution = attr.resolution();First, the return type of the function is readBasicFileAttributes(file). what is the point to return a interface type?Same as above: You only care about the type (what the object can do), not the implementation (how it does it).

  • Anonymous class instantiation expression with interface implementation??

    Is it possible to create an inline anonymous class instatiation expression that can implements an interface?
    For example:
    Frame myFrame = new Frame() implements WindowListner {
         public void WindowOpened(WindowEvent  e) {}
             +other interface methods....+
    }Apparently compiler doesn't like this code:(
    I know that I can create an extra named class with the interface, then instantiate it instead. But this is not what I want.
    (By the way, if someone wants to know why I want to do this, I say I think this may make my code simpler or look better, that's all:) )

    abstract class ListenerFrame extends Frame implements WindowListener {} This look pretty neat:)
    I guess I can rewrite my code then:
    abstract class FrameWithListener extends Frame
             implements WindowListener{}      //local class
    Frame myFrame = new FrameWithListener {
            public void WindowOpened {}
               blah, blah...
    }Not sure I can use abstarct class as local class, but otherwise I'll use it as a class member or some sort..
    Thank you for the reply
    Edited by: JavaToTavaL on Nov 27, 2009 4:04 AM
    Edited by: JavaToTavaL on Nov 27, 2009 4:04 AM

  • A more successful experiment in creating compositable user interfaces for Config Dialogs

    A couple weeks ago I posted an experiment in creating compositable user interfaces using transparent subpanels. The approach might best be described as, "It at least was notable for being novel."
    Today, I'm posting another attempt, this one along more traditional lines, and far more successful. Particularly notable: this one can do all the arbitrary composition of the last one AND it solves the TAB order problem.
    This solution uses a picture control and renders N copies of a control. When the user tabs to a control or moves the mouse over the control, a real control slides into that position to be able to catch the events (update mouse over draw state, highlight for keyboard focus, handle typing, etc). When the Value Change occurs, a master array of data is updated and the picture control is updated.
    This is something that has been attempted in various forms in the past, but there are two aspects of this particular implementation that make it nice:
    its programmatic interface for specifying the behavior of the various objects should make it fairly easy for a user of the framework to programmatically generate their dialogs
    it handles the TAB problem without flickering, something I haven't seen in other attemps
    This idea spawns out of conversation about the previous experiment -- thanks to those of you who posted on various forums, e-mailed me, or, in a couple cases, showed up at my desk. That last one is not something I'm encouraging unless you work at NI... just saying. :-)
    Now, this experiement has already yeilded some interesting conversation. We note that as long as controls are instantiated independent of each other -- that is, no property of one control depends upon the property of another control -- this dialog system scales nicely. But in this experiment, I implemented Radio Buttons, which interact with each other -- when one is set True, the others go False. As soon as controls start interacting with each other (such as graying out one control when a checkbox is toggled, or having expandable sections, or really complex cases like updating a graph as some options change, like happens in some Express VI config dialogs) then we start needing ways to refer to the other controls. This rapidly moves us in one of two directions: naming controls or creating references. The naming approach is definitely my preference as it fits better with dataflow and I can do some interesting effects with breaking apart some of the tree. But all of this quickly starts sounding like "Please implement a XAML parser in LabVIEW." For those of you unfamiliar with XAML, in the world of UI design, it might very well be the coolest thing since sliced bread. A XAML string would indeed fit with dataflow, and we could start building that up. I hesitate to head down this road for two reasons. One, as many have noted, there's really not a good XML parsing library written in LabVIEW that can give me a useful DOM tree. Two, that's a huge project and my gut sense is that you'd have to complete a fairly large chunk of it before you'd start seeing any return on investment. But it is worth thinking about -- I might be wrong. Wouldn't be the first time. This code that I've posted today can at least get you started on the generation side if one of you decides to become industrious.
    I'm turning my attention away from this project for now... coding in G is lots of fun, and I wish I could spend more days doing it, but this has been a side project and it's time to get back to my assigned projects in text programming. Building a powerful platform for automatic UI generation in LabVIEW would be really useful -- I see lots of requests for this sort of thing, and other languages are pulling ahead of us in this domain.
    [UPDATE 5/17/2012 - There is an improved version.]
    Solved!
    Go to Solution.
    Attachments:
    ConfighThroughCtrlCreation.zip ‏558 KB

    Elijah K wrote:
    Thanks for posting this Aristos.  I would normally be one of those to go bug you at your desk, but in case I'm not the only one with this question... which particular flickering problem are you referring to?  The act of switching tabs?  In all honesty, I've never noticed...
    When you move controls around on the screen, normally you try to Defer Panel Updates while you do that. But Defer Panel Updates has an effect on control's abilities to catch certain mouse clicks, so when you're trying to move a control to catch the mouse, you have to work a lot without Defer Panel Updates, so if you're adjusting captions, etc, to match the new location, you can see flicker as properties adjust. You can move the control off-screen, as long as you have already updated the picture control to reflect the changes. It took a while to catch all the ways that the flickering can crop up. I think I got 'em all.
    Attached are the VIs saved for LV 2009. Actually, they're saved for LV 8.6, but it doesn't work in 8.6 because of a bug in the picture control that existed back then.
    Attachments:
    ComposableUI_LV2009.zip ‏391 KB

  • A problem while getting a EJB remote interface from SJSAS 9.0

    I hava deployed a session bean in SJSAS 9.0
    I wrote some codes to get the remote interface as follow:
    Context ctx = null;
    Hashtable env = new Hashtable();
    env.put ("java.naming.factory.initial","com.sun.jndi.cosnaming.CNCtxFactory");
    env.put("java.naming.provider.url","iiop://127.0.0.1:3700");
    try {
    ctx = new InitialContext(env);
    } catch (NamingException ex) {
    ex.printStackTrace();
    try {
    Object cs =ctx.lookup(ejb.MySessionBean);
    } catch (NamingException ex) {
    ex.printStackTrace();
    A exception occured during the lookup operation.
    javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
    at com.sun.jndi.cosnaming.ExceptionMapper.mapException(ExceptionMapper.java:44)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:453)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
    at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
    at javax.naming.InitialContext.lookup(InitialContext.java:351)
    at demo.Main.run(Main.java:46)
    at demo.Main.main(Main.java:62)
    Caused by: org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
    at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHelper.java:72)
    at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub.java:406)
    at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
    ... 5 more
    Anyone can solve this problem for me???
    Thanks a lot

    We don't recommend explicitly instantiating the CosNaming provider within a stand-alone java client when accessing beans within the Java EE SDK. We have a simpler approach that involves just instantiating the no-arg InitialContext. Details are in our EJB FAQ :
    https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Using an interface as a type

    Hi
    Im reading someone elses code and theres something i dont understand. I read the sun trial on interfaces and see that an interface can be declared as a type by a class which implements said interface. Also that interfaces cannot be instantiated.
    In the code a class named DictEngine which implements IDictEngine declares the following:
    IDatabase[] fDatabases = new IDatabase[0];
    IDataBase is an interface. All the classes and interfaces are in the same package. As i understand it an array called fDatabases of type IDatabase is being declared.
    Basically i don't understand what this acheives, its possible to instantiate interfaces ?
    Thanks

    Not that the following code would be too useful, but
    // create storage for 4 references to some object which implements comparable
    Comparable[] c = new Comparable[4];
    c[0] = "a string";
    c[1] = new Integer(5);
    c[2] = new Double(42.0);
    c[3] = new Date();
    so what i don't underatand is what type of object the array will reference since interfaces cant be instantiated.What ever you put in there

  • How to instantiate a control in code instead of using Interface Builder ?

    I really appreciate the combination of the interface builder and Xcode altogether.
    However when I am learning QT, I realize I had been pampered by Apple's Design to a certain extend as I only need to create say a NSLabel instance and use Interface Builder to do the linking and never have to worry about instantiating the Object myself.
    But I'm curious, what is the way to instantiate a new hmmm say...NSLabel in the code ?
    NSLabel* label = new NSLabel();
    Then what ?
    What you are seeing here is how QT did it, could anyone create an equivalent in ObjC ? No fancy code please, just bare minimum.
    #include <QApplication>
    #include <QWidget>
    #include <QLabel>
    int main (int argc, char * argv [ ])
    QApplication app(argc, argv); //NSApplication in ObjC
    //These two lines merely created a window and set the title bar text.
    QWidget* window = new QWidget();
    window->setWindowTitle("Hello World");
    QLabel* label = new QLabel(window);//Create a label and inform the it belongs to window.
    label->setText("Hello World");
    window->show();
    return app.exec();
    Message was edited by: Bracer Jack

    Hi Jack -
    I think my best answer will be something of a disappointment, because I don't know how to show a one-to-one correspondence between the code you're working with and a Cocoa program. The main function of a Cocoa GUI program for OS X will look something like this:
    #import <Cocoa/Cocoa.h>
    int main(int argc, char *argv[])
    return NSApplicationMain(argc, (const char **) argv);
    As you commented, we could draw a correspondence between the first statements, but after that the functionality of the Cocoa program is going to be spread out in a way that makes for a rather tedious comparison. The only way I know to answer your question in less than 5000 words, is to skip ahead to one of several points in the startup sequence where the programmer can intervene with custom code.
    For example, a common way to get control would be to program a custom controller class and add an object of that class to the main nib file which is loaded during the startup sequence. By making a connection to the Application object in that nib file, the custom object could be made the delegate of the Application object, and if we then added a method named applicationDidFinishLaunching, our code would run as soon as the application's run loop was started.
    Now I finally have enough context to directly answer your question, so here is the code to create a label and add it to the key window at launch time:
    // MyAppController.m
    #import "AppController.h"
    @implementation AppController
    - (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
    NSLog(@"applicationDidFinishLaunching");
    NSRect frameRect = NSMakeRect(150, 300, 150, 30);
    NSTextField *label = [[NSTextField alloc] initWithFrame:frameRect];
    [label setEditable:NO];
    [label setStringValue:@"Hello World!"];
    [label setFont:[NSFont labelFontOfSize:20]];
    [label setAlignment:NSCenterTextAlignment];
    NSView *contentView = [self.window contentView];
    [contentView addSubview:label];
    @end
    If I needed to develop a worst case scenario for this thread, the next question would be, "Ok sure, but your code still needs a nib to start up. I want to see a Cocoa GUI program that doesn't require any nib".
    It turns out that it's quite easy to build a simple iPhone app without any nib, but it's considerably more difficult for an OS X app. If anyone wants to see my nib-less iPhone code, I'll be happy to post it (I think I did post it here once before, and the response was underwhelming). But I've never attempted the much more difficult nib-less OS X app. Just in case you really want to go there, here's a blog that goes into the details: [http://lapcatsoftware.com/blog/2007/07/10/working-without-a-nib-part-5-open-re cent-menu>.
    Hope some of the above is helpful!
    - Ray

  • Error in CLR: InvalidOperationException - The current type is an interface and cannot be constructed. Are you missing a type mapping?

    Hi, I'm trying to execute a .NET assembly's method from SQL Server 2012 Express, but I'm stuck with this error calling the sp:
    Microsoft.Practices.ServiceLocation.ActivationException: Activation error occured while trying to get instance of type ISymmetricCryptoProvider, key "TripleDESCryptoServiceProvider" ---> Microsoft.Practices.Unity.ResolutionFailedException:
    Resolution of the dependency failed, type = "Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider", name = "TripleDESCryptoServiceProvider".
    Exception occurred while: while resolving.
    Exception is: InvalidOperationException - The current type, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider, is an interface and cannot be constructed. Are you missing a type mapping?
    At the time of the exception, the container was:
      Resolving Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider,TripleDESCryptoServiceProvider
     ---> System.InvalidOperationException: The current type, Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.ISymmetricCryptoProvider, is an interface and cannot be constructed. Are you missing a type mapping?
    System.InvalidOperationException:
       en Microsoft.Practices.ObjectBuilder2.DynamicMethodConstructorStrategy.ThrowForAttemptingToConstructInterface(IBuilderContext context)
       en BuildUp_Microsoft.Practices.EnterpriseLibrary.Security
    Microsoft.Practices.ServiceLocation.ActivationException:
       en Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance(Type serviceType, String key)
       en Microsoft.Practices.ServiceLocation.ServiceLocatorImplBase.GetInstance[TService](String key)
       en Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.GetSymmetricCryptoProvider(String symmetricInstance)
       en Microsoft.Practices.EnterpriseLibrary.Security.Cryptography.Cryptographer.DecryptSymmetric(String symmetricInstance, String ciphertextBase64)
       en ...
    Is there any limitation by design for Interface instantiation from CLR database?
    Any help I will appreciate, thanks a million!!

    Bob, thanks for your response.. Yes, the code works fine outside of SQLCLR. This is the class I'm trying to instantiate, I'm using it to envolve Cryptographer, an Enterprise Library 5.0 class actually, so I have no control to test it without referring the
    interface.
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using Microsoft.Practices.EnterpriseLibrary.Security.Cryptography;
    using System.Security.Cryptography;
    using Microsoft.SqlServer.Server;
    using System.Data.SqlTypes;
    namespace Cars.UtileriasGlobales.Helpers
        /// <summary>
        /// Clase que permite encriptar y desencriptar cadenas de textos utilizando
        /// TripleDESCryptoServiceProvider de Enterprise Library 5.0
        /// </summary>
        public static class Cryptography
            #region Metodos
            [SqlProcedure]
            public static void DesencriptarSQLServer(SqlString cadena, out SqlString cadenaDesencriptada)
                cadenaDesencriptada = !String.IsNullOrEmpty(cadena.ToString()) ? Cryptographer.DecryptSymmetric("TripleDESCryptoServiceProvider", cadena.ToString().Replace(" ", "+"))
    : String.Empty;
            #endregion
    I have collected all the dependent assemblies in one directory 'C:\migrate', so the create assembly finish ok. This is the script to create the assembly I'm using:
    sp_configure 'clr enable', 1
    GO
    RECONFIGURE
    GO
    ALTER DATABASE cars SET TRUSTWORTHY ON
    GO
    CREATE ASSEMBLY CryptographyEntLib5
    AUTHORIZATION dbo
    FROM 'C:\migrate\Cars.UtileriasGlobales.dll'
    WITH PERMISSION_SET = UNSAFE
    GO
    CREATE PROCEDURE usp_Desencriptar
    @cadena nvarchar(200),
    @cadenaDesencriptada nvarchar(MAX) OUTPUT
    AS EXTERNAL NAME CryptographyEntLib5.[Cars.UtileriasGlobales.Helpers.Cryptography].DesencriptarSQLServer
    GO
    DECLARE @msg nvarchar(MAX)
    EXEC usp_Desencriptar 'Kittu And Tannu',@msg output
    PRINT @msg

  • SOAP To File Interface - How to trace?

    Hi all,
    I've built the following interface:
    Outbound communication channel: SOAP Sender
    Outbound Interface: MI_Outbound_PatientDemographics
    Mode: Asynchronous
    Inbound Communication channel: File Receiver
    Inbound Interface: MI_Inbound_NauticusGetPatientInfoReq
    Mode: Asynchronous
    I generated a .WSDL file for this interface.
    ==================== START Generated WSDL file ===============
    <?xml version="1.0" encoding="UTF-8"?>
    <wsdl:definitions name="MI_Outbound_PatientDemographics" targetNamespace="urn:fapl:oots:xi:testNamespace1" xmlns:p2="http://new.webservice.namespace" xmlns:p1="urn:fapl:oots:xi:testNamespace1" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><wsdl:types><xsd:schema targetNamespace="http://new.webservice.namespace" xmlns="http://new.webservice.namespace" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><xsd:element name="GetPatientDemographicReq"><xsd:annotation><xsd:documentation>Request Message</xsd:documentation></xsd:annotation><xsd:complexType><xsd:sequence><xsd:element name="Header" form="qualified"><xsd:complexType><xsd:all><xsd:element name="Encoding" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="SendingApp" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="SendingFac" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="ReceivingApp" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="ReceivingFac" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="TimeStamp" type="xsd:dateTime" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="MessageType" type="xsd:string" minOccurs="0" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="MessageId" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="MessageDesc" type="xsd:string" minOccurs="0" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /></xsd:all></xsd:complexType></xsd:element><xsd:element name="PatientID" type="xsd:string" minOccurs="0" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="InstitutionID" type="xsd:string" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /><xsd:element name="SAPPatientID" type="xsd:string" minOccurs="0" form="qualified" xmlns:xsd="http://www.w3.org/2001/XMLSchema" /></xsd:sequence></xsd:complexType></xsd:element></xsd:schema></wsdl:types><wsdl:message name="p2.GetPatientDemographicInput"><wsdl:part name="GetPatientDemographicReq" element="p2:GetPatientDemographicReq" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" /></wsdl:message><wsdl:portType name="MI_Outbound_PatientDemographics"><wsdl:operation name="MI_Outbound_PatientDemographics"><wsdl:input message="p1:p2.GetPatientDemographicInput" /></wsdl:operation></wsdl:portType><wsdl:binding name="MI_Outbound_PatientDemographicsBinding" type="p1:MI_Outbound_PatientDemographics" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /><wsdl:operation name="MI_Outbound_PatientDemographics"><soap:operation soapAction="http://sap.com/xi/WebService/soap1.1" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /><wsdl:input><soap:body use="literal" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></wsdl:input></wsdl:operation></wsdl:binding><wsdl:service name="MI_Outbound_PatientDemographicsService"><wsdl:port name="MI_Outbound_PatientDemographicsPort" binding="p1:MI_Outbound_PatientDemographicsBinding" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"><soap:address location="<b>http://ootspdbs02:8001/XISOAPAdapter/MessageServlet?channel=:BS_NAUTICUS_OOTS:SOAP_Sender&version=3.0&Sender.Service=DummyService&Interface=DummyNamespace%5EDummyInterface</b>" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" /></wsdl:port></wsdl:service></wsdl:definitions>
    ==================== END Generated WSDL file ===============
    I've tested the following address:
    http://ootspdbs02:8001/XISOAPAdapter/MessageServlet?channel=:BS_NAUTICUS_OOTS:SOAP_Sender&version=3.0&Sender.Service=DummyService&Interface=DummyNamespace%5EDummyInterface
    After logging in with user: pisuper, I see a page:
    Message Servlet is in Status OK
    Status information:
    Servlet com.sap.aii.af.mp.soap.web.MessageServlet (Version $Id: //tc/xi/NW04S_06_REL/src/_adapters/_soap/java/com/sap/aii/af/mp/soap/web/MessageServlet.java#3 $) bound to /MessageServlet
    Classname ModuleProcessor: null
    Lookupname for localModuleProcessorLookupName: localejbs/ModuleProcessorBean
    Lookupname for remoteModuleProcessorLookupName: null
    ModuleProcessorClass not instantiated
    ModuleProcessorLocal is Instance of com.sap.aii.af.mp.processor.ModuleProcessorLocalLocalObjectImpl0
    ModuleProcessorRemote not instantiated
    The problem:
    When I try to test this WebService using XMLSpy, by loading the generated WSDL file into XMLSpy, and sending the request, I get an almost immediate response -
    <b>HTTP error: could not POST file
    '/XISOAPAdapter/MessageServlet?channel=:BS_NAUTICUS_OOTS:SOAP_Sender&amp;version=3.0&amp;Sender.Service=DummyService&amp;Interface=DummyNamespace%5EDummyInterface' on server 'ootspdbs02' (0)</b>
    And a second alert box in XMLSpy shows:
    The web service has sent an empty response!
    This is an asynchronous interface, so I assume there will be no response anyway.
    But when I go to SXMB_MONI and I filter for "Processed XML Messages", I cannot see any message.
    The output file was not generated as well.
    May I know :
    1. How I can trace if the message entered my web service?
    2. What do the error messages mean?
    Please help.
    Thanks.
    Ron

    Hi Bhavesh,
    Thank you for your reply.
    I've done the following changes:
    1. Change the "Quality of Service" in "Communication Channel" to "exactly once".
    2. Regenerate the WSDL.
    3. Update the URL on the WSDL to:
    <b>http://ootspdbs02:8001/XISOAPAdapter/MessageServlet?channel=:BS_NAUTICUS_OOTS:SOAP_Sender&version=3.0&QualityOfService=ExactlyOnce&Sender.Service=dummysvc&Interface=dummyNS%5EdummyInterface</b>
    4. Inserted a new logging configuration -
        Category: Runtime
        Parameters: LOGGING_SYNC
        Current_Value: 1
    However, I still encounter the same error -
    HTTP error: could not POST file
    '/XISOAPAdapter/MessageServlet?channel=:BS_NAUTICUS_OOTS:SOAP_Sender&amp;version=3.0&amp;QualityOfService=ExactlyOnce&amp;Sender.Service=dummysvc&amp;Interface=dummyNS%5EdummyInterface' on server ootspdbs02 (0)
    And
    "The web service has sent an empty response!"
    Please point out my mistake.
    Thanks.
    Ron

  • Trigger GP process by giving  process URL in Interface View outbound plug

    Hi,
    My Requirement is,
    I have 1 GP process implemented in webdynpro.
    From 1 of my view I am calling the process completeion(executionContext.processingComplete();) code, written in interface controller.
    After this code I need to start the same process once again, without clicking any link.
    For this I have created 1 outbound plug in the interface view of my window(out blug for WebDynproCOInterfaceView with parameter "Url").
    Then after calling executionContext.processingComplete();, I gave
    wdThis.wdGetWebDynproCOInterfaceViewController().wdFirePlugGotoUrl("Process Instantiation URL"); in my view.
    but it is giving error,"WDRuntimeException: Cannot navigate from view WebDynproCOInterfaceView via non-existent outbound "
    Also I tried to start the gp process througn coding also
    what I tried is,
    IWDClientUser wdUser = WDClientUser.getCurrentUser();
    IUser user1 = wdUser.getSAPUser();
    IGPUserContext userContext = GPContextFactory.getContextManager().createUserContext(user1);
    IGPProcess process = GPProcessFactory.getDesigntimeManager().getActiveTemplate("EB0B28E08B6011DB0145EB416E0",userContext);
    EB0B28E08B6011DB0145EB416E0 is the process ID.
    This code I have tried by giving before and after the completion of the previous process(process9executionContext.processingComplete();)
    But this also didn't work..No error came. But process didn't start again after thecompleted once.
    Please help me out.
    Thanks
    smitha

    Hi Rupam,
    thanks for the reply
    I have given EXIT type of  outbound plug only. But it won't work if the view is  in portal.
    When I tried to create the process using GP API the process is creating in Background. For me , after the completion of one process , automatically next should trigger and the corresponding view should be visible for the user.
    Process is triggering using GP API but, the view is not visible to user.
    Please help me
    Thanks
    Smitha

  • Class Instantiation Issues...

    Hi,
    We are currently having issuses with a Class Interface.  Everything was working fine with it, and now it says that the class is 'not instantiated'.  If you are in SE80 or SE24 and try to test a class (e.g. CL_HRRCF_APPLICATION_CTRL), you will get a pop-up that allows you to replace generic parameter types.  Now with the non-working class, it gives a screen similar to your transport organizer, with the class name at the top with '<not instantiated>' beside it, and a list of methods below it.  This Class is being used through the web.  Also, in the title bar in 6.40, it says, 'Test Class CL_HRRCF_GLOBAL_CONTEXT: No Instance'.
    <phew>... so, has anyone else run into a problem like this, and if not, does this make enough sense?  Is there a way of instantiating a Class Interface without calling it from a program, like generation?
    Best regards,
    Kevin
    Message was edited by: Kevin Schmidt

    Hi Kevin
    I am also working on an eRecruitment 3.0 ramp-up project. What I have found is that most of the classes etc used rely on other classes etc further up the chain, they cannot be tested in isolation. Instead it is normally necessary to set a breakpoint and then log into the eRecruitment Fornt end via a web browser. The class will then be instantiated in the normal process, as you work through the system pages, and called appropriately.
    This is a BSP issue. The class in question is a basic building block of the eRecruitment BSP pages.
    Regards
    Jon Bowes [ Contract Developer ]

Maybe you are looking for

  • Advice on how to make this look up?

    Hello everyone. I was wondering if anyone can give me advice on how to do this to make it the last complex. I thought up some complex solutions that will work but seem messy in some ways. I need to create a look up, I'm parsing a file and transformin

  • JDBC : Fatal Error: Column Doesn't exist error .

    Hello all,    I am getting following error in a JDBC adapter monitoring : Error when executing statement for table/stored proc. 'Purchase_Order' (structure 'STATEMENTNAME'): java.sql.SQLException: FATAL ERROR: Column 'Test' does not exist in table 'P

  • Quicktime start & Stop not working in Inspector.

    I drag an MPEG4 file to Keynote 09 (5.1) as soundtrack. I click onto Quicktime to use just a snippet of the song, but it is not available....I can only use the entire song. How can I fix this? Also, can I adjust the volume from slide to slide? or doe

  • Exceeding ISE license counts - performance consequences?

    Hello, I have a customer that is running a 2-node ISE deployment and is licensed for 250 Base and 250 Adv. users. We have moved the wired users over in one of their offices into Monitor Mode only, and the Base/Adv. Active license counts have exceeded

  • Route Filter - allowing specific users bypass filters - 900

    I want one user on my system be able to dial 1-900 number. The number we want to dial is a valid business toll-free number which we need to reach. I would like just one specific user to be able to call one specific 1-900-XXX-XXXX number. All other us