Question: I am trying to updateList items into a sharepoint list from the xml document stored in my shared drive in remote server. To make that work i wrote down a Powershell Script that utilizes Sharepoint Webservices Api Updatelistitems function to perform the acitivity.

I ran the script over in Dev environment it works, Then i went into QA that Works too. At last i am now in PROD and agains ran the script i am now receicing following error:

```
New-WebServiceProxy : The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel

```

All of my servers dev, QA and PROD web apps are encrypted by Https 443 using Cerified root certificate. Powershell script i am running are mirror copy. System accoutn i am using has owner privileages to sharepoint site and its list.

Am i missing something here, what is blocking this traffic i have no clue.

Thank You

Answer: 
When you add the new view, you have the possibility of marking it as default view:

```
public SPView Add(
    string strViewName,
    StringCollection strCollViewFields,
    string strQuery,
    uint iRowLimit,
    bool bPaged,
    bool bMakeViewDefault,
    SPViewCollection.SPViewType type,
    bool bPersonalView
)

```

from [MSDN](http://msdn.microsoft.com/en-us/library/office/ms480493(v=office.15).aspx).

As you can see, by setting `bMakeViewDefault` to `true`, your new view will be used as the default view for the list or library.

If you already have created the view, you can mark it as default view with this code:

```
SPView yourView = CurrentList.Views["Name or ID of view"];
yourView.DefaultView = true;
yourView.Update();

```

as found [here](https://stackoverflow.com/questions/11806877/how-to-set-custom-view-as-default-view-for-sharepoint-list)
Note that Views are quite static things in SharePoint. If you want to query the document library dynamically from your web part then you may consider using the KeywordQuery class. This uses SharePoint Search to find the matching documents but you need to display the results yourself. Also you will need to filter the results to your document library.

Here is a good description how to do it:
<http://msdn.microsoft.com/en-us/library/office/ms551453(v=office.14).aspx>

And here is a complete sample.
<http://msdn.microsoft.com/en-us/library/office/ms493601(v=office.14).aspx>