Occi AQ callback not called

I have written code for dequeing messages with blocking calls (Consumer::recieve), which works fine. Now I try to register a callback function, which should be called when a message is in the queue.
Some code:
void aq_connection::create_callback() {
payload = new Bytes(env); //?
Subscription newSubscription(env);
newSubscription.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
newSubscription.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
newSubscription.setPayload(*payload);
newSubscription.setCallbackContext((void *)this);
newSubscription.setSubscriptionName(quename + ":" + config->subscribername);
newSubscription.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
newSubscription.setNotifyCallback(&aq_connection::event_message);
mye callback method is defined like this:
static unsigned int event_message(oracle::occi::aq::Subscription &sub ,oracle::occi::aq::NotifyResult *not) {
std::cout << "got message\n";
return 0;
The problem is, the event_message function is never called... I send in messages into the queue with this stored procedure:
message := OURMSG_TYP(p_id, p_msg_type_id, p_msg, p_operation, p_data);
enqueue_options.visibility := DBMS_AQ.ON_COMMIT;
     enqueue_options.relative_msgid := NULL;
     enqueue_options.sequence_deviation := NULL;
     enqueue_options.transformation := NULL;
     message_properties.priority := 1;
     message_properties.delay :=     DBMS_AQ.NO_DELAY;
     message_properties.expiration := p_expiration;
     message_properties.correlation := NULL;
     --message_properties.recipient_list :=
     message_properties.exception_queue := vcp_exception_queue_name;
     --message_properties.sender_id :=
     message_properties.original_msgid := NULL;
     message_properties.transaction_group := NULL;
     message_properties.user_property :=     NULL;
     DBMS_AQ.ENQUEUE(
     queue_name => our_queue_name,
enqueue_options => enqueue_options,
message_properties => message_properties,
payload => message,
msgid => message_handle
Any obvious reason why my callback is never called?
regards,
Sverre

Thanks, once again. Sorry for my naive questions, but I'm unable to find a good example for this...
After registering the Subscriber, and creating the environment in EVENT mode, it seems like it is picking up the message. Once I send a AQ message, I get an error from visual studio, telling me the variable ESP was not properly saved across a function call. At least it reacts now :)
Could it be that I'm doing something wrong when defining or hooking my callback function? The breakpoint in the callback function is never called....
my registering routine now looks like this:
void aq_connection::create_callback() {
payload = new Bytes(env); //is this the correct way?
Subscription sub(env);
sub.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
sub.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
sub.setPayload(*payload);
sub.setCallbackContext((void *)this);
sub.setSubscriptionName(quename + ":" + config->subscribername);
sub.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
sub.setNotifyCallback(&aq_connection::event_message);
subs.push_back(sub);
conn->registerSubscriptions(subs);
I thought it was ok to create a local Subscription instance, as I put it into the global subs-vector.
Thanks in advance,
Sverre

Similar Messages

  • OCCI AQ Subscription: callback not called

    When data changed in table, I want my application to know immediately. So I use the Subsription class. The implements as follows. When I insert row to table set_tab_info, the triggers acts, but the callback not called. What's wrong?
    --create multi consumer queue table
    BEGIN
    dbms_aqadm.create_queue_table (
                                       queue_table => 'hr.table06',
                                       queue_payload_type => 'RAW',
                                       comment => 'multi-consumer',
                                       multiple_consumers => TRUE,
                                       compatible => '8.1.0'
    END;
    --create multi consumer queue
    BEGIN
    dbms_aqadm.create_queue (
                                  queue_name => 'queue06',
                                  queue_table=> 'hr.table06'
    END;
    BEGIN
    dbms_aqadm.start_queue(queue_name => 'queue06');
    END;
    --create table
    CREATE TABLE set_tab_info(
         flag NUMBER
    --create trigger, as a test, the payload is a byte
    CREATE OR REPLACE TRIGGER tablechangeNew
         AFTER UPDATE OR INSERT OR DELETE
         ON set_tab_info
         FOR EACH ROW
    DECLARE
         enqopt dbms_aq.enqueue_options_t;
         mprop dbms_aq.message_properties_t;
         enq_msgid RAW(16);
         rcpt_list dbms_aq.aq$_recipient_list_t;
    BEGIN
         rcpt_list(0) := sys.aq$_agent('RECEIVER06', null, null);
         mprop.recipient_list := rcpt_list;
         dbms_aq.enqueue(
                        queue_name => 'hr.queue06',
                        enqueue_options => enqopt,
                        message_properties => mprop,
                        payload => HEXTORAW('61'),
                        msgid => enq_msgid);
    END;
    #include <iostream>
    #include <iomanip>
    #include <string>
    #include <cstdlib>
    #include <vector>
    using namespace std;
    #include "occi.h"
    using namespace oracle::occi;
    #include "occiAQ.h"
    using namespace oracle::occi::aq;
    string username("HR");
    string password("HR");
    string connstr("192.168.8.22:1521/study");
    Environment* p_env = NULL;
    Subscription* p_sub = NULL;
    Connection* p_conn = NULL;
    vector<Subscription> sub_vec;
    class NotifyRegister
    public:
         static unsigned int callback(Subscription& sub, NotifyResult* nr)
              //nr->getPayload();
              //Message msg = nr->getMessage();
              //Bytes bt =nr->getMessageId();
              cout << "callback was called!" << endl;
              return 0;
         void notifyTest()
              p_env = Environment::createEnvironment(Environment::EVENTS);
              p_sub = new Subscription(p_env);
              p_sub->setSubscriptionNamespace(Subscription::NS_AQ);
              //SCHEMA.QUEUE:CONSUMER_NAME
              p_sub->setSubscriptionName("HR.QUEUE06:RECEIVER06");
              p_sub->setPresentation(Subscription::PRES_DEFAULT);
              p_sub->setProtocol(Subscription::PROTO_CBK);
              p_sub->setNotifyCallback(&NotifyRegister::callback);
              //what's the context mean, how to set?
              p_sub->setCallbackContext((void*)this);
              p_env->enableSubscription(*p_sub);
              p_conn = p_env->createConnection(username, password, connstr);
              sub_vec.push_back(*p_sub);
              p_conn->registerSubscriptions(sub_vec);
    int main()
         NotifyRegister nr;
         nr.notifyTest();
         pause();
         return EXIT_SUCCESS;
    I don't know how to set the callback context. so just use this statement:
    p_sub->setCallbackContext((void*)this);

    Thanks, once again. Sorry for my naive questions, but I'm unable to find a good example for this...
    After registering the Subscriber, and creating the environment in EVENT mode, it seems like it is picking up the message. Once I send a AQ message, I get an error from visual studio, telling me the variable ESP was not properly saved across a function call. At least it reacts now :)
    Could it be that I'm doing something wrong when defining or hooking my callback function? The breakpoint in the callback function is never called....
    my registering routine now looks like this:
    void aq_connection::create_callback() {
    payload = new Bytes(env); //is this the correct way?
    Subscription sub(env);
    sub.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    sub.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    sub.setPayload(*payload);
    sub.setCallbackContext((void *)this);
    sub.setSubscriptionName(quename + ":" + config->subscribername);
    sub.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    sub.setNotifyCallback(&aq_connection::event_message);
    subs.push_back(sub);
    conn->registerSubscriptions(subs);
    I thought it was ok to create a local Subscription instance, as I put it into the global subs-vector.
    Thanks in advance,
    Sverre

  • Failover callback not called when listener dies

    I need to create a RAC-aware Pro*C application.
    I got the preconfigured VirtualBox images with OL 5 and RAC nodes.
    The listener is installed on both machines too. They share a single IP address for the listener, which I added to the hosts file:
    192.168.56.201   rac-scan.localdomain    rac-scanActually, the cluster decides to create a virtual network adapter on one of the nodes and this address is assigned to it and then the listener becomes awailable. When this node dies, the cluster starts the listener on another node.
    I don't know, whether it's a proper way. I heard that the listener should be on a separate machine.
    But the problem is: when I turn off the node my client program is connected to, the failover callback function is not called. The next oracle operation fails with "ORA-03114: not connected to ORACLE".
    I followed http://docs.oracle.com/cd/A91202_01/901_doc/appdev.901/a89857/oci09adv.htm#428924 and https://support.oracle.com/CSP/main/article?cmd=show&type=NOT&id=415245.1 to create the sample program that registers the callback.
    Could it be that the failover only works when the DB service fails, but not the listener?

    The problem was bad connection string

  • Air.swf GetApplicationVersion callback not called

    I am trying to use air.swf from
    http://airdownload.adobe.com/air/browserapi
    per the Adobe documentation to detect if an air application is
    already installed. I'm using getApplicationVersion but the callback
    function is never called. launchApplication() and
    installApplication() work fine.
    The code looks like this:
    _air.getApplicationVersion(appID, pubID,
    versionDetectCallback);
    VersionDetectCallback() is never called. I de-compiled the
    air.swf and ran the code directly to try and figure out what's
    failing. But I get the same result. I can see the timer on the
    LocalConnection endpoint timing out after 5 seconds. I just can't
    figure out why the appinstaller is not calling back. The actual
    call (taken from the decompiled swf) looks like this:
    airappinstaller = new ProductManager("airappinstaller");
    var launchArgs:Array;
    launchArgs = ["-isinstalled", appID, pubID, "adobe.com" + ":"
    + lcName, "onApplicationVersion"];
    airappinstaller.launch(launchArgs.join(" "));
    where onApplicationVersion is the endpoint callback function
    and lcName is the LocalConnection name.
    Anyone know why GetApplicationVersion() doesn't work?

    I am trying to use air.swf from
    http://airdownload.adobe.com/air/browserapi
    per the Adobe documentation to detect if an air application is
    already installed. I'm using getApplicationVersion but the callback
    function is never called. launchApplication() and
    installApplication() work fine.
    The code looks like this:
    _air.getApplicationVersion(appID, pubID,
    versionDetectCallback);
    VersionDetectCallback() is never called. I de-compiled the
    air.swf and ran the code directly to try and figure out what's
    failing. But I get the same result. I can see the timer on the
    LocalConnection endpoint timing out after 5 seconds. I just can't
    figure out why the appinstaller is not calling back. The actual
    call (taken from the decompiled swf) looks like this:
    airappinstaller = new ProductManager("airappinstaller");
    var launchArgs:Array;
    launchArgs = ["-isinstalled", appID, pubID, "adobe.com" + ":"
    + lcName, "onApplicationVersion"];
    airappinstaller.launch(launchArgs.join(" "));
    where onApplicationVersion is the endpoint callback function
    and lcName is the LocalConnection name.
    Anyone know why GetApplicationVersion() doesn't work?

  • AQ callback not called in some environments

    Hi,
    I've got a client program that subscribes to a queue, and registers a callback that is called whenever a message is enqueued. This works fine on most computers, but on some computers this callback is never called. I've run it both in debug and release, and the breakpoint in the callback is never hit. On most computer thought, this works all the time.
    This is how I register the callback:
    sub = new Subscription(env);
    sub->setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    sub->setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    sub->setCallbackContext((void *)this);
    sub->setSubscriptionName(queue_name + ":" + config["subscribername"]);
    sub->setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    sub->setNotifyCallback(&messagequeueclient_occi::event_message);
    subs.push_back(*sub);
    conn->registerSubscriptions(subs);
    both subs and sub are class variables, and the callback look like this:
    static unsigned int event_message(
    oracle::occi::aq::Subscription &sub,
    oracle::occi::aq::NotifyResult *nr
    I've tried to examine the difference between the machines, but they all sem to have the same oracle client version etc...
    Any tip would be greatly appreciated.
    Regards,
    Sverre

    Thanks, once again. Sorry for my naive questions, but I'm unable to find a good example for this...
    After registering the Subscriber, and creating the environment in EVENT mode, it seems like it is picking up the message. Once I send a AQ message, I get an error from visual studio, telling me the variable ESP was not properly saved across a function call. At least it reacts now :)
    Could it be that I'm doing something wrong when defining or hooking my callback function? The breakpoint in the callback function is never called....
    my registering routine now looks like this:
    void aq_connection::create_callback() {
    payload = new Bytes(env); //is this the correct way?
    Subscription sub(env);
    sub.setSubscriptionNamespace(oracle::occi::aq::Subscription::NS_AQ);
    sub.setProtocol(oracle::occi::aq::Subscription::PROTO_CBK);
    sub.setPayload(*payload);
    sub.setCallbackContext((void *)this);
    sub.setSubscriptionName(quename + ":" + config->subscribername);
    sub.setPresentation(oracle::occi::aq::Subscription::PRES_DEFAULT);
    sub.setNotifyCallback(&aq_connection::event_message);
    subs.push_back(sub);
    conn->registerSubscriptions(subs);
    I thought it was ok to create a local Subscription instance, as I put it into the global subs-vector.
    Thanks in advance,
    Sverre

  • Java script callback not called from plugin code

    Hi,
    I am having a plugin which works on FF 3.6. I am trying to make it work on FireFox 4/5. My java script callback for resize is getting called only for first time from plugin code and second time onwards its not getting called. We are using Gecko 2.0 plug-in library.
    I found two bugs in Firefox which may cause call to invalid callback.
    https://bugzilla.mozilla.org/show_bug.cgi?id=664682
    https://bugzilla.mozilla.org/show_bug.cgi?id=653083
    I think because of these two bugs my callback is not getting called. Is there any update for FireFox 4/Firefox5 with the fix for above two issues?
    Thanks,
    Rohit

    The first Bug is listed as a duplicate of the 2nd Bug you posted.
    I don't see any information in the Bug report about which version is going to specifically get the patch. Firefox 4 isn't supported any longer, and I can only assume that with an '''''Importance:''''' of '''normal''', that it won't be "pushed" to Firefox 5. AFAIK, with the new Fast Release schedule only security bugs are going create a situation where a '''''dot#''''' release is going to be made, and other Bugs that have been patched might then be included. With the current release schedule it's going to be 6 weeks between versions, vs the previous 12 to 14 months, or so.
    You may want to try a 6.0 beta to see if it is fixed there.

  • 10g registered callback not called

    I have the following method on the superclass of all the classes I've mapped in TopLink. I want the classes to know what session they come from, so that if they need to do any further queries, they can use the same one. I've selected this method for the Build event on the Post-X choice on the Events tab of each of my descriptors. The 'Informant' call would print to the log if the method were ever called, but it's not. Is there something else I need to do, or is this broken in 10g?
         public void postBuildEventCallback( DescriptorEvent aDescriptorEvent ) {
              Informant.debug( "postBuildEventCallback on "+this+" with "+aDescriptorEvent );
              setTopLinkSession( aDescriptorEvent.getSession() );
         }

    The mapping still appears in the MW when I shut down and re-open JDeveloper, so I wasn't worried that it hadn't been saved. However, it turns out I hand't rebuilt the toplink-deployment-descriptor.xml, so it wasn't making it to the runtime.
    Everything seems to be working fine now. Thanks!

  • Failover callback NOT registered. - What it's mean?

    Hi
    In the logs we receives information’s " ... Failover callback NOT registered." What it's exactly mean?
    We use TT RO Cache groups to RAC.
    The OracleDB and Oracle client the same version 10.2
    10:54:50.91 Info: ORA: 9391: ora-9391-0013-raStuff08713: refresh.c:4051 (srvH ctx func) = (0x00000000009b1358 0x0000000000000000(0x0000000000000000 0x0000000000000000) 0x0000000000000000) Failover callback NOT registered.
    BR
    Andrzej

    root@tbaltJSLEE1# ttVersion
    TimesTen Release 7.0.5.0.0 (64 bit Solaris/x86) (tt70:17001) 2008-04-04T00:06:18Z
    Instance admin: jnetx
    Instance home directory: /opt/TimesTen/tt70
    Daemon home directory: /var/TimesTen/tt70
    Access control enabled.
    root@tbaltJSLEE1#
    Command> call ttConfiguration;
    < CkptFrequency, 600 >
    < CkptLogVolume, 0 >
    < CkptRate, 0 >
    < ConnectionCharacterSet, UTF8 >
    < ConnectionName, ccompldsn >
    < Connections, 64 >
    < DataBaseCharacterSet, UTF8 >
    < DataStore, /data/DataStore/CCOMPL/ccomplds >
    < DurableCommits, 0 >
    < GroupRestrict, <NULL> >
    < LockLevel, 0 >
    < LockWait, 10 >
    < LogBuffSize, 65536 >
    < LogDir, /data/DataStore/CCOMPL/log >
    < LogFileSize, 64 >
    < LogFlushMethod, 1 >
    < LogPurge, 1 >
    < Logging, 1 >
    < MemoryLock, 0 >
    < NLS_LENGTH_SEMANTICS, BYTE >
    < NLS_NCHAR_CONV_EXCP, 0 >
    < NLS_SORT, BINARY >
    < OracleID, SUNSEED >
    < PassThrough, 0 >
    < PermSize, 1000 >
    < PermWarnThreshold, 90 >
    < PrivateCommands, 0 >
    < Preallocate, 0 >
    < QueryThreshold, 0 >
    < RACCallback, 1 >
    < SQLQueryTimeout, 0 >
    < TempSize, 64 >
    < TempWarnThreshold, 90 >
    < Temporary, 0 >
    < TransparentLoad, 0 >
    < TypeMode, 0 >
    < UID, CCOMPL >
    37 rows found.
    Command>

  • Custom Widget not calling cpSetValue in Runtime mode

    Hi,
    for some reason , Captivate Runtime is not calling cpSetValue throught the ExternalInterface... so this is really problematic as i need to retreive the movie_handle and the variable_handle.
    is anyone already experienced this problem?
    Thank you!
    E.

    Hi, thank you for helping me.
    So whats happend here is based on the documentation and other widget example, captivate at runtime is supposed to call cpSetValue using the ExternalInterface Call.
    The problem is, not callBack is been called in runtime... Work well in Edit and Stage Mode thought.
    if(ExternalInterface.available == true)
              Todo : Register all the ExternalInterface functions
              ExternalInterface.addCallback( "isStatic" , isStatic );
              ExternalInterface.addCallback( "getInspectorParameters" , getInspectorParameters );
              ExternalInterface.addCallback( "setInspectorParameters" , setInspectorParameters );
              ExternalInterface.addCallback( "setParameters" , setParameters );
              ExternalInterface.addCallback( "cpSetValue" , cpSetValue );
              ExternalInterface.addCallback( "getEditModeWidth", getEditModeWidth);
              ExternalInterface.addCallback( "getEditModeHeight", getEditModeHeight);
              ExternalInterface.addCallback( "IsReadyForSnapShot", IsReadyForSnapShot);
              ExternalInterface.addCallback( "getListOfUsedInternalResources", getListOfUsedInternalResources);
              ExternalInterface.addCallback( "getListOfUsedExternalResources", getListOfUsedExternalResources);
              ExternalInterface.addCallback( "SetExternalResources", SetExternalResources);
              ExternalInterface.addCallback( "SetInternalResources", SetInternalResources);
              ExternalInterface.addCallback( "GetWidgetAPIVersion", GetWidgetAPIVersion);
              ExternalInterface.addCallback( "SetStageModeSize", SetStageModeSize);
              ExternalInterface.addCallback( "SetCaptivateVersion", SetCaptivateVersion);
              ExternalInterface.addCallback( "SetLanguage", SetLanguage);
    i have my functions defined properly and as stated previously its working in Edit and Stage Mode.
    Thank you!
    E.

  • Air.swf getApplicationVersion() not calling back

    I am trying to use air.swf from
    http://airdownload.adobe.com/air/browserapi
    per the Adobe documentation to detect if an air application is
    already installed. I'm using getApplicationVersion but the callback
    function is never called. launchApplication() and
    installApplication() work fine.
    The code looks like this:
    _air.getApplicationVersion(appID, pubID,
    versionDetectCallback);
    function versionDetectCallback(version:String):void { do
    stuff }
    VersionDetectCallback() is never called. I de-compiled the
    air.swf and ran the code directly to try and figure out what's
    failing. But I get the same result. I can see the timer on the
    LocalConnection endpoint timing out after 5 seconds. I just can't
    figure out why the appinstaller is not calling back. The actual
    call (taken from the decompiled swf) looks like this:
    airappinstaller = new ProductManager("airappinstaller");
    var launchArgs:Array;
    launchArgs = ["-isinstalled", appID, pubID, "adobe.com" + ":"
    + lcName, "onApplicationVersion"];
    airappinstaller.launch(launchArgs.join(" "));
    where onApplicationVersion is the endpoint callback function
    and lcName is the LocalConnection name.
    It doesn't matter if I make the call from the Loader Init
    event or in a button click the callback function is never called. I
    am using Flash CS3.

    Hi Lisa,
    I am on windows yes,  and I seem to have got it working.  I found this problem to be very perculiar as there were many things my badge didnt like - such as a case statement instead of a load if if's.   anyway my solution is below,  although I must say, that now nothing happens if the user doesnt have air installed!  If they have Air installed but not my application, it will install my app but the need air installed first and that is not ideal!
    Maybe implementing your timer solution may help this?  Thanks for taking an interest!
    private var _toDo:String;
    private function onInit(e:Event):void
                _air = e.target.content;
                try
                  _air.getApplicationVersion(_applicationID, _publisherID, versionDetectCallback);
                catch (e:Error)
                  trace('air not installed');
                   root.statusMessage.text = 'Adobe Air not installed'
                   _toDo = new String("installAir")
    private function versionDetectCallback(version:String):void
                if (version == null)
                   trace('app not installed');
                   root.statusMessage.text = 'Coach Player not installed'
                   _toDo = new String("installApp")
                else
                   trace('app version ' + version + ' installed');
                   root.statusMessage.text = 'Application version ' + version + ' installed'
                   _toDo = new String("launchApp")
    private function onButtonClicked(e:Event):void
       root.statusMessage.htmlText = "onButtonClicked"
       if(_toDo == "installAir"){installAir()}
       if(_toDo == "installApp"){installApp()}
       if(_toDo == "launchApp"){launchApp()}
      protected function installAir():void
       root.statusMessage.text = 'Installing Adobe Air';
       _air.installApplication( _appURL, _airVersion, _arguments );
       //root.statusMessage.text = _appURL+" | "+ _airVersion+" | "+ _arguments
      protected function installApp():void
       root.statusMessage.text = 'Installing Coach Player';
       _air.installApplication( _appURL, _airVersion, _arguments );
       //root.statusMessage.text = _appURL+" | "+ _airVersion+" | "+ _arguments
      protected function launchApp():void
       root.statusMessage.text = 'Launching Coach Player';
       _air.launchApplication(_applicationID, _publisherID, _arguments);
       //root.statusMessage.text =  _applicationID+" | "+ _publisherID+" | "+ _arguments;
       //root.statusMessage.text = _arguments;

  • How to log in with my old Apple account? I forgot my pass and I did change my apple ID before canceling first?? I am from Croatia so did folow al the discussion and the to resolve the problem but no luck. Can not call from Croatia the Apple help desk

    How to log in with my old Apple account? I forgot my pass and I did change my apple ID before canceling first?? I am from Croatia so did folow al the discussion and the to resolve the problem but no luck. Can not call from Croatia the Apple help desk.i did try all the options but I can not find the phone number to call from Croatia,
    I can not change my Apple ID to the old mail (not possible!)
    The old mail don't accept the new password..
    I can not delete the Icloud all the time asking my the password of the old mail!
    I realy need help

    You can not merge accounts.
    Apps are tied to the Apple ID used to download them, you can not transfer them.

  • Web service handler could not called in client web service

    Hi All,
    I have two web service ServiceA & ServiceB and both implemented in weblogic.
    The ServiceA is SSL enable and protocol is https which is not published by me.
    The ServieB is my web service(wls8.1) and act as client for ServiceA.
    My problem is when i hit my service, its not able set the handler when it call ServiceA but it is invoking the service and giving application exception like authentication error.
    My service file:
    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.Iterator;
    import java.util.List;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.HandlerRegistry;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import weblogic.webservice.client.SSLAdapterFactory;
    import weblogic.webservice.client.WLSSLAdapter;
    public class HelloService {
    String wsdl = "https://188.122.123.23/RemoetService?WSDL";
    static {
    SSLAdapterFactory factory = SSLAdapterFactory.getDefaultFactory();
    WLSSLAdapter adapter = (WLSSLAdapter) factory.getSSLAdapter();
    adapter.setTrustedCertificatesFile("D:\\lib\\certs
    cacerts");
    factory.setDefaultAdapter(adapter);
    System.setProperty("weblogic.xml.encryption.verbose","true");
    System.setProperty("weblogic.xml.signature.verbose","true");
    System.setProperty("weblogic.webservice.verbose","true");
    public String sayHello(String user) {
    RemoteService_Impl service = new RemoteService_Impl(wsdl);
    RemotePortType port = service.getRemoteServicePort1();
    String namespace = service.getServiceName()
    .getNamespaceURI();
    QName portName = new QName(namespace,
    "RemoteServicePortType");
    HandlerRegistry reg = service.getHandlerRegistry();
    List handlerList = new ArrayList();
    Map map = new HashMap();
    map.put("Username", "user1");
    map.put("Password", "pwd1");
    HandlerInfo info = new HandlerInfo();
    info.setHandlerClass(WSClientHandler .class);
    info.setHandlerConfig(map);
    handlerList.add(info);
    reg.setHandlerChain(portName,(List)handlerList);
    RemoteServiceResponse = port.callMe(name);
    My Handler file:
    package com.test;
    import java.util.Map;
    import javax.xml.namespace.QName;
    import javax.xml.rpc.handler.Handler;
    import javax.xml.rpc.handler.HandlerInfo;
    import javax.xml.rpc.handler.MessageContext;
    import javax.xml.rpc.handler.soap.SOAPMessageContext;
    import javax.xml.soap.Name;
    import javax.xml.soap.SOAPElement;
    import javax.xml.soap.SOAPEnvelope;
    import javax.xml.soap.SOAPException;
    import javax.xml.soap.SOAPHeader;
    import javax.xml.soap.SOAPHeaderElement;
    public class WSClientHandler implements Handler {
    private HandlerInfo handlerInfo;
    public WSClientAuthenticateHandler(){}
    public void init(HandlerInfo hi) {
    System.out.println("Handler init");
    handlerInfo = hi;
    public void destroy() {
    System.out.println("Handler destroy method called");
    handlerInfo = null;
    public QName[] getHeaders() {
    System.out.println("Handler Header method called");
    try {
    Map map = handlerInfo.getHandlerConfig();
    QName[] headers = handlerInfo.getHeaders();
    System.out.println(" Config :"+map);
    for(int i=0;i<headers.length;i++) {
    System.out.println(headers.getLocalPart()+" "+
    headers.toString()+" "+headers.getNamespaceURI());
    }catch(Exception e) {
    e.printStackTrace();
    return handlerInfo.getHeaders();
    public boolean handleRequest(MessageContext mc) {
    SOAPMessageContext smc = (SOAPMessageContext) mc;
    System.out.println("Calling handler class.....................");
    try {
    SOAPEnvelope se = smc.getMessage().getSOAPPart().getEnvelope();
    System.out.println("Calling handler class.....................");
    SOAPHeader soapHeader = se.getHeader();
    Name headerName = se.createName("Security","wsse","http://schemas.xmlsoap.org/ws/2002/07/secext");
    SOAPHeaderElement headerElement = soapHeader.addHeaderElement(headerName);
    SOAPElement element = headerElement.addChildElement(se.createName("UsernameToken", "wsse", "http://schemas.xmlsoap.org/ws/2002/07/secext"));
    element.addChildElement(se.createName("Username", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testuser");
    element.addChildElement(se.createName("Password", "wsse","http://schemas.xmlsoap.org/ws/2002/07/secext")).addTextNode("testpwd");
    System.out.println("Calling handler class.....................");
    System.out.println("** Request: \n "se.toString()"\n");
    }catch(SOAPException e) {
    e.printStackTrace();
    return true;
    /** * Specifies that the SOAP response message be logged to a
    * log file before the
    * * message is sent back to the client application
    * that invoked the Web service.
    public boolean handleResponse(MessageContext mc) {
    System.out.println("Handler Response method called");
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Response: \n"messageContext.getMessage().toString()"\n");
    return true;
    /** * Specifies that a message be logged to the log file if a SOAP fault is
    * * thrown by the Handler instance.
    public boolean handleFault(MessageContext mc) {
    SOAPMessageContext messageContext = (SOAPMessageContext) mc;
    System.out.println("** Fault: \n"messageContext.getMessage().toString()"\n");
    return true;
    Please need help here.
    Thanks in Advance,
    pps

    I have tested static client calling using handler simple above service and found the issues.
    QName portName = new QName(namespace,
    "*RemoteServicePortType*");
    The above line code has created the issues,becuase in wsdl file ( given similar wsdl file).
    <?xml version="1.0"; encoding="UTF-8"?>
    <definitions name="HelloService"
    targetNamespace="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:tns="http://www.ecerami.com/wsdl/HelloService.wsdl"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <message name="SayHelloRequest">
    <part name="firstName" type="xsd:string"/>
    </message>
    <message name="SayHelloResponse">
    <part name="greeting" type="xsd:string"/>
    </message>
    *<portType name="RemoteServicePortType">*
    <operation name="sayHello">
    <input message="tns:SayHelloRequest"/>
    <output message="tns:SayHelloResponse"/>
    </operation>
    </portType>
    <binding name="Hello_Binding" type="tns:*RemoteServicePortType*">
    <soap:binding style="rpc"
    transport="http://schemas.xmlsoap.org/soap/http"/>
    <operation name="sayHello">
    <soap:operation soapAction="sayHello"/>
    <input>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </input>
    <output>
    <soap:body
    encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
    namespace="urn:examples:helloservice"
    use="encoded"/>
    </output>
    </operation>
    </binding>
    <service name="Hello_Service">
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType1*">
    <soap:address
    location="http://host1:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType2*">
    <soap:address
    location="http://host2:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType3*">
    <soap:address
    location="http://host3:8080/soap/servlet/rpcrouter"/>
    </port>
    <port binding="tns:Hello_Binding" name="*RemoteServicePortType4*">
    <soap:address
    location="http://host4:8080/soap/servlet/rpcrouter"/>
    </port>
    </service>
    </definitions>
    From the above WSDL, I have four port name (port binding="tns:Hello_Binding" name="*RemoteServicePortType1*) which is not matching with PortType (portType name="*RemoteServicePortType*")
    even i have iterated from getPorts() method and used to invoke the service.But handler was not calling when i invoke.
    Please guide me here how i specify correct portname which can call Handler class also.
    Thanks in advance,
    pps

  • I am recieving calls from a solicitor. Show up as no caller Id. I want to block all calls that do not show caller Id. Can I do that? I am on the do not call list

    How do I block all in coming calls that do not show on my caller Id. Phone says "no caller id" This particular call is from a place selling septic tank cleaner. They leave an automated voice mail. They are calling me over and over. I am on the national do not call list but that's no help. Because the caller id doesn't show anything I can't even report them.
    I remember in the past calling a number and before my call would go thru I would have to enter my phone number so the party I was calling knew who was calling them. That is what I want to do. I want to block all calls from "no caller id" "number unavailable" Just FYI my phone is an IPHONE 5 and I am on Verizon.
    Any help would be appreciated.
    Thanks

        itbitybob, good day!
    Thank you for taking the time to reach out to us today. I know how frustrating it can be getting phone calls from "no caller id" numbers. We do have an option that is called Family Base that will allow you to block unknown numbers, private numbers, or caller id. This link will provide you with the full details of this option. http://vz.to/1gIklla I hope this is able to answer your question. If you have further questions please feel free to reach back out to us at any time.
    KevinR_VZW
    Please follow us on Twitter @VZWSupport 

  • Intercompany stock transfer but BUV not calling

    HI expert,
    we are doing cross company stock transfer. we have made sto, delivery, post goods issue, and goods reciept in receving site.
    but problem is that during PGI, inter company clear accounting entries is not calling. ie transaction  key 'BUV' is not caaling during PGI.
    how we can call automatic intercompany clearing during PGI.
    Regards,
    Santosh

    solved.
    it will call when you will use document type UB for interconmany.

  • When I press on a land line number, the phone does not call the number, but comes up with a screen to send a text to it.  How do I get my phone to default to phoneing a landline?

    When I press on a land line number, the phone does not call the number, but comes up with a screen to send a text to it.  How do I get my phone to default to phoneing a landline?  When I press a mobile number in contacts, the phone automatically phones the number.  I do not mind this as I hardly ever send texts, but I would like to have the option of what to do.  This seems such an obvious issue but I can not solve it even with much web searching.  Thanks!

    I can't delete my question, so I'll just say that you press on the type of number written in the box to the left of the box you typye the number into.  Dumb or what? 

Maybe you are looking for

  • Net Value of Entry Sheet Calculation

    HI, Please guide on how can sap system calculates the net value of entry sheet. E.g : My services PO has discount 1. At the services PO under conditions, I just put the gross amt  after the discounted amount = 2,907,448.28 with qty = 1 AU 2. At the s

  • Copy and Paste of Images NOT working.

    When I right click on an image and choose 'copy image' and then try to paste it into my editing software, all i get is a string of text that is the location of the image as if I had chosen 'copy image location' instead. what gives?

  • Input taxes for zambia, southafrica

    Hi Consultants, Does anybody know how to configure the input taxes flike customs,excise & vat or zambia country, south africa. If any has some document kindly requesting you to forward me. with regards GNK

  • Systemd very nasty with incorrect setup

    There was an error in my fstab. An entry for a partition that was not there anymore. But this partition wasn't essential. But instead of giving me a warning, it began by waiting for 90s until ask me "Give root password for maintenance or Press Crtl-D

  • BSEG to VBRP AND VBRK

    Hello, I need to link sales orders in VBRP and VBRK to their respective GL line entries in BSEG.  Dos anyone have a SQL query that accomplishes this?  I'm not sure what the relationships are between BSEG and these sales tables. Any help would be grea