Search Results

Search found 853 results on 35 pages for 'v4 0'.

Page 22/35 | < Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >

  • sending binary data via POST on android

    - by wo_shi_ni_ba_ba
    Android supports a limited version of apache's http client(v4). typically if I want to send binary data using content type= application/octet-stream via POST, I do the following: HttpClient client = getHttpClient(); HttpPost method=new HttpPost("http://192.168.0.1:8080/xxx"); System.err.println("send to server "+s); if(compression){ byte[]compressed =compress(s); RequestEntity entity = new ByteArrayRequestEntity(compressed); method.setEntity(entity); } HttpResponse resp=client.execute(method); however ByteArrayRequestEntity is not supported on android. what can I do?

    Read the article

  • How do I use a command line tool to install .net 4 to IIS

    - by tehp
    I'm trying to deploy my WCF RIA services application to our in-house server for testing. I've been following the instructions and comments from this blog site: http://timheuer.com/blog/archive/2009/12/10/tips-to-deploy-ria-services-troubleshoot.aspx At the end someone points to this question: http://stackoverflow.com/questions/1528324/how-to-solve-a-http-error-404-3-not-found-error I've been trying to run that same tool with .net 4.0 but it keeps giving me an error: [Warning]The HTTP namespace reservation already exists. I am running the version of the exe that I found inside of C:\Windows\Microsoft.NET\Framework\v4.0.21006 There is also C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation that has (what I assume is) the same exe in it, and I can use it just fine. I've tried to un-install the 3.0 version before installing the 4.0 version, but I am still getting the same warning and failure. Has anyone successfully done this with .net 4.0?

    Read the article

  • IIS errors since upgrading to dot net 4

    - by user376085
    Back in October we upgraded one of our sites (on IIS 6) from .net 3.5 to .net 4.0. Since then we have been getting the following warning and error pretty much everyday: Warning: ISAPI 'c:\windows\microsoft.net\framework\v4.0.30319\aspnet_isapi.dll' reported itself as unhealthy for the following reason: 'Deadlock detected'. Error: It is not possible to run two different versions of ASP.NET in the same IIS process. Please use the IIS Administration Tool to reconfigure your server to run the application in a separate process. We have checked all applications and ensured that they are running on the correct versions of ASP.NET and also in their own separate app pools. We have looked at the IIS logs at the time the errors are recorded but this doesn't give any clues as to the issue. Is there a tool available that could give us more information as as to which application is causing the errors and what was happening at the time?

    Read the article

  • How can I use a config-file in Expression Blend 4?

    - by sofri
    Hi, while trying to use the "InfoStrat"-Bing-Maps-Control in Expression Blend 4 for my Surface Application, I get the error message: "Mixed mode assembly is built against version v2.0.50527 of the runtime and cannot be loaded in the 4.0 runtime without additional configuration information" I already found out that I need to write this configfile: <configuration> <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup> </configuration> But Expression Blend doesn't seem to recognize that it is there. So how can I solve this problem?

    Read the article

  • Mscorcfg.msc .net Configuration Tools problem

    - by vijay shiyani
    I'm trying to run Microsoft's .NET Framework Configuration Tool (Mscorcfg.msc). I have Visual Studio 2008 installed. I also have the following installed on my PC: Microsoft .Net Framework v1.0.3705 Microsoft .Net Framework 2.0 Service Pack 2 Microsoft .Net Framework 3.0 Service Pack 2 Microsoft .Net Framework 3.5 SP1 Microsoft .Net Framework v4.0.30319 I'm not sure why, but I can't start "Mscorcfg.msc" the usual way (as suggested in the http://msdn.microsoft.com/en-us/library/2bc0cxhc(VS.80).aspx and http://msdn.microsoft.com/en-us/library/2bc0cxhc.aspx URL). I looked for "Mscorcfg.msc" on my PC and found only 1 occurence (in the C:\WINDOWS\ServicePackFiles\i386 folder). When I double-click on the .msc file in Windows Explorer, I get the "MMC could not create the snap-in." message. What should I do ? Thanks

    Read the article

  • Detailed change history of .NET framework versions?

    - by gehho
    I am looking for a detailed change history (including bugfixes) of all .NET framework versions, especially the changes between 2.0 and 3.5 SP1. I know that something like that exists for v2.0 and v1.1, and for v4.0. However, I could not find a history for v3.0 and v3.5/SP1. Background: (slightly edited) We are having issues somewhere between deserialization of some XML data (using XmlReader) and the display of the data in the UI. These problems appear when we use .NET 3.5 SP1, but we did not have them in v2.0. Now, I would like to know if this is related to some change/bugfix in the framework, or if this is related to some other difference. Unfortunately, we do not have the source code of that piece of software, and most of the software is written using native C++/MFC, except for the deserialization part which is .NET.

    Read the article

  • Sandcastle not adding param documentation

    - by rockinthesixstring
    My method looks as follows ''' <summary> ''' Adds the activity. ''' </summary> ''' <param name="userid">An that is derived from the <see cref="Domain.User.ID" /></param> ''' <param name="activity">The activity integer that is to be derived from the <see cref="ActivityLogService.LogType" />.</param> ''' <param name="ip">An IP V4 IP Address.</param>integer ''' <remarks></remarks> Public Sub AddActivity(ByVal userid As Integer, ByVal activity As Integer, ByVal ip As String) Implements IActivityLogService.AddActivity Dim _activity As ActivityLog = New ActivityLog _activity.Activity = activity _activity.UserID = userid _activity.UserIP = ip.IPAddressToNumber _activity.ActivityDate = DateTime.UtcNow ActivityLogRepository.AddActivity(_activity) End Sub But when I run Sandcastle, my documentation ends up looking like this userid Type: System..::..Int32 [Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"] activity Type: System..::..Int32 [Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"] ip Type: System..::..String [Missing documentation for "M:myapp.Core.Domain.ActivityLogService.AddActivity(System.Int32,System.Int32,System.String)"] What am I doing wrong?

    Read the article

  • C# String Resource Values as Enum String Part values?

    - by JL
    Using VS2010 and .net V4.0 I would like to achieve the following: I already have 2 resource files in my project for 2 languages - English and Czech. I must say Resource Management in .net is excellent, I am suprised even to get code completion when implementing a String for example: string desc = Strings.ResourceManagerDesc This gets the string associated with the current culture of the thread. Now I am trying to create an Enum that can have the String portion of the Enum interpreted from the Strings resources. In the following way (This code DOES NOT WORK): public enum DownloadStatus { 1 = Strings.DownloadState_Complete, 2 = Strings.DownloadState_Failed, 3 = Strings.DownloadState_InProgress } This is a made up example, but you can see the point here. Since the above code won't work, is there a best practice way to achieve what I want?

    Read the article

  • How to scan for available networks for Blackberry device from application?

    - by amsiddh
    Hi All, Is there any RIM API available which will help to get the list of available network service or only Wi-Fi networks for a device and set selected network access point for any network communications? Is it possible programmatically to disable the Mobile networks like GPRS, WAP, etc? For Ex: When a application is started it should scan for WiFi connections (even if there are no previous WiFi network access points are set on device) and list the available WiFi connection. Then user will select the appropriate WiFi connection to connect for any network communication. Outside the application any internet communication (like browser or any other application) should done through same selected WiFi connection. The scanning for WiFi and setting the connection is almost similar to Blackberry WiFi Setup. If anyone know how to implement this using available RIM API and let me know its possible or not. Please share if anyone have any code snippet related to this. I am looking for OS v4.5, 4.7, and 5.0. Thanks, siddh.

    Read the article

  • Free object/widget in GTK?

    - by wag2639
    I've got a pack box in my GTK application and I'm replacing it every once in a while with a completely new entry (at least for now cause I'm in a hurry). Since I'm replacing it with a new instance, do I need to explicitly free from memory the old pack box contents or is there some garbage collection in GTK? If I do need to explicitly need to free the object, is there a command that will recursively go to all objects in that tree (like will it clear my button in a box container inside my main pack box)? I'm using C/GTK-2.0 (gcc v4.4.3 and GTK 2.20.0).

    Read the article

  • Facebook Scrumptious sample app won't build

    - by Chase Roberts
    I did exactly what they do in the video. However, when I get to the scrumptious app and try to build/run it, mine fails. It says: "Parse Issue. Expected a type." Here are the two lines that it thinks are broken (located in the ACAccountStore.h): // Returns the account type object matching the account type identifier. See // ACAccountType.h for well known account type identifiers - (ACAccountType *)accountTypeWithAccountTypeIdentifier:(NSString *)typeIdentifier; // Returns the accounts matching a given account type. - (NSArray *)accountsWithAccountType:(ACAccountType *)accountType; Here is a link to the tutorial. I only didn't even make it two min in before I hit this wall. http://developers.facebook.com/docs/getting-started/facebook-sdk-for-ios/3.1/ I am running Xcode v4.4.1.

    Read the article

  • Error after switching from .NET 3.5 to 4

    - by Queops
    Application.Run(new Main()); This line gives TypeInitializationException was unhandled after I switched from 3.5 to 4 framework. Why is this? Edit: Forgot to mention this is a Winforms C# application. Okay so I have SQLite .NET referenced. I tried this on a project created on .NET 4 by default and didn't give me any error so I assumed it wasn't about SQLite .NET http://sqlite.phxsoftware.com/ Please note v2.0.50727 this is the runtime version of the DLL which seems to be causing the problem. Thrown: "A assemblagem de modo misto foi criada com base na versão 'v2.0.50727' do tempo de execução e não é possível carregá-la no tempo de execução 4.0 sem informações de configuração adicionais." (System.IO.FileLoadException) Exception Message = "A assemblagem de modo misto foi criada com base na versão 'v2.0.50727' do tempo de execução e não é possível carregá-la no tempo de execução 4.0 sem informações de configuração adicionais.", Exception Type = "System.IO.FileLoadException" Seems he can't run the DLL on v4 with/ extra configuration.

    Read the article

  • image on top of button android

    - by N-AccessDev
    Is it possible to add an image(view) on top of a button (which as a background image)? I'm porting an iOS app to Android and it wasn't a problem on iOS, but I'm wondering if it is the right approach on Android because of layouts. Edit : To clarify, check this screen shot : http://a4.mzstatic.com/us/r1000/062/Purple/v4/7c/4b/cd/7c4bcd53-ba55-94d7-a26c-ce1bfe040003/mza_2736801523527387264.320x480-75.jpg I need to do the bottom left button "carte" (card in french) I need : a button with a background image an image displayed on top of the button which is loaded from internet (a card , there is a lot of different and news cards are added daily, in the screnshot it s "MIDI PASS" ) a text localised on the button , so I cant use Imagebutton class.

    Read the article

  • How can I manually uninstall .NET Framework Beta 2?

    - by DannyAsher
    Uninstalled VS2010 Beta 2. Uninstalled .NET Framework 4 Extended Beta 2. On attempting to uninstall .NET Framework 4 Client Profile Beta 2. I get Blocking Issues: You must uninstall the .NET Framework 4 Extended Beta 2 before you uninstall the .NET Framework 4 Client Profile Beta 2. On attempting to reinstall Framework 4 Beta 2 I get: Details: Same or higher version of .NET Framework 4 Beta 2 has already been installed on this computer. Please help! Can I simply remove registry entries and the C:\WINDOWS\Microsoft.NET\Framework\v4.0.21006 directory?

    Read the article

  • jquery json function returning null

    - by ian
    I have a jquery script as below: $.ajax({ type: "GET", url: "http://www.site.com/v4/ajax/get_song_info.php", data: ({id : song_id }), dataType: "json", success: function(data) { alert( "Data: " + data ); } }); And the associated php page: <?php include_once '../connect.php'; $song_id = $_GET['id']; $query = mysql_query("SELECT * FROM songs WHERE id = '$song_id' LIMIT 1"); $song = mysql_fetch_row($query); $song_info = array( htmlentities($song[3]) , htmlentities($song[4]) ); header('Content-Type: application/json'); echo json_encode($song_info); ?> The php returns something like this when I call it on its own in a browser: ["Peaches","I Feel Cream (Proxy Remix)"] However when I make the jQuery call my alert shows 'Data: null'

    Read the article

  • eclipse + multiple checkouts of version-controlled projects

    - by Jason S
    We're using eclipse and svn. We keep the .project file in version control. The problem is, if you have more than one checked-out project (e.g. a trunk checkout and a feature branch) and would like them both to be available in Eclipse, you lose, because the .project files are identical and therefore can't both be imported into Eclipse. What's the right way to deal with this? (I'm mostly having to deal with this in TI's Code Composer v4 which uses an older version of eclipse, but I'm also going to need to do this in the regular Eclipse)

    Read the article

  • ASP.NET GridView throwing error: "Update is disabled for this control".

    - by NTDLS
    I have the absolutely most simple setup imaginable. A single table defined in an Entity model in ASP.net v4, the model is bound directly to a GridView with AutoGenerateEditButton enabled. However, each time I hit edit, then save, the page throws the error “Update is disabled for this control" for which I cannot find a solution. What is causing this error? What can do to resolve it? <% <asp:GridView ID="MenuItemsGrid" runat="server" DataSourceID="gridDataSource" AutoGenerateEditButton="true" AutoGenerateColumns="true"> </asp:GridView> <asp:EntityDataSource ID="gridDataSource" runat="server" ConnectionString="name=dataEntitiesModel" DefaultContainerName="dataEntities" EntitySetName="MenuItems" /> %>

    Read the article

  • handing data returned from jquery get request

    - by ian
    I have a simple jquery script as follows: $('a').click(function() { //get the id of the song we want to play var song_id = $(this).attr("id"); //do a get request to get the information about the song $.get("http://www.site.com/v4/ajax/get_song_info.php", { id: song_id, }, function(data) { alert("Data Loaded: " + data); }); //alert( song_id ); }); I have gotten it to work and it returns several bits of data 'artist' 'title' 'song duration' and so on. How do I process my 'data' so I can then update my page with each bit. In this case I want to set a series of '' to hold each of the values returned. Thanks.

    Read the article

  • How does cross domain file (receiver) work?

    - by seatoskyhk
    So, how does it work? How come having a receiver.html can allow cross domain communication? I... just... don't understand. For example, (using Heyzap as example) <script type="text/javascript" src="http://tools.heyzap.com/external/tools/v4.js"></script> <script type="text/javascript"> HeyzapTools.load({ game_key: "your-game-key-here", hz_receiver_url: "http://example.com/hz_receiver.html" }); </script> and the hz_receiver.html has this content: <html> <body> <script src="/external/tools/hz_receiver.js" type="text/javascript"></script> </body> </html> so, why it will allow cross domain?

    Read the article

  • WCF WS-Security and WSE Nonce Authentication

    - by Rick Strahl
    WCF makes it fairly easy to access WS-* Web Services, except when you run into a service format that it doesn't support. Even then WCF provides a huge amount of flexibility to make the service clients work, however finding the proper interfaces to make that happen is not easy to discover and for the most part undocumented unless you're lucky enough to run into a blog, forum or StackOverflow post on the matter. This is definitely true for the Password Nonce as part of the WS-Security/WSE protocol, which is not natively supported in WCF. Specifically I had a need to create a WCF message on the client that includes a WS-Security header that looks like this from their spec document:<soapenv:Header> <wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <wsse:UsernameToken wsu:Id="UsernameToken-8" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <wsse:Username>TeStUsErNaMe1</wsse:Username> <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" >TeStPaSsWoRd1</wsse:Password> <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" >f8nUe3YupTU5ISdCy3X9Gg==</wsse:Nonce> <wsu:Created>2011-05-04T19:01:40.981Z</wsu:Created> </wsse:UsernameToken> </wsse:Security> </soapenv:Header> Specifically, the Nonce and Created keys are what WCF doesn't create or have a built in formatting for. Why is there a nonce? My first thought here was WTF? The username and password are there in clear text, what does the Nonce accomplish? The Nonce and created keys are are part of WSE Security specification and are meant to allow the server to detect and prevent replay attacks. The hashed nonce should be unique per request which the server can store and check for before running another request thus ensuring that a request is not replayed with exactly the same values. Basic ServiceUtl Import - not much Luck The first thing I did when I imported this service with a service reference was to simply import it as a Service Reference. The Add Service Reference import automatically detects that WS-Security is required and appropariately adds the WS-Security to the basicHttpBinding in the config file:<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <basicHttpBinding> <binding name="RealTimeOnlineSoapBinding"> <security mode="Transport" /> </binding> <binding name="RealTimeOnlineSoapBinding1" /> </basicHttpBinding> </bindings> <client> <endpoint address="https://notarealurl.com:443/services/RealTimeOnline" binding="basicHttpBinding" bindingConfiguration="RealTimeOnlineSoapBinding" contract="RealTimeOnline.RealTimeOnline" name="RealTimeOnline" /> </client> </system.serviceModel> </configuration> If if I run this as is using code like this:var client = new RealTimeOnlineClient(); client.ClientCredentials.UserName.UserName = "TheUsername"; client.ClientCredentials.UserName.Password = "ThePassword"; … I get nothing in terms of WS-Security headers. The request is sent, but the the binding expects transport level security to be applied, rather than message level security. To fix this so that a WS-Security message header is sent the security mode can be changed to: <security mode="TransportWithMessageCredential" /> Now if I re-run I at least get a WS-Security header which looks like this:<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <s:Header> <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <u:Timestamp u:Id="_0"> <u:Created>2012-11-24T02:55:18.011Z</u:Created> <u:Expires>2012-11-24T03:00:18.011Z</u:Expires> </u:Timestamp> <o:UsernameToken u:Id="uuid-18c215d4-1106-40a5-8dd1-c81fdddf19d3-1"> <o:Username>TheUserName</o:Username> <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" >ThePassword</o:Password> </o:UsernameToken> </o:Security> </s:Header> Closer! Now the WS-Security header is there along with a timestamp field (which might not be accepted by some WS-Security expecting services), but there's no Nonce or created timestamp as required by my original service. Using a CustomBinding instead My next try was to go with a CustomBinding instead of basicHttpBinding as it allows a bit more control over the protocol and transport configurations for the binding. Specifically I can explicitly specify the message protocol(s) used. Using configuration file settings here's what the config file looks like:<?xml version="1.0"?> <configuration> <system.serviceModel> <bindings> <customBinding> <binding name="CustomSoapBinding"> <security includeTimestamp="false" authenticationMode="UserNameOverTransport" defaultAlgorithmSuite="Basic256" requireDerivedKeys="false" messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"> </security> <textMessageEncoding messageVersion="Soap11"></textMessageEncoding> <httpsTransport maxReceivedMessageSize="2000000000"/> </binding> </customBinding> </bindings> <client> <endpoint address="https://notrealurl.com:443/services/RealTimeOnline" binding="customBinding" bindingConfiguration="CustomSoapBinding" contract="RealTimeOnline.RealTimeOnline" name="RealTimeOnline" /> </client> </system.serviceModel> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> </configuration> This ends up creating a cleaner header that's missing the timestamp field which can cause some services problems. The WS-Security header output generated with the above looks like this:<s:Header> <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <o:UsernameToken u:Id="uuid-291622ca-4c11-460f-9886-ac1c78813b24-1"> <o:Username>TheUsername</o:Username> <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" >ThePassword</o:Password> </o:UsernameToken> </o:Security> </s:Header> This is closer as it includes only the username and password. The key here is the protocol for WS-Security:messageSecurityVersion="WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10" which explicitly specifies the protocol version. There are several variants of this specification but none of them seem to support the nonce unfortunately. This protocol does allow for optional omission of the Nonce and created timestamp provided (which effectively makes those keys optional). With some services I tried that requested a Nonce just using this protocol actually worked where the default basicHttpBinding failed to connect, so this is a possible solution for access to some services. Unfortunately for my target service that was not an option. The nonce has to be there. Creating Custom ClientCredentials As it turns out WCF doesn't have support for the Digest Nonce as part of WS-Security, and so as far as I can tell there's no way to do it just with configuration settings. I did a bunch of research on this trying to find workarounds for this, and I did find a couple of entries on StackOverflow as well as on the MSDN forums. However, none of these are particularily clear and I ended up using bits and pieces of several of them to arrive at a working solution in the end. http://stackoverflow.com/questions/896901/wcf-adding-nonce-to-usernametoken http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/4df3354f-0627-42d9-b5fb-6e880b60f8ee The latter forum message is the more useful of the two (the last message on the thread in particular) and it has most of the information required to make this work. But it took some experimentation for me to get this right so I'll recount the process here maybe a bit more comprehensively. In order for this to work a number of classes have to be overridden: ClientCredentials ClientCredentialsSecurityTokenManager WSSecurityTokenizer The idea is that we need to create a custom ClientCredential class to hold the custom properties so they can be set from the UI or via configuration settings. The TokenManager and Tokenizer are mainly required to allow the custom credentials class to flow through the WCF pipeline and eventually provide custom serialization. Here are the three classes required and their full implementations:public class CustomCredentials : ClientCredentials { public CustomCredentials() { } protected CustomCredentials(CustomCredentials cc) : base(cc) { } public override System.IdentityModel.Selectors.SecurityTokenManager CreateSecurityTokenManager() { return new CustomSecurityTokenManager(this); } protected override ClientCredentials CloneCore() { return new CustomCredentials(this); } } public class CustomSecurityTokenManager : ClientCredentialsSecurityTokenManager { public CustomSecurityTokenManager(CustomCredentials cred) : base(cred) { } public override System.IdentityModel.Selectors.SecurityTokenSerializer CreateSecurityTokenSerializer(System.IdentityModel.Selectors.SecurityTokenVersion version) { return new CustomTokenSerializer(System.ServiceModel.Security.SecurityVersion.WSSecurity11); } } public class CustomTokenSerializer : WSSecurityTokenSerializer { public CustomTokenSerializer(SecurityVersion sv) : base(sv) { } protected override void WriteTokenCore(System.Xml.XmlWriter writer, System.IdentityModel.Tokens.SecurityToken token) { UserNameSecurityToken userToken = token as UserNameSecurityToken; string tokennamespace = "o"; DateTime created = DateTime.Now; string createdStr = created.ToString("yyyy-MM-ddThh:mm:ss.fffZ"); // unique Nonce value - encode with SHA-1 for 'randomness' // in theory the nonce could just be the GUID by itself string phrase = Guid.NewGuid().ToString(); var nonce = GetSHA1String(phrase); // in this case password is plain text // for digest mode password needs to be encoded as: // PasswordAsDigest = Base64(SHA-1(Nonce + Created + Password)) // and profile needs to change to //string password = GetSHA1String(nonce + createdStr + userToken.Password); string password = userToken.Password; writer.WriteRaw(string.Format( "<{0}:UsernameToken u:Id=\"" + token.Id + "\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">" + "<{0}:Username>" + userToken.UserName + "</{0}:Username>" + "<{0}:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText\">" + password + "</{0}:Password>" + "<{0}:Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">" + nonce + "</{0}:Nonce>" + "<u:Created>" + createdStr + "</u:Created></{0}:UsernameToken>", tokennamespace)); } protected string GetSHA1String(string phrase) { SHA1CryptoServiceProvider sha1Hasher = new SHA1CryptoServiceProvider(); byte[] hashedDataBytes = sha1Hasher.ComputeHash(Encoding.UTF8.GetBytes(phrase)); return Convert.ToBase64String(hashedDataBytes); } } Realistically only the CustomTokenSerializer has any significant code in. The code there deals with actually serializing the custom credentials using low level XML semantics by writing output into an XML writer. I can't take credit for this code - most of the code comes from the MSDN forum post mentioned earlier - I made a few adjustments to simplify the nonce generation and also added some notes to allow for PasswordDigest generation. Per spec the nonce is nothing more than a unique value that's supposed to be 'random'. I'm thinking that this value can be any string that's unique and a GUID on its own probably would have sufficed. Comments on other posts that GUIDs can be potentially guessed are highly exaggerated to say the least IMHO. To satisfy even that aspect though I added the SHA1 encryption and binary decoding to give a more random value that would be impossible to 'guess'. The original example from the forum post used another level of encoding and decoding to string in between - but that really didn't accomplish anything but extra overhead. The header output generated from this looks like this:<s:Header> <o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"> <o:UsernameToken u:Id="uuid-f43d8b0d-0ebb-482e-998d-f544401a3c91-1" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> <o:Username>TheUsername</o:Username> <o:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">ThePassword</o:Password> <o:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" >PjVE24TC6HtdAnsf3U9c5WMsECY=</o:Nonce> <u:Created>2012-11-23T07:10:04.670Z</u:Created> </o:UsernameToken> </o:Security> </s:Header> which is exactly as it should be. Password Digest? In my case the password is passed in plain text over an SSL connection, so there's no digest required so I was done with the code above. Since I don't have a service handy that requires a password digest,  I had no way of testing the code for the digest implementation, but here is how this is likely to work. If you need to pass a digest encoded password things are a little bit trickier. The password type namespace needs to change to: http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#Digest and then the password value needs to be encoded. The format for password digest encoding is this: Base64(SHA-1(Nonce + Created + Password)) and it can be handled in the code above with this code (that's commented in the snippet above): string password = GetSHA1String(nonce + createdStr + userToken.Password); The entire WriteTokenCore method for digest code looks like this:protected override void WriteTokenCore(System.Xml.XmlWriter writer, System.IdentityModel.Tokens.SecurityToken token) { UserNameSecurityToken userToken = token as UserNameSecurityToken; string tokennamespace = "o"; DateTime created = DateTime.Now; string createdStr = created.ToString("yyyy-MM-ddThh:mm:ss.fffZ"); // unique Nonce value - encode with SHA-1 for 'randomness' // in theory the nonce could just be the GUID by itself string phrase = Guid.NewGuid().ToString(); var nonce = GetSHA1String(phrase); string password = GetSHA1String(nonce + createdStr + userToken.Password); writer.WriteRaw(string.Format( "<{0}:UsernameToken u:Id=\"" + token.Id + "\" xmlns:u=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">" + "<{0}:Username>" + userToken.UserName + "</{0}:Username>" + "<{0}:Password Type=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#Digest\">" + password + "</{0}:Password>" + "<{0}:Nonce EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">" + nonce + "</{0}:Nonce>" + "<u:Created>" + createdStr + "</u:Created></{0}:UsernameToken>", tokennamespace)); } I had no service to connect to to try out Digest auth - if you end up needing it and get it to work please drop a comment… How to use the custom Credentials The easiest way to use the custom credentials is to create the client in code. Here's a factory method I use to create an instance of my service client:  public static RealTimeOnlineClient CreateRealTimeOnlineProxy(string url, string username, string password) { if (string.IsNullOrEmpty(url)) url = "https://notrealurl.com:443/cows/services/RealTimeOnline"; CustomBinding binding = new CustomBinding(); var security = TransportSecurityBindingElement.CreateUserNameOverTransportBindingElement(); security.IncludeTimestamp = false; security.DefaultAlgorithmSuite = SecurityAlgorithmSuite.Basic256; security.MessageSecurityVersion = MessageSecurityVersion.WSSecurity10WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10; var encoding = new TextMessageEncodingBindingElement(); encoding.MessageVersion = MessageVersion.Soap11; var transport = new HttpsTransportBindingElement(); transport.MaxReceivedMessageSize = 20000000; // 20 megs binding.Elements.Add(security); binding.Elements.Add(encoding); binding.Elements.Add(transport); RealTimeOnlineClient client = new RealTimeOnlineClient(binding, new EndpointAddress(url)); // to use full client credential with Nonce uncomment this code: // it looks like this might not be required - the service seems to work without it client.ChannelFactory.Endpoint.Behaviors.Remove<System.ServiceModel.Description.ClientCredentials>(); client.ChannelFactory.Endpoint.Behaviors.Add(new CustomCredentials()); client.ClientCredentials.UserName.UserName = username; client.ClientCredentials.UserName.Password = password; return client; } This returns a service client that's ready to call other service methods. The key item in this code is the ChannelFactory endpoint behavior modification that that first removes the original ClientCredentials and then adds the new one. The ClientCredentials property on the client is read only and this is the way it has to be added.   Summary It's a bummer that WCF doesn't suport WSE Security authentication with nonce values out of the box. From reading the comments in posts/articles while I was trying to find a solution, I found that this feature was omitted by design as this protocol is considered unsecure. While I agree that plain text passwords are rarely a good idea even if they go over secured SSL connection as WSE Security does, there are unfortunately quite a few services (mosly Java services I suspect) that use this protocol. I've run into this twice now and trying to find a solution online I can see that this is not an isolated problem - many others seem to have struggled with this. It seems there are about a dozen questions about this on StackOverflow all with varying incomplete answers. Hopefully this post provides a little more coherent content in one place. Again I marvel at WCF and its breadth of support for protocol features it has in a single tool. And even when it can't handle something there are ways to get it working via extensibility. But at the same time I marvel at how freaking difficult it is to arrive at these solutions. I mean there's no way I could have ever figured this out on my own. It takes somebody working on the WCF team or at least being very, very intricately involved in the innards of WCF to figure out the interconnection of the various objects to do this from scratch. Luckily this is an older problem that has been discussed extensively online and I was able to cobble together a solution from the online content. I'm glad it worked out that way, but it feels dirty and incomplete in that there's a whole learning path that was omitted to get here… Man am I glad I'm not dealing with SOAP services much anymore. REST service security - even when using some sort of federation is a piece of cake by comparison :-) I'm sure once standards bodies gets involved we'll be right back in security standard hell…© Rick Strahl, West Wind Technologies, 2005-2012Posted in WCF  Web Services   Tweet !function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs"); (function() { var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/plusone.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s); })();

    Read the article

  • Display System Information on Your Desktop with Desktop Info

    - by Asian Angel
    Do you like to monitor your system but do not want a complicated app to do it with? If you love simplicity and easy configuration then join us as we look at Desktop Info. Desktop Info in Action Desktop Info comes in a zip file format so you will need to unzip the app, place it into an appropriate “Program Files Folder”, and create a shortcut. Do NOT delete the “Read Me File”…this will be extremely useful to you when you make changes to the “Configuration File”. Once you have everything set up you are ready to start Desktop Info up. This is the default layout and set of listings displayed when you start Desktop Info up for the first time. The font colors will be a mix of colors as seen here and the font size will perhaps be a bit small but those are very easy to change if desired. You can access the “Context Menu” directly over the “information area”…so no need to look for it in the “System Tray”. Notice that you can easily access that important “Read Me File” from here… The full contents of the configuration file (.ini file) are displayed here so that you can see exactly what kind of information can be displayed using the default listings. The first section is “Options”…you will most likely want to increase the font size while you are here. Then “Items”… If you are unhappy with any of the font colors in the “information area” this is where you can make the changes. You can turn information display items on or off here. And finally “Files, Registry, & Event Logs”. Here is our displayed information after a few tweaks in the configuration file. Very nice. Conclusion If you have been looking for a system information app that is simple and easy to set up then you should definitely give Desktop Info a try. Links Download Desktop Info Similar Articles Productive Geek Tips Ask the Readers: What are Your Computer’s Hardware Specs?Allow Remote Control To Your Desktop On UbuntuHow To Get Detailed Information About Your PCGet CPU / System Load Average on Ubuntu LinuxEnable Remote Desktop (VNC) on Kubuntu TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Test Drive Windows 7 Online Download Wallpapers From National Geographic Site Spyware Blaster v4.3 Yes, it’s Patch Tuesday Generate Stunning Tag Clouds With Tagxedo Install, Remove and HIDE Fonts in Windows 7

    Read the article

  • Accessing JMX for Oracle WebLogic 11g

    - by Anthony Shorten
    In Oracle Utilities Application Framework V4, we use the latest Oracle WebLogic release (11g). The instructions below illustrate a way of allowing a console like jconsole to remotely monitor and manage Oracle WebLogic using the JMX Mbeans. Typically management of Oracle WebLogic is done from Oracle Enterprise Manager or the Oracle Weblogic console application but you can also use JMX. To access the JMX capability for Oracle WebLogic 11g, for an Oracle Utilities Application Framework based product, using a JMX console (such as jconsole) the following process needs to be performed: Enable the JMX Management Server in the Oracle WebLogic console at splapp - Configuration - General - Advanced Settings option. Enable both Compatibility Mbean Server Enabled and Management EJB Enabled (this enables the legacy and new JMX interface). Save the changes This change will require a restart. In the startup of the Oracle WebLogic server in the $SPLSYSTEMLOGS/myserver.log (or %SPLESYSTEMLOGS%\myserver.log on Windows) you will see the BEA-149512 message indicating the Mbean servers have been started. The message will indicate the JMX URL that can be used to access the JMX Mbeans. The URL is in the format: service:jmx:iiop://host:port/jndi/mbeanserver where: host - Oracle WebLogic host name port - Oracle WebLogic port number mbeanserver - Mbean Server to access. Valid Values: weblogic.management.mbeanservers.runtime weblogic.management.mbeanservers.edit weblogic.management.mbeanservers.domainruntime For illustrative purposes we will use the domainruntime Mbean. Ensure that you execute the splenviron[.sh] utility to set the appropriate environment variables for the desired environment. Execute the following jconsole command to initiate the connection to the JMX Mbean server Windows: jconsole -J-Djava.class.path=%JAVA_HOME%\lib\jconsole.jar;%WL_HOME%\server\lib\wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote Linux/Unix jconsole -J-Djava.class.path=$JAVA_HOME/lib/jconsole.jar;$WL_HOME/server/lib/wljmxclient.jar -J-Djmx.remote.protocol.provider.pkgs=weblogic.management.remote You will see a New Connection Dialog. Specify the URL from the previous steps into the Remote process (i.,e. service:jmx:iiop...). The credentials are the credentials specified for the Oracle WebLogic console. You are now able to view the JMX classes available. Here is an example from my demonstration machine: Refer to the Oracle WebLogic Mbean documentation to understand the output.

    Read the article

  • Make Windows Position Your Dual Monitors Correctly

    - by Mysticgeek
    If you have a dual monitor setup and each monitor is a different size or height, it can be annoying trying to move the mouse pointer between them. Here is a quick tip that will help make the process easier. Align Monitors In our example, we’re using Windows 7, but the process is essentially the same in all versions, but getting to Display Settings is different. In Windows 7 open the Start menu and type display settings into the search box and hit Enter. In Vista right-click the desktop and click Personalize. Then from the Personalize appearance and sounds menu click on Display Settings. In XP right-click on the desktop and select Properties then in Display Properties click the Settings tab. Now here is where you can change the appearance of your monitors. In this example we have a larger 22” LCD and a smaller 19” and it can be annoying getting the mouse pointer from one to another depending where you are on each monitor. So what you want to do is simply move each display around to a particular height so it’s easier to get the pointer over. For example with this setting we know we’ll have no problem moving the pointer to the other screen at the top of each display.   Of course here you can flip your monitors around, change the display resolution, orientation, etc. If you have dual monitors where one might be larger or set up higher than the other, then this is a great way to get them finely tuned. You will have to play around with the settings a bit to settle on what works best for you. Similar Articles Productive Geek Tips GeekNewb: Get to Know These Windows 7 HotkeysDual Monitors: Use a Different Wallpaper on Each DesktopSet Windows as Default OS when Dual Booting UbuntuEasily Set Default OS in a Windows 7 / Vista and XP Dual-boot SetupSet XP as the Default OS in a Windows Vista Dual-Boot Setup TouchFreeze Alternative in AutoHotkey The Icy Undertow Desktop Windows Home Server – Backup to LAN The Clear & Clean Desktop Use This Bookmarklet to Easily Get Albums Use AutoHotkey to Assign a Hotkey to a Specific Window Latest Software Reviews Tinyhacker Random Tips DVDFab 6 Revo Uninstaller Pro Registry Mechanic 9 for Windows PC Tools Internet Security Suite 2010 Download Wallpapers From National Geographic Site Spyware Blaster v4.3 Yes, it’s Patch Tuesday Generate Stunning Tag Clouds With Tagxedo Install, Remove and HIDE Fonts in Windows 7 Need Help with Your Home Network?

    Read the article

  • VSDB to SSDT part 4 : Redistributable database deployment package with SqlPackage.exe

    - by Etienne Giust
    The goal here is to use SSDT SqlPackage to deploy the output of a Visual Studio 2012 Database project… a bit in the same fashion that was detailed here : http://geekswithblogs.net/80n/archive/2012/09/12/vsdb-to-ssdt-part-3--command-line-deployment-with-sqlpackage.exe.aspx   The difference is we want to do it on an environment where Visual Studio 2012 and SSDT are not installed. This might be the case of your Production server.   Package structure So, to get started you need to create a folder named “DeploymentSSDTRedistributable”. This folder will have the following structure :         The dacpac and dll files are the outputs of your Visual Studio 2012 Database project. If your database project references another database project, you need to put their dacpac and dll here too, otherwise deployment will not work. The publish.xml file is the publish configuration suitable for your target environment. It holds connexion strings, SQLVARS parameters and deployment options. Review it carefully. The SqlDacRuntime folder (an arbitrary chosen name) will hold the SqlPackage executable and supporting libraries   Contents of the SqlDacRuntime folder Here is what you need to put in the SqlDacRuntime folder  :      You will be able to find these files in the following locations, on a machine with Visual Studio 2012 Ultimate installed : C:\Program Files (x86)\Microsoft SQL Server\110\DAC\bin : SqlPackage.exe Microsoft.Data.Tools.Schema.Sql.dll  Microsoft.Data.Tools.Utilities.dll Microsoft.SqlServer.Dac.dll C:\Windows\Microsoft.NET\assembly\GAC_MSIL\Microsoft.SqlServer.TransactSql.ScriptDom\v4.0_11.0.0.0__89845dcd8080cc91 Microsoft.SqlServer.TransactSql.ScriptDom.dll   Deploying   Now take your DeploymentSSDTRedistributable deployment package to your remote machine. In a standard command window, place yourself inside the DeploymentSSDTRedistributable  folder.   You can first perform a check of what will be updated in the target database. The DeployReport task of SqlPackage.exe will help you do that. The following command will output an xml of the changes:   "SqlDacRuntime/SqlPackage.exe" /Action:DeployReport /SourceFile:./Our.Database.dacpac /Profile:./Release.publish.xml /OutputPath:./ChangesToDeploy.xml      You might get some warnings on Log and Data file like I did. You can ignore them. Also, the tool is warning about data loss when removing a column from a table. By default, the publish.xml options will prevent you from deploying when data loss is occuring (see the BlockOnPossibleDataLoss inside the publish.xml file). Before actual deployment, take time to carefully review the changes to be applied in the ChangesToDeploy.xml file.    When you are satisfied, you can deploy your changes with the following command : "SqlDacRuntime/SqlPackage.exe" /Action:Publish /SourceFile:./Our.Database.dacpac /Profile:./Release.publish.xml   Et voilà !  Your dacpac file has been deployed to your database. I’ve been testing this on a SQL 2008 Server (not R2) but it should work on 2005, 2008 R2 and 2012 as well.   Many thanks to Anuj Chaudhary for his article on the subject : http://www.anujchaudhary.com/2012/08/sqlpackageexe-automating-ssdt-deployment.html

    Read the article

  • Monogame/SharpDX - Shader parameters missing

    - by Layoric
    I am currently working on a simple game that I am building in Windows 8 using MonoGame (develop3d). I am using some shader code from a tutorial (made by Charles Humphrey) and having an issue populating a 'texture' parameter as it appears to be missing. Edit I have also tried 'Texture2D' and using it with a register(t0), still no luck I'm not well versed writing shaders, so this might be caused by a more obvious problem. I have debugged through MonoGame's Content processor to see how this shader is being parsed, all the non 'texture' parameters are there and look to be loading correctly. Edit This seems to go back to D3D compiler. Shader code below: #include "PPVertexShader.fxh" float2 lightScreenPosition; float4x4 matVP; float2 halfPixel; float SunSize; texture flare; sampler2D Scene: register(s0){ AddressU = Clamp; AddressV = Clamp; }; sampler Flare = sampler_state { Texture = (flare); AddressU = CLAMP; AddressV = CLAMP; }; float4 LightSourceMaskPS(float2 texCoord : TEXCOORD0 ) : COLOR0 { texCoord -= halfPixel; // Get the scene float4 col = 0; // Find the suns position in the world and map it to the screen space. float2 coord; float size = SunSize / 1; float2 center = lightScreenPosition; coord = .5 - (texCoord - center) / size * .5; col += (pow(tex2D(Flare,coord),2) * 1) * 2; return col * tex2D(Scene,texCoord); } technique LightSourceMask { pass p0 { VertexShader = compile vs_4_0 VertexShaderFunction(); PixelShader = compile ps_4_0 LightSourceMaskPS(); } } I've removed default values as they are currently not support in MonoGame and also changed ps and vs to v4 instead of 2. Could this be causing the issue? As I debug through 'DXConstantBufferData' constructor (from within the MonoGameContentProcessing project) I find that the 'flare' parameter does not exist. All others seem to be getting created fine. Any help would be appreciated. Update 1 I have discovered that SharpDX D3D compiler is what seems to be ignoring this parameter (perhaps by design?). The ConstantBufferDescription.VariableCount seems to be not counting the texture variable. Update 2 SharpDX function 'GetConstantBuffer(int index)' returns the parameters (minus textures) which is making is impossible to set values to these variables within the shader. Any one know if this is normal for DX11 / Shader Model 4.0? Or am I missing something else?

    Read the article

< Previous Page | 18 19 20 21 22 23 24 25 26 27 28 29  | Next Page >