.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

WCF returns private members of the object instead of returning the Public members

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :WCF
 

Hi

I am  using WCF to return a serialized custom object to a web page which access the WCF using a script manager. The problem here is the object returned all the private members instead of the public members although the private members are marked private.

The flow behind this: the asp.net  web site stores the object in SQL State session; all the classes in the object are marked serialized as it is stored in SQL State Session. All the public properties in the classes are marked as <DataMember>. When trying to access this object from the client it lists down all the private members of the class instead of listing the public members.

Please advice!

Many Thanks

Siva

 

 




View Complete Post


More Related Resource Links

Public object members

  

I'm busy writing a webservice. One of the tasks is to able a client over the internet to add a record. This records exists of about 50 databasefields. My best guess is this:

- Create a public class with each field as public  string or integer of that class.

- Client dims at his side a variable as new class:

Dim myObj as new MyObjec.MyClass

- he sets al parameters

- He calls webservice.AddRecord(myObj)

- The webservice passes myObj to another project which is my data layer

- The datalayer creates the query and adds the record.

The problem here is to make one class which is available in all projects: client project, webservice project, data layer project. My best guess (as I did it in vb6) is to create a seperate project containing the class. Add a referense from my webservice project en datalayser project to this seperate project. The problem is that the client can't set a reference, so it doesn't know what the class looks like.

I hope this makes sence to you all.

It is not possible to use one project for both the webservice and the data layer. The data layer wil be com-exposed as I need to be able to use it from classic asp.

Please advice me which way to look.

Kind Regards!

 

 


Why didn't ASP.NET doesn't persist private members values between page request ?

  

I understand that asp.net recreate a new instance of page object at each request. But by doing so the private members are reinitialized each time. Since ASP.NET invented viewstate for control properties why didn't it create same kind of mechanism for private members which are very similar semantically to control properties ?



"Object contains only the public half of a key pair. A private key must also be provided." with 2 .p

  

Here's the code:

using ADPTest.com.adp.hrbws;
using System.Security.Cryptography.X509Certificates;
using Microsoft.Web.Services3.Security;
using Microsoft.Web.Services3.Security.Tokens;
using Microsoft.Web.Services3.Security.Cryptography;

