[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Change object properties from get to get ; set

Posted on 2012-08-16
Medium Priority
Last Modified: 2012-08-20
How do I change a property of an object from get only to get; set . Below is the sample code, I wish to change "clientcredentials" to be {get ; set } . Never quite picked up on this concept in powershell101.

$proxy |gm
     TypeName: ReservationInvoiceServiceClient

    Name                    MemberType Definition                                                                                                                                                   
    ----                    ---------- ----------                                                                                                                                                   
    Abort                   Method     System.Void Abort()                                                                                                                                         
    BeginClose              Method     System.IAsyncResult BeginClose(System.AsyncCallback callback, System.Object state), System.IAsyncResult BeginClose(System.TimeSpan timeout, System.AsyncCa...
    BeginOpen               Method     System.IAsyncResult BeginOpen(System.AsyncCallback callback, System.Object state), System.IAsyncResult BeginOpen(System.TimeSpan timeout, System.AsyncCall...
    Close                   Method     System.Void Close(), System.Void Close(System.TimeSpan timeout)                                                                                             
    DisplayInitializationUI Method     System.Void DisplayInitializationUI()                                                                                                                       
    Dispose                 Method     System.Void Dispose()                                                                                                                                       
    EndClose                Method     System.Void EndClose(System.IAsyncResult result)                                                                                                             
    EndOpen                 Method     System.Void EndOpen(System.IAsyncResult result)                                                                                                             
    Equals                  Method     bool Equals(System.Object obj)                                                                                                                               
    GetHashCode             Method     int GetHashCode()                                                                                                                                           
    GetReservation          Method    Company.Product.IWeb.ReservationResponse, 0ofr1eqk, Version=, Culture=neutral, PublicKeyToken=null GetReservation(Companys.Product.IWeb.Reservatio...
    GetType                 Method     type GetType()                                                                                                                                               
    Open                    Method     System.Void Open(), System.Void Open(System.TimeSpan timeout)                                                                                               
    ToString                Method     string ToString()                                                                                                                                           
    ChannelFactory          Property   System.ServiceModel.ChannelFactory`1[[IReservationInvoiceService, 0ofr1eqk, Version=, Culture=neutral, PublicKeyToken=null]] ChannelFactory {get;}   
    ClientCredentials       Property   System.ServiceModel.Description.ClientCredentials ClientCredentials {get;}                                                                                   
    Endpoint                Property   System.ServiceModel.Description.ServiceEndpoint Endpoint {get;}                                                                                             
    InnerChannel            Property   System.ServiceModel.IClientChannel InnerChannel {get;}                                                                                                       
    State                   Property   System.ServiceModel.CommunicationState State {get;}     

Open in new window

Question by:davesnb
  • 2

Expert Comment

ID: 38301856
Is this a custom object your creating / coding?

Author Comment

ID: 38302280
It is a web service , but I was told i could connect via

WebServiceClient.ClientCredentials.UserName.UserName = "username";
WebServiceClient.ClientCredentials.UserName.Password = "password";

When i run proxy.open it will attempt to pass the credentials, so appears the credential property needs to be get; set.

So really two part question, with the goal of connecting to this webservice using the wcf web proxy functions i found on posh code.

Accepted Solution

rwskas earned 1500 total points
ID: 38311286
If its not a object you're creating, but rather one your loading, then you cannot change the get to a get;set. Thats defined at the object level.

If you can provide some more context to the script your trying to pass these credentials to,
I am sure we can get this sorted out for you.

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
Measuring Server's processing rate with a simple powershell command. The differences in processing rate also was recorded in different use-cases, when a server in free and busy states.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question