Coherence Web Service cache

Hi all,
I want to cache an web service with coherence and I have no idea where to start, here is my problem :
    I have a database, an web service that queries and modifies the data and an OSB that uses this service and also makes some transformations.
    I want to cache the OSB result, how do I do that ? I suppose the only thing I will have will be the WSDL for the service ... do I have to generate my classes with jax-ws ? any links will be helpful.
Thank you,
Marius

Your outline is correct.
The simplest thing to do in the web service machines is to create storage disabled Coherence nodes and use the NamedCache API to put data into the cache. The storage disabled node participates in the cluster but does not hold any data so its JVM shouldn't run out of memory. These are configured just like every other node except storage is disabled. A storage disabled node is effectively a client.
If you want a true client, you can use Extend (http://coherence.oracle.com/display/COH35UG/Coherence+Extend).
In step 5, you can execute business logic in Coherence using entry processors. The advantage is that the processing will run on the machine with the data so the work is distributed. The work can be triggered by events as you pointed out.
The number of JVMs running Coherence depends on the memory and number of cores available for each physical machine. As a rule of thumb, you can use 1 JVM per 2 cores for best latency. In your case, the main determinant will be the amount of processing of the messages you want to do in a Coherence node. If you're just storing and extracting cache data, you can probably have a JVM per core.
Regards,
David

Similar Messages

  • How can i use oracle coherence with JPA/ejb  in web service?

    Hi
    I want to make web service using JPA which calls oracle XE via oracle coherence? i want to use JAX-ws? i searched and found you can make and deployed it using web logic but is there any other way i can make it and deployed in tomcat. i want to use oracle coherence + Oracle XE + JAX-WS? if it possible how can i other wise what are other ways i can do it?
    please any one does know it reply please it helps me lot to get.
    Thanks in advance,
    Edited by: 913837 on Feb 22, 2012 3:51 PM

    If you want data cached in Coherence to find it's way into an Oracle database for persistence, then look at the "CacheStore" section of the Coherence Developer Guide. This also works the other way round too, in that you can get data read into a Coherence cache via a database read. Again, look in the Coherence Developer Guide.
    If you want you applications "entry point" into a piece of code to be a web-service, then Tomcat+CXF will work just fine. Once you are in the service, just use the Coherence API to put the data in a cache.
    But also look at the HTTP access offered in later versions of Coherence in the form of REST. This may save you the Tomcat+CXF install, depending upon your needs. See the Coherence Client Guide.
    Still, what exactly are you trying to achieve here? It's not clear from your post why a web service using JPA for persistence needs to go via Coherence at all. More info needed.
    Cheers,
    Steve

  • How to save web service request key and response value in cache to reduce calling the service for same type of requests

    Hi
    I have a web service which return the response based on the request key.
    I need to save the key and the response value in cache for around 30mins
     to reduce the web service calls for better performance.
    Appreciate if any once can share a sample code

    using System.Runtime.Caching;
    public List<string> cachingwebserviceresponse()
    {//Create a cache key
    string strParameters = "1234";//Create a cache value holding object
    List<string> results = new List<string>();//Create a cache
    ObjectCache cache = MemoryCache.Default;//Assign key for the cache
    string cacheKey = strParameters;//Check whether the key exists in the cache//If exists assign the values from the cache instead of calling the webservice//else call the web service and add the response to the cache
    if (cache.Contains(cacheKey))
    results = cache.Get(cacheKey);
    else
    { //calling the web service client
    using (service.webservice fd = new service.webserviceContractClient())
    { //Call the web service function to get the results
    results = fd.DataSearch(strParameters);
    } //Create the cache expiration policy. I have created for 30 minutes.
    CacheItemPolicy cacheItemPolicy = new CacheItemPolicy();
    cacheItemPolicy.AbsoluteExpiration = DateTime.Now.AddMinutes(30); //Add the response to the cache based on the key
    cache.Add(cacheKey, results, cacheItemPolicy);
    return results;

  • Caching the web service data in Flex 3.0

    Hi,
    I want to do the following task
    I am loading about 10000 records from MS SQL database into
    Flex data grid using web service on CreatinComplete event of an
    application in Flex 3.0.Now if I have done this and I press Browser
    refresh button, this time it should not call web service againg but
    it shold display the same data from the cache.
    Is there any way to achive this.
    If not can any one tell me how to handle huge data in flex
    using MS SQL and .NET

    Question is what technology of J2EE u are using!
    If it is EJB, then the fastest way would be to generate one more webservice and connect this one to WD.
    This way you also can check if the webservice delivers any data with the testing environment.
    Regards,
    Benny

  • Invalidate Adaptive Web Service Meta Data Cache?

    As the subject says - how can I invalidate the Adaptive Web Service meta data cache?  Currently, the only way we can invalidate the cache is to restart the app server, which takes quite a while.
    I've tried restarting the Web Dynpro Runtime service, but this didn't do anything.
    We're running nw70.

    Hi,
    Please consider the following:
    For JCO Models running on NW 7.2 you go to:
    1) NWA
    2) Availability and Performance Management --> Resource Monitoring
    3) JCO Monitoring
    4) Metadata Cache
    5) Click on clear of the desired cache region.
    For WebServices Cache, please follow the instructions as per notes below:
    Note 1088382 - WSIL results are cached after search
    Note 1123574 - Caching functionality of the Web service connector
    Cheers,
    Ivan

  • Cache data in Web Services

    Hi!
    I need to create a Web Service that can cache data in between multiple Web Service calls. If I'm not misstaken then stateful sessions keep data but still separate clients from each other. I need all clients to be able to access the same synchronized cached data. The data should be kept in memory for as long as the server is running. What kind of java technology should I use for that? Is it even possible to create? Using a database is not an option in this case.
    Thanks...

    Hello. I would strongly recommend looking at Apache's Java Caching System that is tailored for web applications. It's caching model is based on JSR 208 (Java Caching) and is probably the best solution out there. We have a similar requirement in our web service application that JCS helped accomplish.
    JCS allows both in-memory as well as caching to disk. The latter would require the data to implement java.io.Serializable or Externalizable interface.
    http://jakarta.apache.org/jcs/
    Hope this helps!

  • Web service model cache

    Hi all,
    I am using adaptive web service model in CE7.2 Server.
    every time i made some change to the web service, it is not well recognized,
    for example, i add one more field in the input request. i reimported the model, compile and deploy.
    the server just can not recognize that field, it always says that model don't have that property.
    so every time, I have to restart server to clear the cache and make the new model valid.
    is there any other means to clear the cache? restart server is annoying and taking time.
    thanks
    John

    Hi,
    Please consider the following:
    For JCO Models running on NW 7.2 you go to:
    1) NWA
    2) Availability and Performance Management --> Resource Monitoring
    3) JCO Monitoring
    4) Metadata Cache
    5) Click on clear of the desired cache region.
    For WebServices Cache, please follow the instructions as per notes below:
    Note 1088382 - WSIL results are cached after search
    Note 1123574 - Caching functionality of the Web service connector
    Cheers,
    Ivan
    Edited by: Ivan Mirisola on Nov 25, 2010 4:35 PM

  • Problem regenerating Web Service - PI Cache not been refreshed issue?

    Hi guys.
    I'm pretty new to PI, so I don't really know if this issue has been discussed before. I tried a search but it couldn't solve my problem.
    I'll described my scenario as best I can. I've created a WebService in PI via an RFC, everything was running fine, until we had to modify some field's length in our ABAP structure. We've regenerated everything, deleted the old Web Service and created a new one with a new WSDL, but when running it, we get the data mixed up in our internal table, it looks like something of the previous Web Service is still in cache. We tried refreshing it through SXI_CACHE but still nothing, so we're running out of clues. The only thing we're sure about is that is something related to the PI caches, but we don't know what.
    Hope you can help.
    Best Regards

    Hello,
    I never worked with WebServices in PI but I faced similar issue using ABAP Proxies.
    When you generate an ABAP Proxy and change the structure (e.g. an IDOC), you need to delete the proxy and create a new one but using a diferent name of implementation class.
    In other words if you create a new proxy but using the same name it seems the change has no effect.
    Maybe you can try this way. Change your webservice defintion, name, etc...
    Regards,
    Diego Estanguini Gabriel

  • BAM data cache web service - single thread?

    Hi all,
    I have 2 load-balanced BPEL servers trying to push data to the same BAM server via the BPEL-to-BAM web service interface. In the logs, on one of the BPEL servers, I get this following error quite frequently:
    <WARN> <default.collaxa.cube.sensor> BAM exception: java.io.IOException message: Authentication Failed for Basic realm="diaaihbamtst01.dia.dnvr" BAM domain: DIAAIHBAMTST01 BAM user: BAM BAM basic auth: DIAAIHBAMTST01/BAM BAM URL: http://DIAAIHBAMTST01.dia.dnvr:80/OracleBAM/Services/DataObject/DataObjectOperations.asmx
    I suspect that the BAM web service is busy dealing with data from the other server - which results in it throwing this error/warning. If I stop the other server, I see this message in the log for the machine that was getting the above messages:
    BAM endpoint http://DIAAIHBAMTST01.dia.dnvr:80/OracleBAM is back online
    - and then I don't get any more errors.
    Does anyone know if there's a setting that would allow 2 incoming web service ADC calls to occur simultaneously from 2 separate BPEL servers?
    Thanks,
    Lon

    We are using 10.1.3.3 and we did update patch MLR-15 for some other cause with 11i. We are experiencing same issue in our production. Please let us know, if you have any good input. I really appreciate your help.
    Rama K

  • Caching WSDL, generating strongly typed web service classes

    Hi All,
    I come from an ASP.NET background. Visual Studio provides a
    great tool for generating proxy classes based on a WSDL XML
    document. What's so great about this is that you are able to have
    strongly type classes (with intellisense in the IDE), compile time
    type checking, and so forth.
    What this means is that if I have a web service that defines
    the method getColors, and takes two parameters; let's say an
    enumerated type, "primary" or "secondary" for the first parameter,
    and "hex" or "english" for the second parameter (also an enumerated
    type), Visual Studio will generate a proxy class for me that will
    give me type hinting. I'll see that the "getColors" method takes
    two parameters, and it will even show the the possible values for
    the enumerated type.
    Is there anything like this in Flex?
    -Josh

    Hi Josh,
    Flex Builder 3 includes the "Import Web Service (WSDL)"
    wizard which is a tool that will generate proxy classes from a WSDL
    file. This tool is included in the latest engineering drop, but is
    not available in the latest beta build. You can access it via
    File>Import>Flex>Import Web Service (WSDL) or by accessing
    the Data>Import Web Service (WSDL)... menu option.
    Plus, using the web services manager tool (accessible via
    Data>Manage Web Services...) you can generate proxy classes for
    more than one WSDL file by adding more WSDLs to your project,
    remove the generated classes by deleting the WSDL from your project
    or regenerate the proxy classes by using the Update option.
    Using the proxy classes you benefit from code hinting of
    operations the web service exposes, code hinting on the operation
    parameters and their types, you get strongly typed results and
    more.
    Give these tools a try. We will appreciate any feedback
    you'll provide.

  • Coherence*Web on GlassFish Server Issues

    Hi!
    We are using Coherence 3.7.1.8 in our application in GlassFish 3.1.2 both as application cache and for storing session data (Coherence*Web) so it can be shared between multiple EARs and App server instances. Session data sharing between EARs in the same container works fine, but when we try to share session data between application server instances the server stops responding and has to be restarted. The only thing we get on the log is this exception:
    #|SEVERE|oracle-glassfish3.1.2|com.tangosol.coherence.servlet.ParallelReapTask|_ThreadID=169;_ThreadName=Thread-2;|An exception was thrown while reaping a session.
    com.tangosol.coherence.servlet.commonj.WorkException: Work Failed.
      at com.tangosol.coherence.servlet.commonj.impl.WorkItemImpl.run(WorkItemImpl.java:167)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.ClassCastException: com.tangosol.coherence.servlet.SplittableHolder cannot be cast to com.tangosol.coherence.servlet.AttributeHolder
      at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readAttributes(AbstractHttpSessionModel.java:1815)
      at com.tangosol.coherence.servlet.AbstractHttpSessionModel.readExternal(AbstractHttpSessionModel.java:1735)
      at com.tangosol.util.ExternalizableHelper.readExternalizableLite(ExternalizableHelper.java:2042)
      at com.tangosol.util.ExternalizableHelper.readObjectInternal(ExternalizableHelper.java:2346)
      at com.tangosol.util.ExternalizableHelper.deserializeInternal(ExternalizableHelper.java:2747)
      at com.tangosol.util.ExternalizableHelper.fromBinary(ExternalizableHelper.java:263)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ConverterFromBinary.convert(PartitionedCache.CDB:4)
      at com.tangosol.util.ConverterCollections$ConverterMap.get(ConverterCollections.java:1656)
      at com.tangosol.coherence.component.util.daemon.queueProcessor.service.grid.partitionedService.PartitionedCache$ViewMap.get(PartitionedCache.CDB:1)
      at com.tangosol.coherence.component.util.SafeNamedCache.get(SafeNamedCache.CDB:1)
      at com.tangosol.net.cache.CachingMap.get(CachingMap.java:491)
      at com.tangosol.coherence.servlet.DefaultCacheDelegator.getModel(DefaultCacheDelegator.java:122)
      at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.getModel(AbstractHttpSessionCollection.java:2288)
      at com.tangosol.coherence.servlet.AbstractReapTask.checkAndInvalidate(AbstractReapTask.java:140)
      at com.tangosol.coherence.servlet.ParallelReapTask$ReapWork.run(ParallelReapTask.java:89)
      at com.tangosol.coherence.servlet.commonj.impl.WorkItemImpl.run(WorkItemImpl.java:164)
      ... 3 more
    We tried to restrict the shared session data by implementing a custom SessionDistributionController, but according to the documentation, this feature requires coherence-sticky-sessions optimization to be enabled and this last one requires coherence-session-member-locking to be enabled. This led us to the following error:
    #|SEVERE|oracle-glassfish3.1.2|org.apache.catalina.connector.CoyoteAdapter|_ThreadID=202;_ThreadName=Thread-2;|PWC3989: An exception or error occurred in the container during the request processing
    java.lang.IllegalStateException: attempt to exit session VhSnfqkcwAza when it was not owned
        at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.exit(AbstractHttpSessionCollection.java:799)
        at com.tangosol.coherence.servlet.AbstractHttpSessionCollection.exit(AbstractHttpSessionCollection.java:696)
        at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSessionManager.exit(CoherenceWebSessionManager.java:536)
        at com.tangosol.coherence.servlet.glassfish31.CoherenceWebSession.unlockForeground(CoherenceWebSession.java:451)
        at org.apache.catalina.connector.Request.unlockSession(Request.java:4222)
        at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:342)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:231)
        at com.sun.enterprise.v3.services.impl.ContainerMapper$AdapterCallable.call(ContainerMapper.java:317)
        at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:195)
        at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:860)
        at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:757)
        at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1056)
        at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:229)
        at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
        at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
        at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
        at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
        at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
        at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
        at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
        at java.lang.Thread.run(Thread.java:722)
    We want to know if we are missing something in our configuration. We are using com.tangosol.coherence.servlet.AbstractHttpSessionCollection$GlobalScopeController. The session-cache-config.xml file has only this item added:
            <replicated-scheme>
                <scheme-name>default-replicated</scheme-name>
                <service-name>ReplicatedCache</service-name>
                <backing-map-scheme>
                    <class-scheme>
                        <scheme-ref>default-backing-map</scheme-ref>
                    </class-scheme>
                </backing-map-scheme>
            </replicated-scheme>
            <class-scheme>
                <scheme-name>default-backing-map</scheme-name>
                <class-name>com.tangosol.util.SafeHashMap</class-name>
            </class-scheme>
    Any help or light would be greatly appreciated. Thanks in advance.

    Depending on the version of WebLogic (which unfortunately I cannot remember off of the top of my head), you don't have to use the installer, because WebLogic has added built-in Coherence*Web support. Have you checked the WebLogic documentation for using Coherence*Web?
    Peace,
    Cameron Purdy | Oracle Coherence
    http://coherence.oracle.com/

  • Web-service call from Apache to Glassfish

    I have written static HTML pages which run on Apache server and I give a web-service call which is present on Glassfish server.
    I want to calculate the number of rows present in the selected Excel file. For this, I make a web-service call through Ajax; where I send a file object to it, which then, reads the file and returns the number of rows present in that file.
    But, I could not make an Ajax POST for a file object.
    For Example, I have an HTML form containing a file object (for which I have to calculate the number of rows). I have to send this form to the web-service for processing the file.
    My form is like this:
    <form id="myForm" action="http://www.mydomain.com:8080/myApp/jersey/myClass/calculateRows" method="POST" enctype="multipart/form-data" accept-charset="utf-8" name="submitForm">
            input id ="workbook" name="workbook" type="hidden"/>
    </form>
    For this I used:
        $("#myForm").ajaxSubmit(function(noOfRows)
           alert(noOfRows);
    In the web-service, I gave:
        @Path('myClass')
        public class myClass
          @POST
          @Path("calculateRows")
          public Response calculateNoOfRows(@Context HttpServletRequest request)
            int noOfRows = 0;
            String wbk = request.getParameter("workbook");
            for (Part part : request.getParts())
                 if (!part.getName().equalsIgnoreCase("workbook"))
                      //code to calculate number of rows
                      noOfRows = 100;   (for example)
            ResponseBuilder builder = null;
            builder = Response.ok(String.valueOf(noOfRows));
            builder.header("Access-Control-Allow-Origin", "*");
            builder.header("Access-Control-Allow-Methods","POST");
            builder.header("Allow-Control-Allow-Headers", "Origin,Connection,Keep-Alive,Accept-Encoding,Accept-Charset,Accept,User-Agent,Host,X-Requested-With");
            return builder.build();
    In the Firebug, the above given URL does not appear in the Console tab.
    And, in the Net tab, I see like this:
        OPTIONS http://www.mydomain.com:8080/myApp/jersey/myClass/calculateRows
    I am not able to resolve the problem. Can anyone help?

    Hi,
    I would recommend implementing the web-service callout logic in a custom cachestore/cacheloader (see the CacheLoader.load() method) and configure your rwbm with your cachestore implementation.
    While subclassing RWBM and overriding functionality can be done, the CacheLoader interface is the intended method designed to accomplish this kind of task. RWBM internal implementations may perform other internal bookkeeping and may vary over time.
    See also:
    http://download.oracle.com/otn_hosted_doc/coherence/351/com/tangosol/net/cache/CacheLoader.html
    http://wiki.tangosol.com/display/COH35UG/cachestore-scheme
    http://wiki.tangosol.com/display/COH35UG/Sample+CacheStores
    thanks,
    -Rob

  • Web service call from a ReadWriteBackingMap

    We are thinking of making a web service call from a ReadWriteBackingMap
    <cachestore-scheme>
    <class-scheme>
    <class-name>
    We will extend ReadWriteBackingMap class and override load() method to make a call to a web service.
    This cache will be read only data and will hold relatively static data like list of c
    ountries.
    We expect to use Spring framework/JDK 1.5/WS security to make this web service call. We hope to
    have the jar/config files available in server classpath when we start coherence servers.
    1. Do you see any issues with this approach?
    2. Any best practices?
    3. Server resources(memory etc) will be shared between the server java process and this call to
    web services, getting the xml, parsing the data etc. Any issues with that?

    Hi,
    I would recommend implementing the web-service callout logic in a custom cachestore/cacheloader (see the CacheLoader.load() method) and configure your rwbm with your cachestore implementation.
    While subclassing RWBM and overriding functionality can be done, the CacheLoader interface is the intended method designed to accomplish this kind of task. RWBM internal implementations may perform other internal bookkeeping and may vary over time.
    See also:
    http://download.oracle.com/otn_hosted_doc/coherence/351/com/tangosol/net/cache/CacheLoader.html
    http://wiki.tangosol.com/display/COH35UG/cachestore-scheme
    http://wiki.tangosol.com/display/COH35UG/Sample+CacheStores
    thanks,
    -Rob

  • Oracle Coherence*Web and BlazeDS: Multiple FlexSessions created for the same HttpSession

    Hi all,
    I have searched this forum and found a lot of good information from Alex Glosband and others about the infamous "Detected duplicate HTTP - based FlexSessions, generally due to the remote host disabling session cookies. Session coolkies must be enable to manage the client connection correctly." message.
    It seems, however, none of the cases are identical to ours. This is ours:
    - Resin 3.1.9
    - Oracle Coherence 3.7.1 with Coherence*Web (session replication)
    With this setup we get the "Detected duplicate HTTP..." message on the first attempt to use BlazeDS and on every subsequent call.  The same client and server code works fine in a local sessions setup.  With Coherence 3.3 (currently our production environment) it seems to occur less frequently, but still as frequent as it is a major issue for us.  It fails even with a single node using in-process distributed caching in our test setup (as well as with multi node out of process caching in our staging environment, for Coherence knowledgeable the resin app server runs with tangosol.coherence.session.localstorage=true in the first case and false in the second).
    Both the listener and message broker are mapped as "Coherence aware" in web.xml[1] so that they should use clustered sessions.
    We have been digging a bit and we found out that if we commented out lines 427 and 434 of flex.messaging.endpoints.BaseHTTPEndpoint from version 4.0.0.14931 it seems to mask the bug.  We added some logging in the setupFlexClient method and it seems that we get more or less a new FlexSession for each and every call - but they have the same cookie and thus underlying HttpSession. I.e. the list returned from flexClient.getFlexSessions() keeps growing. Thus we are not so keen on going to production with that memory leak and the above mentioned ugly hack of commenting out the detection of duplicates.
    We use request scope for the remote object, but could in theory use any scope as we do not really have any state on the object itself, it is all HttpSession state and return values that are key (logon is performed prior to doing the first blaze call, in pure forms and ajax, and it is not a timing issue in that regard we are seeing).
    Hope someone can shed some light on what can be happening. Is there any "reference testing"[2] or something when the FlexSessions are created that makes them being created as new? Where are they created?  We do not know the inner workings of the BlazeDS source, we just watched the call trace of the unwanted invalidation and found that to be line 427 of flex.messaging.endpoints.BaseHTTPEndpoint.
    Can we disable FlexSessions?  Since the flex and plain html parts of the app share the sessions, we always use FlexContext.getHttpRequest().getSession() anyway, never storing any state directly in the FlexSession or on the remote object. Or maybe there is a config option to help us with this detection (or creation) of multiple FlexSessions?
    Cheers and TIA,
    -S-
    [1] - For instance, this i the message broker servlet def:
    <servlet>
    <servlet-name>MessageBrokerServlet</servlet-name>
      <display-name>MessageBrokerServlet</display-name>
    <servlet-class>com.tangosol.coherence.servlet.api22.ServletWrapper</servlet-class>       
    <init-param>
    <param-name>coherence-servlet-class</param-name>
    <param-value>flex.messaging.MessageBrokerServlet</param-value>
    </init-param>       
    <init-param>
    <param-name>services.configuration.file</param-name>
    <param-value>/WEB-INF/flex/services-config.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
    </servlet>
    [2] - As you undertstand this is speculation based on pure air, but it could be that in Coherence there was a serialization/deserialization happening somehow that would break such a test?

    Just a quick update, it seems things are running in a stable fashion (and without visible memory leaks, just keeping the latest FlexSession) with these changes in BaseHTTPEndpoint:
         * Overrides to guard against duplicate HTTP-based sessions for the same FlexClient which will occur if the remote host has disabled session
         * cookies.
         * @see AbstractEndpoint#setupFlexClient(String)
        @Override
        public FlexClient setupFlexClient(String id) {
            log.debug("setupFlexClient start id " + id);
            FlexClient flexClient = super.setupFlexClient(id);
            // Scan for duplicate HTTP-sessions and if found, invalidate them and throw a MessageException.
            // A request attribute is used to deal with batched AMF messages that arrive in a single request by trigger multiple passes through this
            // method.
            boolean duplicateSessionDetected = (FlexContext.getHttpRequest().getAttribute(REQUEST_ATTR_DUPLICATE_SESSION_FLAG) != null);
            if (!duplicateSessionDetected) {
                List<FlexSession> sessions = flexClient.getFlexSessions();
                log.debug("Client has " + sessions.size() + " sessions.");
                int n = sessions.size();
                if (n > 1) {
                    int count = 0;
                    for (int i = 0; i < n; i++) {
                        if (sessions.get(i) instanceof HttpFlexSession)
                            count++;
                        if (count > 1) {
                            FlexContext.getHttpRequest().setAttribute(REQUEST_ATTR_DUPLICATE_SESSION_FLAG, Boolean.TRUE);
                            duplicateSessionDetected = true;
                            break;
            // If more than one was found, remote host isn't using session cookies. Kill all duplicate sessions and return an error.
            // Simplest to just re-scan the list given that it will be very short, but use an iterator for concurrent modification.
            int i = 0;
            if (duplicateSessionDetected) {
                List<FlexSession> sessions = flexClient.getFlexSessions();
                log.debug("Detected sessions from client: " + sessions);
                for (FlexSession session : sessions) {
                    if (session instanceof HttpFlexSession && i < sessions.size()) {
    //                    log.debug("----> sessionId: " + session.getId());
    //                    Enumeration e1 = session.getAttributeNames();
    //                    while (e1.hasMoreElements()) {
    //                        Object key = e1.nextElement();
    //                        log.debug("--------->" + key + "--------->" + session.getAttribute((String) key));
    //                    session.invalidate();
                        flexClient.sessionDestroyed(session);
                    i++;
                // Return an error to the client.
    //            DuplicateSessionException e = new DuplicateSessionException();
    //            e.setMessage(ERR_MSG_DUPLICATE_SESSIONS_DETECTED);
    //            throw e;
            return flexClient;
    It is not exactly beautiful (to say the least), but if it does the trick I might just be pragmatic enough to go with it... NB: I am of course not proposing this as a patch to this file or anything, it is just an ugly hack for our specific case, but maybe the information can help the BlazeDS team find the root cause making it incompatible with Coherence*Web.
    Will give it a test run on our staging servers.

  • How to send JSON data in HTTPService to PHP web service question

    I'm using Flex 4 and a mx:HTTPService to send a JSON request to a php web service. I'm not sure if I'm sending the request correctly. Could someone look at the code below to see what I'm doing wrong?
    thanks
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:mx="library://ns.adobe.com/flex/mx"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   width="100%" height="100%">
        <fx:Declarations>
            <mx:HTTPService id="service" url="https://my web service url/"
                            method="POST" resultFormat="text" result="onResult(event)" fault="onFault(event)">
            </mx:HTTPService>
        </fx:Declarations>
        <fx:Script>
            <![CDATA[
                import com.adobe.serialization.json.JSON;
                import mx.collections.ArrayCollection;
                import mx.rpc.events.FaultEvent;
                import mx.rpc.events.ResultEvent;
                import mx.utils.Base64Encoder;
                [Bindable]private var username:String = "[email protected]";
                [Bindable]private var password:String = "the password";
                [Bindable]private var accountNumber:String = "49055";
                [Bindable]private var anticipatedDeliveryDate:Number = 20101115;
                [Bindable]private var purchaseOrder:String = "#123 for retailer";
                [Bindable]private var detailRecords:Array = new Array();
                [Bindable]private var key:String = "abc123";
                private function populateService():void {
                    populateProducts();   
                    setRequestHeader();
                    setRequestData();
                    service.send();   
                private function setRequestHeader():void {
                    var encoder:Base64Encoder = new Base64Encoder();
                    encoder.insertNewLines = false;
                    encoder.encode(key);               
                    service.headers["Authorization"] = "VIP " + key;
                    service.headers["Content-Type"] = "application/json";
                private function setRequestData():void {
                    service.request.username = username;
                    service.request.password = password;
                    service.request.accountNumber = accountNumber;
                    service.request.anticipatedDeliveryDate = anticipatedDeliveryDate;
                    service.request.purchaseOrder = purchaseOrder;
                    service.request.detailRecords = detailRecords;
                    // caching test
                    var rnd : Number = Math.round(Math.random()*1000);
                    service.request.cacheOff = rnd;
                private function populateProducts():void {
                    var prod1:Object = new Object();
                    prod1.itemCodeOrUPC = "00241";
                    prod1.itemDescription = "Budweiser Keg 1/2 BBL";
                    prod1.quantityOrdered = 2;
                    prod1.orderUOM = "Keg";
                    var prod2:Object = new Object();
                    prod2.itemCodeOrUPC = "00219";
                    prod2.itemDescription = "Budweiser 24/12 OZ CAN";
                    prod2.quantityOrdered = 4;
                    prod2.orderUOM = "Case";
                    detailRecords.push(prod1);
                    detailRecords.push(prod2);
                private function onResult(event:ResultEvent):void
                    var json:Object = JSON.decode(event.result as String);
                private function onFault(event:FaultEvent):void
                    trace("Fault: " + event.fault.faultString);
            ]]>
        </fx:Script>
        <mx:Panel width="95%" height="100%" color="#000000">
            <mx:HBox width="100%">
                <mx:Button label="Submit" click="{populateService()}"/>
            </mx:HBox>   
        </mx:Panel>
    </s:Application>

    Have you think abut using ActionScript in your Flex application? Or, you can write javascript to be proxy between your flash app and backend PHP web service?
    Also, it seems that you will allow every customer's flash player to have a copy of secret code. I think it is dangerous design because an flv file can be easity decompiled. Therefore, you secret code can be found if it is not input by your end user and it is populated on your serverside script.

Maybe you are looking for

  • New wifi problem...IOS 4.2.1 on 2nd Gen Touch

    Hello All! I just started having a problem when my ipod is put into sleep mode. It used to always disconnect from my wifi router about 5 seconds after entering sleep. This is with 4.2.1 even. I liked that because I would not have any battery drain is

  • Problem transferring PDF from pc to itunes to ipod

    Hey guys! Good day! I have just encountered a problem in my newly installed itunes(11.0.1). I got lost, it was too far from the former version i have which is the itunes 10. I have some troubles in transferring pdf files in my ipod. The "Book" tab in

  • Plugs

    what plug do I need to buy if I want to connect my laptop to my TV to watch netflix and other shows?

  • Business completing a PM Order

    I am trying to business complete a PM order say X. The error message says"Order 1 is assigned to the order X". I can understand that order 1 is assigned to order X but when search for the order 1 I could not find it. There is no order with # 1. How t

  • How many other people would like to see a "GarageBand-esque" skin/gui???

    how many other people would like to see a "GarageBand-esque" skin/gui for logic express/pro??? i use all three apps a lot, and the main thing i really enjoy about GarageBand is the simple single window interface. i would like to see apple make the op