ColdFusion Remote Service Calls and Dates

Hi all, I'm hoping someone can help me out with my confusion.  I’m sending an object including datetime data from ColdFusion to a Flash application.  The datetime in the ColdFusion object include milliseconds, however, if I use the getTime() function on the Date object in the Flex application, the milliseconds have been zeroed out.  Is there any way to retain the milliseconds when the data is passed through the flexgateway?
Thanks,
Christine

Hi Balaji,
I have attached a demo of my proxy webservice called pxTest.cfc.  pxTest.cfc contains two functions, testDate and pushBackTestDate.  I also attached a simple Flex App called testDate.mxml.  And a Test file called test.cfm.
Save pxTest.cfc to your CFC folder.  Create a new project called TestDate.  Go to the data/services tab, click "Connect to Data/Service" and select Data Service ColdFusion.  Browse to PxTest.cfc and select it for the CFC location.  Click Next, then click Finish.  Configure ReturnType as Date for both pushBackTestDate and testDate.  Paste the code from TestDate.mxml into the blank TestDate.mxml file that was created when you created the project TestDate.  Run the TestDate.mxml application.
On load of the application a date was requested and received from pxTest.cfc.  Click Confirm Test Date and note the date returned, and the milliseconds value for that date.  Next click Push User Data back, this will call the method pushBackTestDate sending the date from the Flex app back into CF.  All pushBackTestDate does is set the value returned into session and return it back to the Flex app again.
Click the button Show Pushed Data Result to see the date that was returned.  In my tests this date no longer has a value for milliseconds.  As long as pxTest.cfc and test.cfm run in the same session you will be able to see the dates sent and returned by running test.cfm.  The dump of that session variable and time formatted versions of that variables are displayed below:
RETURNED
{ts '2009-09-17 12:57:50'}
SEND
{ts '2009-09-17 12:57:50'}
TimeFormat Send 12:57:50 13
TimeFormat Returned 12:57:50 0
Note the date sent contains milliseconds, the date returned does not have milliseconds.  Hopefully this demo will work for you and demonstrate the issue.  Please let me know if you need more information.
Thanks,
Christine