namespace ADPTest
{
    class Program
    {
        static void Main(string[] args)
        {
            // Create the web service proxy.
            HrbService proxy = new HrbService();

            // Add the Username token.
            UsernameToken usernameToken = new UsernameToken("user@ABC"," ");
            proxy.RequestSoapContext.Security.Tokens.Add(usernameToken);

            // Add the certificate for mutual SSL.
            X509Certificate2 mutualCert = new X509Certificate2 "I:\\auth.pem", "

The number of members in the conceptual type ... does not match with the number of members on the ob

  

 Hello,

I've added a scalar property to an entity and now ASP.NET Dynamic Data scaffolding throws this error:

The number of members in the conceptual type 'TrainingModel.Users' does not match with the number of members on the object side type 'TrainingModel.Users'. Make sure the number of members are the same.

This happens at the following line in global.asax:
model.RegisterContext(typeof(TrainingModel.TrainingEntities), new ContextConfiguration() { ScaffoldAllTables = true });

Please help!
Thanks


How do I get the emails of all the members of a given group in ActiveDirectory - Need help

  

Hi,

  I have a need to send out emails to all the people who are in a given group say "HR Department". I need to be able to get all the emails through a for loop and then as it retrieves I should send emails to them. Can some one please help me with the code

this is what I came up with but not sure how to go about writing a for loop to get all the emails in the given group.

public static string SendEmails(string loginName)
    {
        string Department = "HR Department"
        string userName = ExtractUserName(loginName);
        DirectorySearcher search = new DirectorySearcher();
        search.Filter = String.Format("(SAMAccountName={0})", userName);
        //search.Filter = String.Format("(SAMAccountName={FAY ImprovmentForm})", userName);
        //LdapSearcher.Filter = string.Format("(&(objectClass=user)(department={0}))", Department); 
        //search.Filter = string.Format("(&(objectClass=group)(SAMAccountName=" + Department + "))", userName);
        search.PropertiesToLoad.Add("cn");
        search.PropertiesToLoad.Add("samaccountname");
        search.PropertiesToLoad.Add("givenname");
        search.PropertiesToLoad.Add("sn");
        sea

public object on asp,net page

  

in asp.net can i make public objects on my page, for example

public Customer cust1 = new customer();

and use this object on my entire code???


what are the drawbacks of creating public objects??

a single object will be created for all users??? or each user will have a different object????


overriding "grand totals" for calculated members

  
hi all, is there a workaround for overriding "grand totals" for calculated members?  (I cannot use the workaround whereby I create the calculation in the DSV or view directly due to it being a pretty complex Descendant parent/child calculation).   thanks much for any thoughts, Cos

MDX to read members from "restricted access" role

  
Is it possible to read list of members from "restricted access" roles? I want an MDX so we can create an exception report for maintance purposes to match this list with some other list. I only need to list what I see when I open "resticted access" role - domains with user names. thank you!

Aggregate only filtered members

  
I’m creating a measure in a cube as lookup from another cube: CREATE MEMBER CURRENTCUBE.[MEASURES].[Test]  AS     lookupcube("[Cube1]",     "([Measures].[PublicPrice],     [Cube1 DimDate].[TIME Hierarchy].[" + [Cube2 DimDate].[TIME Hierarchy].currentmember.name + "]     )")     If I select in filter only January 2010 and February 2010 in Cube1, for Quarter 1  I obtain 100; in Cube2  I obtain 150. Even if March 2010 is not selected in Cube2 the aggregation level (the Quarter) considers it. Could someone help me? Thank you very much, Giada

No results for users that are members of a 'Deny All' policy for web application

  
I have a SharePoint Farm with search working happily.  This farm also has a remote access component that I have configured on a separate extended web application.  The business has some accounts that it does not want to allow access to the Intranet remotely, and has added these accounts to a 'Non Remote Intranet Users' security group.  I then set up a rule on the Extranet zone to Deny All access for this group.  The Default zone still allows them to browse however, which is working great. The only problem is that members of this group do not get any search results whatsoever.  From the logs it appears that all results get security trimmed.  :( Can I disable security trimming somehow?  Is this a bug?  Any suggestions would be appreciated.  :)

SSAS - How to get other members from dimension that has Parent Child hierarchy?

  
I have a Sales Territory dimension that has employee and parent employee attribute on which parent child hierarchy is defined and it gives below hierarchy while browsing - - Mark Rolls --- Lumin Jacs ----- Larry Gomes ------- Messica Owens ------- Tom Ted ----------- Jackson Lopez ----- Matthew Ron --- Fred jacob - Jason Ron --- Jecy Pedro   But beside this parent-child hierarchy I have other attributes like employee address, email and telephone. My facts related sales transaction is tagged to lowest level. For example here facts are available only for Jackson Lopez (being Field Executive). When use below query I get complete sales reporting hierarchy result with some measures like sales amount, sales volume. But while accesing other attributes like address or email, it's repeating address/email/telephone of jackson Lopes everywhere to whom fact record is linked, Actually I want address/email/telephone of each sales employee from that dimension within hierarchy. How do I get it? The query I used is: Here Parent Terr ID is parent child hierachy. SELECT ( Descendants( { [Dim SalesRegion].[Parent Terr ID].[Employee Level 01].&[538018] /* here Mark Rolls is 538018 */ }, 0,AFTER), NONEMPTY([Dim SalesRegion].[Emp Address].[Emp Address].Members), NONEMPTY([Dim SalesRegion].[Emp Email].[Emp Email].Members) ) ON ROWS , { ([Dim Date].[The Year].[The Year].[CY-2010], [Dim

Long list of calculated members

  
·         I have a long list of calculated members. How can I make this long list user friendly like categorizing them by functionality? Can I create measure group for calculated measures?   Alex  

Parent child hierarchy & MDX to fetch particular level & all members below it along with measures us

  
I have a Sales Territory dimension that has employee and parent employee attribute on which parent child hierarchy is defined and it gives below hierarchy while browsing - - Mark Rolls --- Lumin Jacs ----- Larry Gomes ------- Messica Owens ------- Tom Ted ----------- Jackson Lopez ----- Matthew Ron --- Fred jacob - Jason Ron --- Jecy Pedro   But beside this parent-child hierarchy I have other attributes like employee address, email and telephone. My facts related sales transaction is tagged to lowest level. For example here facts are available only for Jackson Lopez (being Field Executive). When use below query I get complete sales reporting hierarchy result with some measures like sales amount, sales volume. But while accesing other attributes like address or email, it's repeating address/email/telephone of jackson Lopes everywhere to whom fact record is linked, Actually I want address/email/telephone of each sales employee from that dimension within hierarchy. How do I get it? The query I used is: Here Parent Terr ID is parent child hierachy. SELECT ( Descendants( { [Dim SalesRegion].[Parent Terr ID].[Employee Level 01].&[538018] /* here Mark Rolls is 538018 */ }, 0,AFTER), NONEMPTY([Dim SalesRegion].[Emp Address].[Emp Address].Members), NONEMPTY([Dim SalesRegion].[Emp Email].[Emp Email].Members) ) ON ROWS , { ([Dim Date].[The Year].[The Year].[CY-2010], [Dim

MDX query performance is slow for complex logic implementation in Calculated Members.

  
We have implemented a calculated members which involves multiple calculated members  called in a nested e.q. Cal1 calls Cal2 and Cal2 calls  Cal3  and Cal3 calls Cal4 .  And when browing Cal1 through Excel it takes around 30 mins for getting result from a Partition having row count around 5 million. Follwing are the information on the scenario I am having: We are having partitioning in the cube. one partition contains around 4-6 million records Processers on Query Server: 4 quad core RAM on the Query Server: 64 GB Calculated members having simple calculation logics are giving results in no time. There is a Calculated members which calls 6 intermediate calculated in nested way and with small Data Set like 5-6 k rows it is running fine.   Any help will be much appreciated.   Regards, Sandeep

Cannot Access Certain Members of a Non-Null SPUser

  
When logged in with certain users and we try to access SPUser.Groups or SPUser.OwnerGroups we are getting an error that redirects us to our custom error page. The odd part is that the SPUser object is not null and even when surrounding these offending statements in try/catch blocks we still receive the error redirect. Here is a code snippet showing one of the member accesses that is causing the error redirect:   SPUser _user =SPControl.GetContextWeb(this.Context).CurrentUser; if (_user == null) { _user = SPContext.Current.Web.EnsureUser("Sharepoint/System"); } if(_user != null) { if(_user.Groups != null) { foreach (SPGroup _userGroup in _user.Groups) { _HiddenDiv.Text += _userGroup.Name.ToString() + ", " ; } } This along with any access of Groups or OwnerGroups will cause a redirect to our custom error page. However, as mentioned above, this is only affecting about half of our user population -- the other half is able to login and have their groups examined properly. As always, please let me know if you have any questions or need some further information. Any help with this is greatly appreciated as I'm not sure I have too many hairs left to pull out of my head ;) -Tim
Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend