Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
M

Mehdi Mousavi

@Mehdi Mousavi
About
Posts
46
Topics
22
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • the end
    M Mehdi Mousavi

    Well, sometimes you win, sometimes you learn! Take a look to this amazing book written by "Spencer Johnson", called "Who Moved My Cheese? An Amazing Way to Deal with Change in Your Work and in Your Life". I'm sure it'll give you the strength to deal with this new change in your life.

    Mehdi Mousavi - Software Architect [ http://www.mehdi.biz/blog/ ]

    The Lounge

  • Web Service Proxy Problem!
    M Mehdi Mousavi

    I think you missed the part that I said: "I've also altered the reference.cs file (the proxy file generated for the web service automatically) so that it will use my business_objects.dll to handle objects, the file that hosts the MyEntity class." This means that those classes you've mentioned do not exist any more. It now uses my business_objects.dll on the client (and server)... So what? What am I supposed to do to handle the Serializing/Deserializing the objects as needed? TIA, Mehdi

    C# help business json tutorial question

  • Web Service Proxy Problem!
    M Mehdi Mousavi

    Hi folks, Consider a MyEntity class that's being marked as SerializableAttribute. The object is exposed to the outer world through the following web method: [WebMethod()] [SoapHeader("Credentials")] [SoapDocumentMethod(Use=SoapBindingUse.Encoded)] public MyEntity GetMyEntity() { //get the entity and return the object. } Well, I've to mark the web method with SoapDocumentMethodAttribute, or else, the XMLSerializer doesn't have any idea of how to serialize/deserialize the object. I've also altered the reference.cs file (the proxy file generated for the web service automatically) so that it will uses my business_objects.dll to handle objects, the file that hosts the MyEntity class. The problem is that whenever the GetMyEntity() function is called, the service proxy tries to construct the object using the properties exposed on MyEntity class, using the default constructor of the class. How am I supposed to instruct the proxy to use the class constructors to get the job done? How am I supposed to control the serialization/deserialization process of the entities? Please keep in mind that the MyEntity class uses circular references, and therefore, the XMLSerilizer or Literal encoding *cannot be used* to handle the issue. Any help would be highly appreciated, TIA, Mehdi

    C# help business json tutorial question

  • WSI Basic Profile 1.1 Compliant Web Service! (circular references)
    M Mehdi Mousavi

    Hi folks, I've been lately trying to expose an object graph (with circular references) through a web method, however, this was not possible since the XmlSerializer has got no idea how to address the issue. Therefore, I've just changed the WebServiceBindingAttribute from [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] to [WebServiceBinding(ConformsTo = WsiProfiles.None)] and added the SoapDocumentMethodAttribute to the web methods as follows and the problem is solved. [SoapDocumentMethod(Use=SoapBindingUse.Encoded)] The questions: 1. I would like to know this means that I only and only lose the interoperability? Is this what happens??? 2. Is there anyway to solve the circular referencing problem within the object graph when exposing objects through web methods under the WSI Basic Profile 1.1 standard? 3. Consider a class (MyEntity) that has got some properties, say Prop1, Prop2 and Prop3 all of boolean type. On the service side, consider this: MyEntity entity = new MyEntity(); entity.Prop1 = false; entity.Prop2 = false; entity.Prop3 = false; return entity; When the entity is marshaled to the client, the Prop2 is true, while it's being set to false!!!! What the heck is going wrong with this? What happens when the type is serialized/deserialized??? TIA, Mehdi

    ASP.NET help data-structures tutorial question

  • Microsoft SharePoint Services
    M Mehdi Mousavi

    Hi folks, Would someone please describe me what the heck the "MS SharePoint Services" is and what it does? Is it a replacement for "Visual SourceSafe"? On the other hand, what does the "Visual Studio Team Suite" needs to share sources over a LAN between team members? Is there any built-in feature or it just needs one of those source sharing programs to get the job done? Any help would be highly appreciated, Cheers, Mehdi

    IT & Infrastructure csharp sharepoint visual-studio collaboration help

  • Open Source Licenses
    M Mehdi Mousavi

    Wow! So being "Open Source" doesn't simply mean "we can download the code, change it, and make a commercial program based on the modified code"??? Is there any "open source" license that gives us such a right? TIA,

    Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    The Lounge question

  • How old did you start programming?
    M Mehdi Mousavi

    Coooooool thread :) 1. Started coding at 15. 2. Commodore +4, Commodore 64, and Commodore 128. 3. Basic, GWBasic, QBasic, Pascal, C, C++, etc ... 4. My first PC was an Intel 386/33MHz/1MB RAM (4 x 256) with a co-processor (added later).

    Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    The Lounge question

  • Membership/role providers vs. transaction!
    M Mehdi Mousavi

    Ooops! You simply didn't get my point. :( I didn't ask you how to develop a "secure web service"! I was just talking about ASP.NET Membership/Role providers and how to get the job done under a given transaction. It has got nothing to do with SOAP headers, nor the IIS A&A mechanisms. Anyway, thanks.

    C# database question visual-studio business json

  • Membership/role providers vs. transaction!
    M Mehdi Mousavi

    Hi folks, I got a general question that I cannot find the answer for. Consider a 3-tier application architecture with a Web Service handling the business layer (BL) logic. The BL provides the client the facility to create/update/delete or query any given Employee account within the system. Each employee has got a username/password pair that's supposed to be stored in the *aspnetdb* database using the Membership API. The question is that how a client is supposed to create an employee account with one web method, and create a new user name with another web method, *transactionally* under a *stateless* web service??? [WebMethod] void CreateEmployee(Employee employee) { } [WebMethod] void CreateUser(string username, string password) {} How am I supposed to keep the integrity of the system? Maybe, you suggest the following WebMethod instead of those two: void CreateEmployee(Employee employee, string username, string password) {} However, this introduces a new bunch of problems under the UpdateEmployee/DeleteEmployee and the like methods. What should be done to handle the issue rationally? Thank you for your time, Mehdi

    C# database question visual-studio business json

  • Hasta Mañana
    M Mehdi Mousavi

    Well, what do you mean by WHY? Are they too out-dated? :doh:

    Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    The Lounge question

  • Hasta Mañana
    M Mehdi Mousavi

    Hi folks, Would you please let me know what does "Hasta Mañana" mean? It's being used in the "Viva Forever" lyrics from the Spice Girls. TIA,

    Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    The Lounge question

  • Passing an [in] parameter to an asp.net web service
    M Mehdi Mousavi

    Is there any keyword and/or pragma (like the one used in IDL (C++)) to force the compiler to put some code in the generated class? something like: #include_this_in_generated_code "public void WhateverMethod() {}" This way, I could alter the proxy code on service-side. Thanks, Mehdi

    C# question csharp asp-net hardware json

  • Passing an [in] parameter to an asp.net web service
    M Mehdi Mousavi

    Hi, Consider a class that I need to serialize and send over the wire. On the receiving end, the serialization bytes have to be re-constructed to form the object. The mentioned class has got some member variables and one or more constructors. [WebMethod()] public void Test(MyClass c) {} The question is that is there anyway to control the proxy-generation for the MyClass class? i.e, how am I supposed to force the proxy-generator to generate the constuctors? Or should I add the required constructors on the client side using the partial keyword? What's the best thing to do when you want to pass a one-way informative parameter (ie., no functionality embedded except for the constructors) to a web method? I would like the client side to create the object normally as follows: MyWebService.MyClass c = new MyWebService.MyClass(param1, param2); MyWebService.Test(c); Is there anyway to achieve such functionality? TIA, Mehdi

    C# question csharp asp-net hardware json

  • Strange Behavior
    M Mehdi Mousavi

    Hi folks, I've create a UserControl that could return a property of type AddressCollection - a collection of Address classes (derived from CollectionBase). I've also created an AddressTypeConverter that's being derived from TypeConverter as well as an AddressCollectionEditor that's being derived from CollectionEditor as follows: ////////////////////////////////////////AddressCollectionEditor public class AddressCollectionEditor : CollectionEditor { public AddressCollectionEditor(Type type) : base(type){} protected override bool CanSelectMultipleInstances(){return false;} protected override Type CreateCollectionItemType(){return typeof(Address);} } ////////////////////////////////////////AddressTypeConverter [Serializable] public class AddressTypeConverter : TypeConverter { public override bool CanConvertTo(ITypeDescriptorContext context, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) return true; return base.CanConvertTo(context, destinationType); } public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destinationType) { if (destinationType == typeof(InstanceDescriptor)) { Address addr = value as Address; if (addr == null) return new InstanceDescriptor(typeof(Address).GetConstructor(System.Type.EmptyTypes), null); return new InstanceDescriptor(typeof(Address).GetConstructor(new Type[] { typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string), typeof(string) }), new string[] { addr.Type, addr.Street1, addr.Street2, addr.City, addr.StateProvince, addr.ZipPostalCode, addr.CountryRegion }); } return base.ConvertTo(context, culture, value, destinationType); } } ////////////////////////////////////////AddressCtrl public partial class AddressCtrl : UserControl { //removed for clarity.... [Category("Misc"), Description("Get a collection of addresses.")] [Editor(typeof(AddressCollectionEditor), typeof(UITypeEditor))] [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] public AddressCollection Addresses { get { return m_coll; } } } /////////////////////

    C#

  • Removing a simple pattern from a string!
    M Mehdi Mousavi

    i folks, Consider the following JavaScript function: function removeParam(str, name) { var rgx = new RegExp('(' + name + '=\\w*)|(' + name + '=\\w*;)'); rgx.global = true; rgx.ignoreCase = true; var matches = rgx.exec(str); if(matches == null) return str; var i; for(i = 0; i < matches.length; i++) str = str.replace(matches[i], ''); return str; } and the following call: var cookie = 'vid=39; vid=38; ASPNETSESSION=WHATEVER; vid=39'; alert(removeParam(cookie, 'vid')); I actually would like to remove "vid=(whatever number)" from the above string, so that it results in the following string: ASPNETSESSION=WHATEVER would someone please helps me to fix the problem? I've got no idea what's wrong with the above pattern I've written. Thank you for your time. Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    Web Development help javascript regex question

  • Configuration(s)
    M Mehdi Mousavi

    Sorry, here's the configuration section in question: html.]]> Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    C# help csharp html asp-net question

  • Configuration(s)
    M Mehdi Mousavi

    Hi, I've just developed a new ConfigurationSection that is supposed to handle the following configuration: html.]]> However, an exception is thrown and the following message is indicated: The configuration section cannot contain a CDATA or text element. How am I supposed to solve this problem? Configurations: - ASP.NET 2.0 - VS2005 Any help would be highly appreciated, Cheers, Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    C# help csharp html asp-net question

  • ASP.NET Web Services Security
    M Mehdi Mousavi

    Ouch! :~ I just thought that you're teasing me by the "1 line of code equals many bugs. So don't write any!!" phrase. I didn't pay attention that it was your signature! I absolutely thought that it was directed at me, and that's why I said that "different people are likely to view the matter differently...". Anyhow, sorry for misunderstanding. Let me be straight. Consider an asp.net web service that's being executed on SSL/TSL layer and is supposed to be secured by implementing security using the FormsAuthentication method from the ground up. Do you call this a secure web service against the STRIDE model? Thank you for your time. Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    ASP.NET csharp asp-net wcf security tutorial

  • ASP.NET Web Services Security
    M Mehdi Mousavi

    Different people are likely to view the matter differently and it would be surprising if all should come to the same conclusion! Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    ASP.NET csharp asp-net wcf security tutorial

  • ASP.NET Web Services Security
    M Mehdi Mousavi

    Hi folks, I've read more than 14 articles on the net about the "security of web services" and how to make a web service secure. I also tried WSE3.0, FormsAuthentication and more, but they all doesn't seem to be the perfect solution. Any idea would be highly appreciated, Cheers, Mehdi Mousavi - Software Architect [ http://mehdi.biz ]

    ASP.NET csharp asp-net wcf security tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups