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

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Accessing an Array of Strings Property from WCF Client

Posted By:      Posted Date: October 19, 2010    Points: 0   Category :WCF

First let me apologize for the elementary question, but I’m not a developer by trade and only have to put that hat on when needed for work.  However, I’ve written a WCF service that contains an array of strings as a DataMember .

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;
using System.Runtime.Serialization;

namespace OBCreateEForm
  public class EForm
    [DataMember(IsRequired=true, Name="EFormDocTypeName", Order=0)]
    public string EFormDocTypeName { get; set; }


View Complete Post

More Related Resource Links

Module 5: Accessing SharePoint 2010 Data with Client-Side APIs

SharePoint 2010 provides a new client object model that enables you to create SharePoint solutions that run remotely from the SharePoint server farm.

javascript pageLoad() & client side isPostBack property?

Hello and thanks for your help in advance. I have some javascript code that I have placed in the pageLoad() function like this:function pageLoad() { var x = 5; }But I only want this to happen on the first time the page loads... Is there an isPostBack property on the client site?

Data Annotation not triggering the client side validation when used on an overriden model property

Hi all, This is a saga from a post that was recently answered:http://forums.asp.net/t/1598187.aspxMy main problem is the lack of client side validation when we use a child model class, the server side validation works like a charm whether you use the virtual/override solution or the new attribute on the child class with the getter and setter linking the property to the base class's one.The client side validation does not work with none of the solutions presented below.This is a sample code of the first solution: [Serializable] public class DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] public virtual int? Year { get; set; } ... } [Serializable] public class BirthDateViewModel : DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] [YearRange(ErrorMessageResourceType = typeof(App_GlobalResources.Messages), ErrorMessageResourceName = "Validation_Range")] public override int? Year { get; set; } ... } This is a code sample of the second solution : [Serializable] public class DateViewModel { ... [Display(typeof(App_GlobalResources.Messages), "Date_Year")] public int? Year { get; set; } ... } [Serializable] public class BirthDateViewModel : DateViewMod

Accessing a public property of a nested user control in a master page from a pages' user control

Hi  I've got a web site that has a master page and that master page (mpMaster that has a user control (ucControl1) which has a sub user control (ucControl2), this user control has a property which accepts a value. Now, I have a page that uses the master page and on this page I have another user control (ucPageControl), I need to  find a way of setting the value in ucControl2 from ucPageControl. Is this possible at all? Many thanks Ed

WCF Property not visible to Client

