Search Results

Search found 21430 results on 858 pages for 'message digest'.

Page 120/858 | < Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >

  • WCF - "Encountered unexpected character 'c'."

    - by Villager
    Hello, I am trying to do something that I thought would be simple. I need to create a WCF service that I can post to via JQuery. I have an operation in my WCF service that is defined as follows: [OperationContract] [WebInvoke(Method = "POST", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat=WebMessageFormat.Json, ResponseFormat=WebMessageFormat.Json)] public string SendMessage(string message, int urgency) { try { // Do stuff return "1"; // 1 represents success } catch (Exception) { return "0"; } } I then try to access this operation from an ASP.NET page via JQuery. My JQuery code to access this operation looks like the following: function sendMessage(message) { $.ajax({ url: "/resources/services/myService.svc/SendMessage", type: "POST", contentType: "application/json; charset=utf-8", data: ({ message: message, urgency: '1' }), dataType: "json", success: function (data) { alert("here!"); }, error: function (req, msg, obj) { alert("error: " + req.responseText); } }); } When I execute this script, the error handler is tripped. In it, I receive an error that says: "Encountered unexpected character 'c'." This message is included with a long stack trace. My question is, what am I doing wrong? I have received other posts such as this one (http://stackoverflow.com/questions/320291/how-to-post-an-array-of-complex-objects-with-json-jquery-to-asp-net-mvc-controll) without any luck. How do I get this basic interaction working? Thank you!

    Read the article

  • using a stored procedure for login in c#

    - by Jin Yim
    Hi all, If I run a store procedure with two parameter values (admin, admin) (parameters : admin, admin) I get the following message : Session_UID User_Group_Name Sys_User_Name NULLAdministratorsNTMSAdmin No rows affected. (1 row(s) returned) @RETURN_VALUE = 0 Finished running [dbo].[p_SYS_Login]. -- To get the same message in c# I used the code following : string strConnection = Settings.Default.ConnectionString; using (SqlConnection conn = new SqlConnection(strConnection)) { using (SqlCommand cmd = new SqlCommand()) { SqlDataReader rdr = null; cmd.Connection = conn; cmd.CommandText = "p_SYS_Login"; cmd.CommandType = CommandType.StoredProcedure; SqlParameter paramReturnValue = new SqlParameter(); paramReturnValue.ParameterName = "@RETURN_VALUE"; paramReturnValue.SqlDbType = SqlDbType.Int; paramReturnValue.SourceColumn = null; paramReturnValue.Direction = ParameterDirection.ReturnValue; cmd.Parameters.Add(paramReturnValue); cmd.Parameters.Add(paramGroupName); cmd.Parameters.Add(paramUserName); cmd.Parameters.AddWithValue("@Sys_Login", "admin"); cmd.Parameters.AddWithValue("@Sys_Password", "admin"); try { conn.Open(); rdr = cmd.ExecuteReader(); string test = (string)cmd.Parameters["@RETURN_VALUE"].Value; while (rdr.Read()) { Console.WriteLine("test : " + rdr[0]); } } catch (Exception ex) { string message = ex.Message; string caption = "MAVIS Exception"; MessageBoxButtons buttons = MessageBoxButtons.OK; MessageBox.Show( message, caption, buttons, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1); } finally { cmd.Dispose(); conn.Close(); } } } but I get nothing in SqlDataReader rdr ; is there something I am missing ? Thanks

    Read the article

  • Seam log4j credential logs

    - by Marc
    In Seam, using log4, I would like to have my info, warn and error always logging the logged in user (if so) name to be logged with whatever the log message is. Being a consistant thing I do not want to have to grab the logged-in user name, and prefix the message. so I attempted to populate the log4j NDC to have it as a field of the log message. Pushing the user name on successful login: NDC.push(credentials.getUsername()); Which works, but the NDC is managed per thread, so once another thread processes a request from the same logged in user, the trace of this user name is lost. I was thinking that there should be a common pattern to accomplish this simple task which is attaching each log message to the logged user, using the NDC or not, to know exactly what user triggered what action. Anyone knows the appropriate way to accomplish this?

    Read the article

  • Different i18n in spring according to url

    - by Fanooos
    I have a spring web application that is required to work as following the application will be accessed from two different URLs www.domain1.com and www.domain2.com and it is required that the two URLs looks like two different applications with different CSS and I18n. for the css part is done but I am stuck with the i18n part How to make spring load different i18n properties file according to the domain name? The solution that I thought in is to implement a filter that check the request URL and according to the URL it clears the message source bean and load the required i18n file but it does not looks good for the performance by the way I am using ReloadableResourceBundleMessageSource message source Another solution is to implement two different message sources. The problem with this solution is that from the source code I can manage the bean that I use but how can I tell the fmt:message tag which data source to use ? Thanks in advance and best regards

    Read the article

  • How to handle lifecycle of dynamically allocated data in Windows messages?

    - by nang
    Simple task: Send a windows message with dynamically allocated data, e.g. an arbitrary length string. How would you manage the responsibility to free this data? The receiver(s) of the windows message could be responsible to free this data. But: How can you guarantee that all messages will actually be received and thus the linked data will be freed? Imagine the situation that the receiver is shutting down, so it won't process it's message queue any more. However, the message queue still exists (for some time) and can still accept messages, which won't be processed any more. Thanks!

    Read the article

  • Getting unhandled error and connection get lost when a client tries to communicate with chat server in twisted

    - by user2433888
    from twisted.internet.protocol import Protocol,Factory from twisted.internet import reactor class ChatServer(Protocol): def connectionMade(self): print "A Client Has Connected" self.factory.clients.append(self) print"clients are ",self.factory.clients self.transport.write('Hello,Welcome to the telnet chat to sign in type aim:YOUR NAME HERE to send a messsage type msg:YOURMESSAGE '+'\n') def connectionLost(self,reason): self.factory.clients.remove(self) self.transport.write('Somebody was disconnected from the server') def dataReceived(self,data): #print "data is",data a = data.split(':') if len(a) > 1: command = a[0] content = a[1] msg="" if command =="iam": self.name + "has joined" elif command == "msg": ma=sg = self.name + ":" +content print msg for c in self.factory.clients: c.message(msg) def message(self,message): self.transport.write(message + '\n') factory = Factory() factory.protocol = ChatServer factory.clients = [] reactor.listenTCP(80,factory) print "Iphone Chat server started" reactor.run() The above code is running succesfully...but when i connect the client (by typing telnet localhost 80) to this chatserver and try to write message ,connection gets lost and following errors occurs : Iphone Chat server started A Client Has Connected clients are [<__main__.ChatServer instance at 0x024AC0A8>] Unhandled Error Traceback (most recent call last): File "C:\Python27\lib\site-packages\twisted\python\log.py", line 84, in callWithLogger return callWithContext({"system": lp}, func, *args, **kw) File "C:\Python27\lib\site-packages\twisted\python\log.py", line 69, in callWithContext return context.call({ILogContext: newCtx}, func, *args, **kw) File "C:\Python27\lib\site-packages\twisted\python\context.py", line 118, in callWithContext return self.currentContext().callWithContext(ctx, func, *args, **kw) File "C:\Python27\lib\site-packages\twisted\python\context.py", line 81, in callWithContext return func(*args,**kw) --- --- File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 150, in _doReadOrWrite why = getattr(selectable, method)() File "C:\Python27\lib\site-packages\twisted\internet\tcp.py", line 199, in doRead rval = self.protocol.dataReceived(data) File "D:\chatserverultimate.py", line 21, in dataReceived content = a[1] exceptions.IndexError: list index out of range Where am I going wrong?

    Read the article

  • jQuery & PHP: Running action in background

    - by Azzyh
    Hi, so I want to do something like when you press on LogOut, you get a waiting message like "please wait.." while its running ucp.php?mode=logout in the background, and after it has loaded that it should refresh the site. How should this be done?? I am new to jquery, but so far i gave my link a ID, called #logout, made a <div id="message"></div> and then in jquery i did: jQuery(document).ready(function(){ $('#tryout').click(function () { logOut(); }); function logOut() { var postFile = 'ucp.php?mode=logout'; $.post(postFile, function(data){ $("#message").fadeIn('slow'); }); } Now is this right? And the line with #message, where it fades in, i don't really think its right because where's should i write the "Please wait" and the refresh part? Please help me

    Read the article

  • Keeping messages in queue in case of receiver crash

    - by John Doe
    Hi, We've a Spring JMS message listener container for receiving messages asynchronously. Using DefaultMessageListenerContainer and in sessionTransacted mode. I understand being in sessionTransacted mode means in case of an exception the message will be put back into the queue. But how can I make sure the message won't be deleted from the queue even if the receiver (which is picked the message) crashes or just the machine running it looses power? At first I thought CLIENT_ACKNOWLEDGE acknowledge mode should save me, but apparently it's not the case, Spring calls .acknowledge() no matter what. So here's my question, how can I guarantee the delivery? Using a custom MessageListenerContainer? Using a transaction manager?

    Read the article

  • Changing the title of jQuery-UI dialog-box with in another dialog-box's function...

    - by Brian Ojeda
    Why doesn't doesn't the second jQuery-UI dialog box title change when popped. The first dialog box I change the title of the box with using the following .attr("title", "Confirm") -- it change the title of the first box to 'Confirm', like it should have. Now when the second box pops up it should change the title to 'Message' since did the same thing for the second box -- .attr("title", "Message"). Right? But it doesnt. It keep the title from before. However, the message change like it should have. I have tested in IE8, Chrome, and FF3.6. <div id="dialog-confirm" title=""></div> <-- This is the html before jQuery functions. Javascript / jQuery $('#userDelete').click(function() { $(function() { var dialogIcon = "<span class=\"ui-icon ui-icon-alert\"></span>"; var dialogMessage = dialogIcon + "Are you sure you want to delete?"; $("#dialog-confirm").attr("title", "Confirm").html(dialogMessage).dialog({ resizable: false, height: 125, width: 300, modal: true, buttons: { 'Delete': function() { $(this).dialog('close'); $.post('user_ajax.php', {action: 'delete', aId: $('[name=aId]').val() }, function(data) { if(data.success){ var dialogIcon = "<span class=\"ui-icon ui-icon-info\"></span>"; var dialogMessage = dialogIcon + data.message; $('#dialog-confirm').attr("title", "Message"); $('#dialog-confirm').html(dialogMessage); $('#dialog-confirm').dialog({ resizable: false, height: 125, width: 300, modal: true, buttons: { 'Okay': function() { $(this).dialog('close'); var url = $_httpaddress + "admin/index.php" $(location).attr('href',url); } // End of Okay Button Function } //--- End of Dialog Button Script });//--- End of Dialog Function } else { $_messageConsole.slideDown(); $_messageConsole.html(data.message); } }, 'json'); }, //--- End of Delete Button Function 'Cancel': function() { $(this).dialog('close'); } //--- End of Cancel Button Function } //--- End of Dialog Button Script }); //--- End of Dialog Script }); //--- End of Dialog Function return false; }); Thank you for you assistant, if you choose to help.

    Read the article

  • Comet with multiple channels

    - by mark_dj
    Hello, I am writing an web app which needs to subscribe to multiple channels via javascript. I am using Atmosphere and Jersey as backend. However the jQuery plugin they work with only supports 1 channel. I've start buidling my own implementation. Now it works oke, but when i try to subscribe to 2 channels only 1 channel gets notified. Is the XMLHttpRequest blocking the rest of the XMLHttpRequests? Here's my code: function AtmosphereComet(url) { this.Connected = new signals.Signal(); this.Disconnected = new signals.Signal(); this.NewMessage = new signals.Signal(); var xhr = null; var self = this; var gotWelcomeMessage = false; var readPosition; var url = url; var onIncomingXhr = function() { if (xhr.readyState == 3) { if (xhr.status==200) // Received a message { var message = xhr.responseText; console.log(message); if(!gotWelcomeMessage && message.indexOf("") -1) { gotWelcomeMessage = true; self.Connected.dispatch(sprintf("Connected to %s", url)); } else { self.NewMessage.dispatch(message.substr(readPosition)); } readPosition = this.responseText.length; } } else if (this.readyState == 4) { self.disconnect(); } } var getXhr = function() { if ( window.location.protocol !== "file:" ) { try { return new window.XMLHttpRequest(); } catch(xhrError) {} } try { return new window.ActiveXObject("Microsoft.XMLHTTP"); } catch(activeError) {} } this.connect = function() { xhr = getXhr(); xhr.onreadystatechange = onIncomingXhr; xhr.open("GET", url, true); xhr.send(null); } this.disconnect = function() { xhr.onreadystatechange = null; xhr.abort(); } this.send = function(message) { } } And the test code: var connection1 = AtmosphereConnection("http://192.168.1.145:9999/botenveiling/b/product/status/2", AtmosphereComet); var connection2 = AtmosphereConnection("http://192.168.1.145:9999/botenveiling/b/product/status/1", AtmosphereComet); var output = function(msg) { alert(output); }; connection1.NewMessage.add(output); connection2.NewMessage.add(output); connection1.connect(); In AtmosphereConnection I instantiate the given AtmosphereComet with "new". I iterate over the object to check if it has to methods: "send", "connect", "disconnect". The reason for this is that i can switch the implementation later on when i complete the websocket implementation :) However I think the problem rests with the XmlHttpRequest object, or am i mistaken? P.S.: signals.Signal is a js observer/notifier library: http://millermedeiros.github.com/js-signals/ Testing: Firefox 3.6.1.3

    Read the article

  • UDP + total order, non-reliable

    - by disown
    I'm trying to find a version of UDP which just alleviates the restriction of a maximum size of the message sent. I don't care about reliability or partial retransmission, if all chunks arrive I want the message to be assembled from the chunks in sending order and delivered to the listening app. If one or more chunks are missing I would just like to discard the message. The goal is to have a low-latency notification mechanism about real time data, but with the added support for bigger messages than what would fit in an IP datagram. I would like the protocol to be one way only, and not have long connection setup times. An optional feature to be able to respond to a received message wouldn't hurt (a concept of an unreliable connection), but is not necessary.

    Read the article

  • Learning rails and AJAX. How do I load a div via ajax and then toggle hiding/showing it?

    - by Kevin L.
    I'm doing my first Ruby on Rails project. I am working on a project where the user can add a new message. Then they can add updates to this message like a thread. I've got it all written and now I'm going back and applying some AJAX. I want to show just the main message when the page first loads. Then when I click a link I want an AJAX event to fire that populates a div with all the updates to the message. Then I want this same link to toggle hiding and showing the div. I've made a submit button to fire the ajax and get back the updates using form_remote_tag. I've also created a separate link to toggle the hiding using $(div_id).toggle();. But now I'm stuck on how to combine these two things into one all purpose link. Thanks.

    Read the article

  • Cannot access new folders created in my Apache2 document-root

    - by user235101
    I have tried to create a new folder 'test' in my documentroot of my Apache2 installation, however, whenever I try and access it from a web-browser it gives me a 403 (forbidden) error. My virtualhosts file - <VirtualHost *:80> ServerAdmin webmaster@localhost ServerName REMOVED DocumentRoot /var/www/ <Directory /> Options FollowSymLinks AllowOverride All AuthType Digest AuthName "documentroot" AuthDigestProvider file AuthUserFile /etc/apache2/htpasswd Require user REMOVED AllowOverride Indexes </Directory> <Directory /var/www/> Options FollowSymLinks Options -Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> <Directory /var/www/share/> Order Deny,Allow Allow from all Satisfy any </Directory> <Directory /var/www/REMOVED/> Order Deny,Allow Allow from all Satisfy any </Directory> <Directory /var/www/stream/> Order Deny,Allow Allow from all Satisfy any </Directory> <Directory /var/www/test> Order Deny,Allow Allow from all Satisfy any </Directory> ErrorLog /var/log/apache2/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/access.log combined <Directory /var/www/REMOVED> AuthType Digest AuthName "rutorrent" AuthDigestDomain /var/www/REMOVED/ http://46.105.127.19/REMOVED AuthDigestProvider file AuthUserFile /etc/apache2/htpasswd Require valid-user SetEnv R_ENV "/var/www/REMOVED" AllowOverride Indexes </Directory> </VirtualHost> Image of the permissions - Other information - If I create a new folder (and use chmod --reference to ensure it has the same permissions as an accessible folder), I get a 403 client-side. If I copy folder 'rapidleech' to the name 'rapidleech1', it will let access 'rapidleech1', but no longer 'rapidleech', until I delete the copy. In my logs I found nothing logged in errors.log, and only that it delivered a 403 in access.log. All the appropriate users are members of www-data.

    Read the article

  • Windows Azure:broken logging after migration to the new SDK 1.3

    - by cloud.dev
    Hi, pls, help. I've migrated to new SDK 1. (Full-IIS mode) I use the following logging: case TraceLevel.Error: Trace.TraceError(message); break; case TraceLevel.Warning: Trace.TraceWarning(message); break; case TraceLevel.Info: Trace.TraceInformation(message); break; case TraceLevel.Verbose: Trace.WriteLine(message); break; it worked fine until I migrated to the new SDK. now, logging works only for Worker Roles. Web-Role can log only inside OnStart-method of WebRole.cs in other cases: logged nothing I understand that Full-IIS means different domains. so, I must call someway WaIIS.exe from w3wp.exe or ...?

    Read the article

  • mail function not working for yahoo mail id

    - by Akash
    Hello all, I have written a code to send mail on yahoo or gmail.Mail is sending on gmail but i m not seeing any message in yahoo mail. And in gmail i m seeing all html content with message. here is my code... $headers = "From: \"".$from_name."\" <".$from_email.">\n"; $headers .= "To: \"".$to_name."\" <".$to_email.">\n"; $headers .= "Return-Path: <".$from_email.">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: text/HTML; charset=ISO-8859-1\n"; // message $message = ' <html> <head> <title>Registration</title> </head> <body> <table><tr> <td> <a href="#'> Click Here To Activate Your account</a> Thanks To visit site.com </td> </tr> </table> </body> </html>'; if(mail('', $subject, $message, $headers)) echo "successfully register !! please check your mail and clik on confirmation link";

    Read the article

  • Making two Windows using CreateWindowsEx()

    - by Jamie Keeling
    Hello, I have a windows form that has a simple menu and performs a simple operation, I want to be able to create another windows form with all the functionality of a menu bar, message pump etc.. as a separate thread so I can then share the results of the operation to the second window. I.E. 1) Form A opens Form B opens as a separate thread 2)Form A performs operation 3)Form A passes results via memory to Form B 4)Form B display results I'm confused as to how to go about it, the main app runs fine but i'm not sure how to add a second window if the first one already exists. I think that using CreateWindow will allow me to make another window but again i'm not sure how to access the message pump so I can respond to certain events like WM_CREATE on the second window. I hope it makes sense. Thanks! Edit: I've attempted to make a second window and although this does compile, no windows show atall on build. ////////////////////// // WINDOWS FUNCTION // ////////////////////// LRESULT CALLBACK WindowFunc(HWND hMainWindow, UINT message, WPARAM wParam, LPARAM lParam) { //Fields WCHAR buffer[256]; struct DiceData storage; HWND hwnd; // Act on current message switch(message) { case WM_CREATE: AddMenus(hMainWindow); hwnd = CreateWindowEx( 0, "ChildWClass", (LPCTSTR) NULL, WS_CHILD | WS_BORDER | WS_VISIBLE, 0, 0, 0, 0, hMainWindow, NULL, NULL, NULL); ShowWindow(hwnd, SW_SHOW); break; Any suggestions as to why this happens?

    Read the article

  • REBOL: How to do another task while waiting an alarm to trigger ?

    - by Rebol Tutorial
    So I have created an alarm function: alarm: func[seconds message [string! unset!]][ wav: load %attention.wav sound-port: open sound:// wait seconds do [ insert sound-port wav wait sound-port close sound-port if (value? 'message) [ print message ] ] ] which works like this: alarm 30 "Will trigger in 30 seconds" Now how can I for example show a timer which increments while waiting for the alarm since Rebol doesn't support thread ?

    Read the article

  • Server-based Chat

    - by daemonfire300
    Described on this scheme "Server Clients Scheme" I try to create a Silverlight / Server Application which has EventHandler/Triggers, which can do the following: Notice whether a message was sent to "it" (the server) Notice that the sent message is new "to all" "except" "the sender" Send "to all" ("except...") "new message can be downloaded" / or even the new messages How could this be done by using: ASP.NET and Silverlight?

    Read the article

  • RSA PKCS1 implementation in Python

    - by user307016
    I'm working on the RSA PKCS1 implementation in Python,here's the message block i got: m = [0,2,random paddings,0,message integers] I read the RFC2313,and get a equation seems for transforming the message block object into an big-edian integer. I just get confused about how to transform it in Python. Any help would be appreciated.

    Read the article

  • How to handle popup messages thrown from web applications in vb.net?

    - by Menaka
    I am developing a tool to automate testing of a web application. I want to handle the popup messages thrown in error scenarios. The problem am facing is after a button click a popup message is thrown, but only after a response is given to the message box(ie clicking on any buttons in the message box) the execution continues, till then the web browser is busy waiting for a response. Please suggest.

    Read the article

  • to write log files in two different files

    - by Sun
    my application run on customized client framework,the client framework used log4net to log their own log files. we are(our application) has to use the same log4net to log our log files in our own path(say our customized path). currently the our log files are created but log are not writing in that file.it is writting in the client framework log file. searched lot of sites the link http://stackoverflow.com/questions/308436/log4net-programmatcially-specify-multiple-loggers-with-multiple-file-appenders helped me to configure the log4net config programatically, still im log statemets are not written in my log file.the code used as below public class TraceLog { private string message = string.Empty; private static ILog ILogger = null; private static TraceLog instance = new TraceLog(); private TraceLog() { SetLevel("Log4net.MainForm", "ALL"); AddAppender("Log4net.MainForm", CreateFileAppender("FileAppender", "C:\\mylog.log")); } public static TraceLog Instance { get { return instance; } } public void Debug(string logMessage) { message = PrepareLog(logMessage); ILogger.Debug(message); } protected string PrepareLog(string logMessage) { string message = GetFileMethodLineNumberInfo(); message += logMessage; return message; } protected string GetFileMethodLineNumberInfo() { StackTrace stackTrace = new StackTrace(true); // The position 3 is relative to the index of the specified method StackFrame stackFrame = stackTrace.GetFrame(3); return (stackFrame.GetMethod().DeclaringType.Name + "/" + stackFrame.GetMethod().Name + "/" + stackFrame.GetFileLineNumber() + ":"); } private static void SetLevel(string loggerName, string levelName) { ILogger = LogManager.GetLogger(loggerName); log4net.Repository.Hierarchy.Logger l = (log4net.Repository.Hierarchy.Logger)ILogger.Logger; l.Level = l.Hierarchy.LevelMap[levelName]; } private static void AddAppender(string loggerName, IAppender appender) { ILogger = LogManager.GetLogger(loggerName); log4net.Repository.Hierarchy.Logger l = (log4net.Repository.Hierarchy.Logger)ILogger.Logger; l.AddAppender(appender); } private static IAppender CreateFileAppender(string name, string fileName) { FileAppender appender = new FileAppender(); appender.Name = name; appender.File = fileName; appender.AppendToFile = true; //PatternLayout layout = new PatternLayout(); //layout.ConversionPattern = "%d [%t] %-5p %c [%x] - %m%n"; //layout.ActivateOptions(); //appender.Layout = layout; appender.ActivateOptions(); return appender; } } } anyone pls help how to solve this

    Read the article

< Previous Page | 116 117 118 119 120 121 122 123 124 125 126 127  | Next Page >