Similar Messages

  • Completely different AMF request packets for same remote service call from Flex to PHP using ZendAMF

    I was trying to debug why one of the remote-services in our Flex application was failing randomly. What I found was interesting. Completely different AMF request packets were sent for same remote service call from Flex to PHP.
    When the service call succeeds the AMF request packet looks like the following:
    POST /video/flex/bin-debug/gateway.php HTTP/1.1
    Host: localhost
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15
    Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    Accept-Language: en-us,en;q=0.5
    Accept-Encoding: gzip,deflate
    Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7
    Keep-Alive: 115
    Cookie: PHPSESSID=j6u30i8uu6c3cvp8f4kipcpf05
    Referer: http://localhost/video/flex/bin-debug/main.swf/[[DYNAMIC]]/5
    Content-type: application/x-amf
    C    ontent-length: 305
    Flex Message (flex.messaging.messages.RemotingMessage)     operation = getMemberFromEvent    clientId = 2F997CD0-7D08-8D09-1A9B-0000422676C8    destination = MembereventService    messageId = B46AB58D-2241-83F0-41E4-9FE745565492    timestamp = 0    timeToLive = 0    body =     [      280    ]    hdr(DSId) = nil
    And when the service fails the AMF request packet looks like this:
    ServiceRequest: getMemberFromEvent; RemoteService; getMemberFromEvent
    (mx.messaging.messages::RemotingMessage)#0
      body = (Array)#1
        [0] 250
      clientId = "1AA4FAAB-AEA5-8109-4B0D-000002B3A9A1"
      destination = "MembereventService"
      headers = (Object)#2
        DSEndpoint = (null)
        DSId = "nil"
      messageId = "2F92E6C0-FE92-A09B-B150-9FE2F28D9738"
      operation = "getMemberFromEvent"
      source = "MembereventService"
      timestamp = 0
      timeToLive = 0
    Also, following is the error message on Flex when the service fails:
    {Fault code=Channel.Call.Failed, Fault string=error, Fault detail=NetConnection.Call.Failed: HTTP: Failed, Destination=MembereventService}
    We are using Swiz as the micro-architecture for Flex development and Zend AMF for remoting between Flex and PHP.
    Any ideas what is wrong here, what is causing Flex to send different request packets for the same service & what I can do to fix it?

    Hi, I know that your post is almost 5 years ago, but have you found the solution to this issue?
    Thanks.

  • How to display success message after Remote service call

    Hi ,
    I am currently using Flex form for adding/updating user
    personal details.On submit button click ,i am submitting details to
    server by calling RPC remote service.For calling remote service i
    am using penneframework. On penneframework, Remote service call
    result are populated in RemoteResult object. It dont have any other
    event method for handling result event.For errror handling, i have
    defaultHandler for displaying error message.
    Here i am having two requirements
    1. I should be able to track RPC response, so that i can
    display success message to user along with DB generated ID.
    2. I need to reset all form field after receiving RPC
    response.
    Here my question is
    1.How i can track server response, so that i can display
    success or error message.
    2. Is their any event or coding technique which i can use for
    solving this issue.
    Thanks
    Kumar

    you can do following way :
    quote:
    var token:AsyncToken =
    YourRemoteClass.remoteMethod(param1,param2);
    token.addResponder(new AsyncResponder(
    function(data:Object, token:Object):void {
    // tadaaa response
    function(info:Object, token:Object):void {
    //ooooo , noo, failure
    token

  • Link between Service Call and Marketing documents not working

    Hello all,
    I found a field in Marketing Documents - Rows data - that should be the link between a Service Call and the Marketing Documents.
    The field is for example "INV1.isSrvCall" but, even if I create an Invoice from the Service Call, the field will be populated with the value "N".
    Dows anyone knows how to make this field work? Or any workarround to make the connection between a Service Call and the generated documents?
    Thanks in advance,
    Kind Regards

    The problem with SCL4  is that SAP updates it way too late in the process to be meaningful while in the module. You create a service order, then go into the expense document. That is when we need to know the service call id and the internalsn of the equipment being worked on Only when you get out of the service module do SAP post to SCL4.  
    The data (before writing to SCL$) exists as a veriable on the original service form.  But can we access it from the expense document?
    The question is how to access the data (service id) on the original service form from an expense document within the servide module. It is the service form, and that is currently not in focus, so I do not know if you can access it as a varaible, while in the expense document (sales order or invoice) that is in focus.
    Can any one help with this/
    David

  • IDispatchMessageInspector.AfterReceiveRequest - bypass service call and return manually response

    Hi,
    I am using a service behavior class that implements IDispatchMessageInspector.AfterReceiveRequest to handle Health Check Service request that require skipping the actual operation's code and instead manually crafting a response message from "BeforeSendReply".
    I want to skip any processing on the request and instead want to return manual response from "BeforeSendReply".
    It has been pointed out in various forum threads that setting ref request parameter to null will skip the normal message processing and transition directly to BeforeSendReply. I have tracing enabled on my service and observe that underneath it still tries to
    deserialize the message and throws an exception:
    NullReferenceException: Object reference not set to an instance of an object.
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.DeserializeInputs(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc)
    System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)
    any idea how can I skip the service call and instead return a manual response back?
       

    This is not correct (setting request to null to bypass the service), unfortunately WCF doesn't have any out-of-the-box way of doing that.
    You can, however, use a few more of the extensibility points in WCF to make this scenario work. You'll need at least an IDispatchMessageFormatter (to prevent the message from being read / deserialized since it's not necessary) and an IOperationInvoker (to
    actually bypass invoking the service method). You can use the operation context to pass information between those extensibility points.
    You can find more information about those three interfaces in my ongoing blog series about WCF extensibility points:
    IDispatchMessageInspector: http://blogs.msdn.com/b/carlosfigueira/archive/2011/04/19/wcf-extensibility-message-inspectors.aspx
    IDispatchMessageFormatter: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/03/wcf-extensibility-message-formatters.aspx
    IOperationInvoker: http://blogs.msdn.com/b/carlosfigueira/archive/2011/05/17/wcf-extensibility-ioperationinvoker.aspx
    The code which uses those extensions to skip the operation based on a decision made in the message inspector:
    public class Post_55ef7692_25dc_4ece_9dde_9981c417c94a
    [ServiceContract(Name = "ITest", Namespace = "http://tempuri.org/")]
    public interface ITest
    [OperationContract]
    string Echo(string text);
    public class Service : ITest
    public string Echo(string text)
    return text;
    static Binding GetBinding()
    BasicHttpBinding result = new BasicHttpBinding();
    return result;
    public class MyOperationBypasser : IEndpointBehavior, IOperationBehavior
    internal const string SkipServerMessageProperty = "SkipServer";
    public void AddBindingParameters(ServiceEndpoint endpoint, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(ServiceEndpoint endpoint, ClientRuntime clientRuntime)
    public void ApplyDispatchBehavior(ServiceEndpoint endpoint, EndpointDispatcher endpointDispatcher)
    endpointDispatcher.DispatchRuntime.MessageInspectors.Add(new MyInspector(endpoint));
    public void Validate(ServiceEndpoint endpoint)
    public void AddBindingParameters(OperationDescription operationDescription, BindingParameterCollection bindingParameters)
    public void ApplyClientBehavior(OperationDescription operationDescription, ClientOperation clientOperation)
    public void ApplyDispatchBehavior(OperationDescription operationDescription, DispatchOperation dispatchOperation)
    dispatchOperation.Formatter = new MyFormatter(dispatchOperation.Formatter);
    dispatchOperation.Invoker = new MyInvoker(dispatchOperation.Invoker);
    public void Validate(OperationDescription operationDescription)
    class MyInspector : IDispatchMessageInspector
    ServiceEndpoint endpoint;
    public MyInspector(ServiceEndpoint endpoint)
    this.endpoint = endpoint;
    public object AfterReceiveRequest(ref Message request, IClientChannel channel, InstanceContext instanceContext)
    Message result = null;
    HttpRequestMessageProperty reqProp = null;
    if (request.Properties.ContainsKey(HttpRequestMessageProperty.Name))
    reqProp = request.Properties[HttpRequestMessageProperty.Name] as HttpRequestMessageProperty;
    if (reqProp != null)
    string bypassServer = reqProp.Headers["X-BypassServer"];
    if (!string.IsNullOrEmpty(bypassServer))
    result = Message.CreateMessage(request.Version, this.FindReplyAction(request.Headers.Action), new OverrideBodyWriter(bypassServer));
    return result;
    public void BeforeSendReply(ref Message reply, object correlationState)
    Message newResult = correlationState as Message;
    if (newResult != null)
    reply = newResult;
    private string FindReplyAction(string requestAction)
    foreach (var operation in this.endpoint.Contract.Operations)
    if (operation.Messages[0].Action == requestAction)
    return operation.Messages[1].Action;
    return null;
    class OverrideBodyWriter : BodyWriter
    string bypassServerHeader;
    public OverrideBodyWriter(string bypassServerHeader)
    : base(true)
    this.bypassServerHeader = bypassServerHeader;
    protected override void OnWriteBodyContents(XmlDictionaryWriter writer)
    writer.WriteStartElement("EchoResponse", "http://tempuri.org/");
    writer.WriteStartElement("EchoResult");
    writer.WriteString(this.bypassServerHeader);
    writer.WriteEndElement();
    writer.WriteEndElement();
    class MyFormatter : IDispatchMessageFormatter
    IDispatchMessageFormatter originalFormatter;
    public MyFormatter(IDispatchMessageFormatter originalFormatter)
    this.originalFormatter = originalFormatter;
    public void DeserializeRequest(Message message, object[] parameters)
    if (message.Properties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    Message returnMessage = message.Properties[MyOperationBypasser.SkipServerMessageProperty] as Message;
    OperationContext.Current.IncomingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    OperationContext.Current.OutgoingMessageProperties.Add(MyOperationBypasser.SkipServerMessageProperty, returnMessage);
    else
    this.originalFormatter.DeserializeRequest(message, parameters);
    public Message SerializeReply(MessageVersion messageVersion, object[] parameters, object result)
    if (OperationContext.Current.OutgoingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    return null;
    else
    return this.originalFormatter.SerializeReply(messageVersion, parameters, result);
    class MyInvoker : IOperationInvoker
    IOperationInvoker originalInvoker;
    public MyInvoker(IOperationInvoker originalInvoker)
    if (!originalInvoker.IsSynchronous)
    throw new NotSupportedException("This implementation only supports synchronous invokers");
    this.originalInvoker = originalInvoker;
    public object[] AllocateInputs()
    return this.originalInvoker.AllocateInputs();
    public object Invoke(object instance, object[] inputs, out object[] outputs)
    if (OperationContext.Current.IncomingMessageProperties.ContainsKey(MyOperationBypasser.SkipServerMessageProperty))
    outputs = null;
    return null; // message is stored in the context
    else
    return this.originalInvoker.Invoke(instance, inputs, out outputs);
    public IAsyncResult InvokeBegin(object instance, object[] inputs, AsyncCallback callback, object state)
    throw new NotSupportedException();
    public object InvokeEnd(object instance, out object[] outputs, IAsyncResult result)
    throw new NotSupportedException();
    public bool IsSynchronous
    get { return true; }
    public static void Test()
    string baseAddress = "http://" + Environment.MachineName + ":8000/Service";
    ServiceHost host = new ServiceHost(typeof(Service), new Uri(baseAddress));
    ServiceEndpoint endpoint = host.AddServiceEndpoint(typeof(ITest), GetBinding(), "");
    endpoint.Behaviors.Add(new MyOperationBypasser());
    foreach (var operation in endpoint.Contract.Operations)
    operation.Behaviors.Add(new MyOperationBypasser());
    host.Open();
    Console.WriteLine("Host opened");
    ChannelFactory<ITest> factory = new ChannelFactory<ITest>(GetBinding(), new EndpointAddress(baseAddress));
    ITest proxy = factory.CreateChannel();
    Console.WriteLine(proxy.Echo("Hello"));
    Console.WriteLine("And now with the bypass header");
    using (new OperationContextScope((IContextChannel)proxy))
    HttpRequestMessageProperty httpRequestProp = new HttpRequestMessageProperty();
    httpRequestProp.Headers.Add("X-BypassServer", "This message will not reach the service operation");
    OperationContext.Current.OutgoingMessageProperties.Add(
    HttpRequestMessageProperty.Name,
    httpRequestProp);
    Console.WriteLine(proxy.Echo("Hello"));
    ((IClientChannel)proxy).Close();
    factory.Close();
    Console.Write("Press ENTER to close the host");
    Console.ReadLine();
    host.Close();

  • Service call creation date

    Hi Experts
                         In service call created date is disabled, my client requires to create a date in past days, is any way to change editable mode. We are using SAPB1 2005B.
    Regards
    D.Selva

    Hi Selvaraj
    Unfortunately not. This field will always use the current date/time stamp to indicate the creation date. You could backdate the system date, but I do not encourage this as it could have adverse effects on other transactions in the database.
    Instead, I would suggest adding a user defined field on the Service Call Title level for this.
    Kind regards
    Peter Juby

  • Join a service call and one serial number?

    In admin web tools
    Can  join a service call and one customer equipment card (serial number) ?

    The company sells machines for industry.
    Every machine and component has a serial number and u201Ccustomer equipment cardu201D in SBO.
    Usually, If the customer has a problem call to company.
    1.-  SBO user get the u201Ccall serveru201D
    2.- SBO user support join the u201Ccall serveru201D and  u201Ccustomer equipment cardu201D
    3.- SBO user go to call server  create a Delivery (works and equipment)
    Unfortunately the technical support, works in customer company and usually canu2019t entry to SBO in several days.
    We like use the u201Cweb toolsu201D, the technical support uses the web and can see the u201Ccall serveru201D, the Customer and marketing documents.
    But canu2019t assign a u201Ccustomer equipment cardu201D to  u201Ccall serveru201D and synchronize to SAP and create a Delivery by WEB
    Can you proposal a new work flow by web?
    Muchas gracias.

  • Difference Between Data Services Designer and Data Services Workbench

    Hello All,
    I am new to Data Services .
    What is the difference between Data Services Designer and Data Services Workbench .
    Am bit confused in the above two .
    Please help me to understand the same.
    Thanks in advance.
    Aisurya

    Workbench is used to create, display and modify the objects. It will display the source table data and we can see the logs of the job which we have executed and also we can see the status of a job. In bods 4.2 you can design the dataflow in workbench in previous release we don’t have that option but designer contains debugging option, you can write scripts,  it will support all databases; these option are not available in workbench. for more information refer this document:
    https://decisionfirst.files.wordpress.com/2014/07/data-services-workbench-intro.pdf
    http://scn.sap.com/community/data-services/blog/2014/03/01/data-services-42-workbench
    http://scn.sap.com/community/data-services/blog/2013/01/24/data-services-workbench-part-1

  • Adobe AIR 2.6 - memory leak when waiting on remote service call!

    Our AIR app has a function to export data from a DataGrid to Excel, which calls out to our J2EE server to build the excel file, and is then returned to the client as a byteArray which can then be saved on the client machine. We have noticed that for large data sets over a few thousand rows, while the client is waiting for the server to return from the remote object service call, memory utilisation steadily increases and can reach 1GB. The bizarre thing is that this increase is noticed for the adl.exe memory utilisation as reported in Windows Task Manager, whereas when we use the Flashbuilder memory profiler to monitor the same process we see no increase in memory utilisation. Given that while the client is waiting on the server to return from this call the client isn't doing anything else, we are baffled as to why memory should be eaten up by the AIR runtime.  Can anyone explain what is going on, and what steps we can take to stop this from occurring?
    Many thanks,
    Murray

    Any chance you can check that out with the latest AIR?
    Either way, it sounds like a bug, please report it at http://bugbase.adobe.com/ and then report the bug number here. 
    If you're able to provide a reproducable case that would really increase the chance that we can do something about it.
    Thanks,
    roymeo

  • Script example trigger web service call and populate request from adobe

    Hello,
    I'm trying to make a adobe interactive form that needs to be populated by a web service. I have one field : In the dataconnection that is the input for the web service request and this is bound to the request. I have a button that is connected to my web service. After filling in a new value and pushing the button I want the web service request to be triggered.
    Thus anyone has a coding example or more information about using web services directly from within a Adobe Interactive form ?
    thnx, Jasper

    Hi Jasper,
    You may refer the Adobe ddevelopment center for the docs related to the execute property of the button to trigger a web service.
    <i>Alternatively, if you do not want to create a button to execute a call to a Web Service, you can do it via Script.
    Assuming your Data Connection is named ‘LeasePayment’
    For JavaScript:
    xfa.connectionSet.LeasePayment.execute(0);
    For Form Calc:
    $connectionSet.LeasePayment.execute(0);
    execute(0) indicates no data merging
    execute(1) indicates all the data in the data DOM will be remerged.</i> - Adobe doc.
    hope this will help.
    Thanks andRegards,
    Anto.

  • Why Service Call and why not call Function module Directly in WD ABAP

    Hi,
    I have created a Webdynpro applications and the logic requires calling avrious Function modules.
    Do I need to create Service Call for each Function module or call them directly.
    It would be great if you can suggest me under what cases I need to opt for Service call
    For example, if I use 'RP_CALC_DATE_IN_INTERVAL', do I need to use Service call or call function module directly.
    Note: I have searched forums but could not get the correct answer which I want
    Thanks!

    The Service Call is really meant to be a wizard/time saver.  It has the advantage that it can generate matching context nodes/attributes for the interface of the Function Module you are calling. However everything that the service call does can also be created by hand.
    Personally I'm not a fan of what the service call wizard generates.  Its good as a time saver or for beginners, but I find I prefer to touch up the code it generates anyway. I much prefer to create a nice reusable model class with its own unit test and then consume this model class (with the service call wizard) from WD.  This model class might contain one or more function module calls depending upon what logic I need to access.

  • Service call and code wizard

    Dear All,
    I am working on ECC 6.0 with Eph2 and SAP_HR SP27, when i tried to create a service call to function module in the Adapt Context i am not able to view the check box for selection.
    Also when i click the Webdynpro Code Wizard it shows only a template gallery with standard screen,from and table only, which is not not displayin the Web dynpro statement structure
    What could be the possible reason?
    Patch level update or Service activation ?
    Could you help me out in the solving this issue?

    > when i tried to create a service call to function module in the Adapt Context i am not able to view the check box for selection.
    What checkbox can you not see?  I am looking at that step in the Wizard and there isn't any checkbox - just a table control with the node type, name, object type, new name.
    >Also when i click the Webdynpro Code Wizard it shows only a template gallery with standard screen,from and table only, which is not not displayin the Web dynpro statement structure
    The Web Dynpro Code Wizard from the View-layout tab should only have the Screen, Form, and Table option.  What else where you expecting. If you want the code generation wizard then you are in the wrong place.  Form the method editor choose the Web Dynpro Code Wizard and you will get a completely different set of options than choosing the same option from the view-layout tab.

  • How to stop the remote service call

    Hi
    On loading a screen i place some service call, now i move to next screen , but still the service call is running, i have to stop or cancel the last placed service call.Is there any way to stop the service call with out disconnecting the channel.
    thanks in advance
    karthy

    Here are the solutions I can think of (if no one here responds with something better):
    1. Open Settings and then Phone within the Settings screen and see if you can find a setting there for the call summary. The Phone submenu under Settings would be the most likely place.
    2. Open Settings on your iPhone and go through each item including all of the items within each main item. Within about 10 minutes you should be able to get through all of the settings and find the setting if it exists on your phone. There is no such setting on my phone but it is possible that Airtel has a custom menu with that.
    3. If you still haven't found it, you could check a) Airtel's support site and/or b) an Airtel specific forum.
    4. If still no luck, I would call Airtel and ask again and if you get the same response ask for the location of the setting (or to speak to someone who can tell you).
    Good luck.

  • Service Call and Invoice For That Service Call

    What field relates an invoice created within the service call form under expenses, to the originating service call number. I know it is somewhere but I cannot find it.  The invoice needs to know the originating service calll number.
    Thanks, David

    Yes the field is there SCL4 but the problem is timing. It is posted too late to be meaningful.
    While in an invoice,  I need to capture the service call ID so that I can assign the service call id to a field in the invoice, and also
    import the remarks from the service call to the remarks on the invoice.
    The way B1 words is that SCL4 gets populated way too late in the game. The SCL4 table gets populated only after Updating  the service call itself. This is after the user has created and exited the invoice.
    Any other suggestions for dynamically capturnig the invoice id during invoice creation under a service call?
    Thanks, David

  • Posting to SCL4 -- Link an service call and an invoice --

    Is there any way to post to SCL4 sooner to create the link between a service order and an expense document.
    Currently the link is created after one leaves the service module.  That is too late to be functional. 
    Therefore you cannot grab the service id of the current service order and assign it to the marketing document created while in the service module.
    SCL4 creates a strong link between the serivce order and the expense document, it is just too late.
    The link is made on exit of the service call.  
    It would be great if the link was created when the user "Adds" the expense document (sales order or invoice) to B1 while in the service module.
    Thanks, David

    Yes the field is there SCL4 but the problem is timing. It is posted too late to be meaningful.
    While in an invoice,  I need to capture the service call ID so that I can assign the service call id to a field in the invoice, and also
    import the remarks from the service call to the remarks on the invoice.
    The way B1 words is that SCL4 gets populated way too late in the game. The SCL4 table gets populated only after Updating  the service call itself. This is after the user has created and exited the invoice.
    Any other suggestions for dynamically capturnig the invoice id during invoice creation under a service call?
    Thanks, David

Maybe you are looking for