I am currently developing a WCF service .net 4.0 which has got 2 properties. For some reason those property is not visible on the client. Following is the code for the service. <pre> using System; using System.Collections.Generic; using System.Linq; using System.Runtime.Serialization; using System.ServiceModel; using System.ServiceModel.Web; using System.Text; using System.Data; using System.IO; using System.Configuration; using Longview.ScatIt.Data.Model; using Longview.ScatIt.Service.Contract; namespace Longview.ScatIt.Service {  // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "SqlJob" in code, svc and config file together.  [ServiceContract]  public class SqlJob : ISqlJob<SqlJobInformation>  {      #region IJob Members         [DataMemberAttribute(Name="FileName")]         internal string _fileName;         [DataMemberAttribute(Name = "Location")]         internal string _location;   #endregion  } } </pre> I read somewhere on internet that in partial trust property need to be defined as "internal" and add [assembly: InternalsVisibleTo("System.Runtime.Serializat

Accessing Property of Webpart

Hello All   I am having one scenario where i need to access property of webpart1 in webpart2 Example : Webpart1 has property max records to display which user sets from UI side and fetch data from list upto the property set. Webpart2 also needs to display records from the same list used in webpart1 but there records displayed should be records after displayed in webpart1. i.e. if webpart1 displays records as (1,2,3) then webpart2 should display records as (4,5,6). So please let me know how i can access property of webpart1 in webpart2   I would be thankfull for any reply   Thanks & Regards Mrugank Dholakia

Accessing Custom Property in HTML???


i have a usercontrol with a few dropdownlist....n i am using that usercontrol in few pages and depending on pages those dropdownlist  can be enabled mode or disabled mode.

so i created a property:

private string _readOnly;
        public string ReadOnly
         set {
                if (value == "true")
                    ddlOTime.Enabled = false;

Now i am accessing in HTML as

<uc3:OpenTime ID="OpenTime1" OTime='<%#Bind("OpeningTime")%>' ReadOnly="true" runat="server" />

it seems to work.

Just curious know that am i going in right direction or any better approach is available?


Accessing ModifiedBy property from API


I have a site which I did a restore from another server. I have a custom search part on my site which queries the scope for a list of files and their attributes. When I go to a document library or a list I can see that the modified by property is set to the proper value, but when I run a search through my custom search part, modifiedby is returned as 'System.String[]' for every file. If I set the source code to display the 'author' attribute, the value is returned correctly. Any ideas on why this is happening?

EDIT: I get 'System.String[] ' returned in the API for the modified by attribute, even when I upload or modify a file on the new server.


Accessing Client Devices & Upload to Server


I'm in the process of creating a ASP.NET page that will allow the user to upload PDF files stored on a CD onto the server. I have written a piece of code that checks for an .ini file and then goes into a specific folder that will save the PDF files to a folder I have specified on my computer. Now that works fine in localhost, but when I uploaded it to the server it stopped working. 

I get a 404 error everytime I click on the button to upload. I suspect i'm not correctly accessing the client's cd drive because the path to their drive isn't correct.

01.Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click  
02.       Dim fileReader As String = "" 
03.       Dim intCount As Integer = 1  
04.       Dim strFileName As String = "D:INI FILES\"  ' TODO: CHANGE PATH  
05.       Dim fFile As New FileInfo(strFileName)  
06.       Dim files() As String = Directory.GetFiles("D:\PDF\")  
07.       Dim intNumOfFiles As Integer = CInt(files.Length()) - 1  

Property Array of other Property Type



I am making use of two property classes, between them one is type is that of other property array type, it has the following code:

public class Entities
        private Property[] employeeInfo;
        public Property[] EmployeeInfo

how to insert a path file into an array and listview using openfiledialog with multiselect property?



i have problem to insert path file into an array and listview(detail) using open file dialog wit multiselect property, please give me sample to make it?

how to filter array of strings


string[] ar = {"1", "1.1", "1.2", "2", "2.3"};

I need to get the closest match from the array or the next number according to the user input. Say for example if the user enters

input     output

1            1        // exact match

1.3         2        // since 1.3 is not present it should get next match from the arrray

2.1        2.3     // as above comment


Accessing Property Value of a Custom Control by another Custom Control in Design-time



I created an Extender which has a custom property that drills down a list XML elements from an xml file, where users can select xml elements during design-time. This works perfectly fine. However, my code only has a hardcoded xml filename (source of the xml elements list) and I need to change this by maxing the xml file user-specified.

What I did is that I created another control (panel) which has a custom property that when clicked (through the ellipsis), it will allow a developer to select the xml file which is supposed to be the source xml file that the Extenders shall use. The filedialog from custom panel's property works perfectly fine.

However, my problem now is that when I drag-drop my Extender, I cannot find a way to get the property value of the custom Panel Control which contains the xml filename. I tried creating a static variable which I thought the custom controls can share but VS2010 is breaking.

Please take note that my problem is on Design-time, asp.net.

Appreciate any help. Thanks a lot.

Dhon Nuevo.

How pass js array from client to server using jQuery?



i have an array on client side

var ResultArray = new Array();


for (i = 0; i < count; i++)



 var RowValue = { id: current_Id, value: current_Value };




than i send it to server

$.post( "Home/GetResult", { result: ResultArray }, null, "json" );

Before sending to server i can see all values in each item of my array 

But when i receive this one on server side, the answer is  "[object Object],[object Object],[object Object]"


public ActionResult GetResult(object[] result) // first way


object new_result = Request.Form["result"]; // second way

Can you explain me how should i send an array of objects from client side, and how should i receive this and detect each object in array on server side? Thanks.

SP2010 SSL Crawl Fails - Accessing this site requires a client certificate.


Full error Message:  Accessing this site requires a client certificate. Specify a client certificate in the crawl rules.

I added the Crawl Rule and Content Source for the test site https://sp.xxxx.com/TestSite and tried specifying each available client certificates in the rules one by one, but the crawl still fails.





What kind of certificate does it needs and how to enable it? I know that the *.xxxx.com certificate is used for our SSL.


WCF client, svcutil and SOAP array problem


Hi, everyone. I hope someone will be able to help me about this issue:
I am trying to generate WCF client by issuing following command:
svcutil testingWsdl.wsdl /ser:XmlSerializer (/ser option has nothing with problem, I've just tried with it also)
I am getting following error:

Error: Cannot import wsdl:portType
Detail: An exception was thrown while running a WSDL import extension: System.ServiceModel.Description.XmlSerializerMessageContractImporter
Error: The datatype 'http://schemas.xmlsoap.org/soap/encoding/:Array' is missing.

Here is complete WSDL:

<?xml version="1.0"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" 
<import namespace="soap" location="http://schemas.xmlsoap.org/wsdl/soap/"/>
 <portType name="SoapInPort">
 <operation name="SoapIn">
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