.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

Issue with Proxy code when generated for WCF service

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


There is an issue I am going through when generating Proxy code for my WCF services. Whenever I generate Proxy code for services with methods having VALUE Type parameters, additional BOOL parameter <parameter>Specified is added to the generate Proxy Code.

So if I have method - Employee GetEmployee(int Id), the respective proxy code for this method will be - Employee GetEmployee(int Id, bool IdSpecified).

Moreover, if you do not set this bool parameter value to TRUE, no value will be passed to the End service.

I can understand this can come handy when handling Null inputs, but that will not be always the case.

After doing some R&D, I found that if I add Data Format attribute of type RPC to my Method contract, these parameters are removed. Like if I add: 

[DataContractFormat(Style = OperationFormatStyle.Rpc)] , the generated proxy code reflects all value type parameters as is.

I am not an expert in WCF, and for the same reason I don't have much idea on what significance this attribute plays for the service methods. Can adding this attribute introduce problems when consuming these methods by application in .NET 1.1 or in JAVA?


Can anyone help me in getting ride of this additional parameter in the proxy?

Thanks in Advance.




View Complete Post

More Related Resource Links

Namespace Issue in Generated Code


I have a Solution in which I have A WCF Service web site project which then hosts two separate WCF Service Libraries (each in their own project).  One of the Web Services is a Client to the other. 

When I click the ClientService and select Add Service Reference, it all adds properly, but when I go to build it, I get this error in the reference.cs (the generated file).

The type name 'HostWCFService' does not exist in the type 'ClientService.ClientService' C:\Users\...\Reference.cs 

I don't want it to create a ClientService.HostWCFService namespace, I want to be able to use the HostWCFService as its own namespace.  I believe I've had this setup working before at one point; that is, I had this arrangement working before, but am not sure now if the host service was in a sub namespace of the project.

I was able to do: 

using HostWCFService;

instead of

using ClientService.HostWCFService;

Any thoughts? 

XMLSerializer: Losing data from a generated web service proxy using svcutil


I generated a proxy using svcutil with the option ser:XmlSerializer.  When trying to serialize the object I am losing data.  The wsdl came from a .asmx web service.

Adding IServiceClient interface to generated proxy service client class

would it be possible to add a service client interface to a generated service client class in a generated service proxy in order to achieve easier testability?
Here's an example of what I am asking the way I do it manually http://blog.vuscode.com/malovicn/archive/2009/11/01/design-for-testability-wcf-proxies.aspx

This would not break backward compatibility (safe to be added)

Is this question more for Connect? :)


C++ and ATL: Use ATL Server Classes to Expose Your Unmanaged C++ Code as an XML Web Service


Throughout this issue, you'll read all about the promise of Web Services and how the .NET Framework enables Web Service development. Many people will also be building their Web Services atop C++ code and frameworks like ATL Server, particularly when performance is paramount. In this article, the authors show how fully functional Web Services are built using ATL Server and Visual Studio .NET. Beginning with unmanaged C++ classes, they add ATL attributes that make the code work over HTTP.

Kirk Fertitta and Chris Sells

MSDN Magazine December 2002

Repeater issue, all code inside Repeater are not shown


I have a Repeater who should show some data from my ms.sql server. But all code inside the Repater is not shown on my .aspx page. What am i doing wrong. I have a similar Repeater on another page and there it works fine.


 <div class="AnsaettelseKontrakt Folders">
      	            <table cellpadding="0" cellspacing="0" width="750px" align="right">
                            <th class="BrugerHeader" style="width:300px;">Filnavn</th>
                            <th class="BrugerHeader" style="width:80px;">Størrelse</th>
                            <th class="BrugerHeader" style="width:150px;">Dato</th>
                            <th class="BrugerHeader" style="width:180px;" colspan="2">Brugere</th>
                            <th class="BrugerHeader" style="width:40px;">Værktøjer</th>
                        <asp:Repeater ID="RepeaterAns" runat="server" onitemcommand="Repeater1_ItemCommand" >
                                <tr class="Br

Custom tool error: Failed to generate code for the service reference 'CompanyService'. Please che


A little background because I feel I have an out of the ordinary architecture in place and don't know if this is contributing to the problem. 

We have an existing ASP.net application that is undergoing expansion.  The new functionality is all written in Silverlight 4.  As part of that expansion I gutted all the old Linq to SQL and put Entity Framework 4 into place.  To do this I created a standard .net Class Library and added my edmx files there.  Naturally, the business entities created by this cannot be used in Silverlight.  So I created a Silverlight Class Library and added all the business entities to that Silverlight Class Library as linked files.  I changed the name space to be the same.

So I have the following assembly / namespaces

Company.Project.Dal.csproj / Company.Project.Entities (.net 4 class library)

Company.Project.Entities.csproj / Company.Project.Entities (SL4 class library)

With this architecture I was able to share my business entities with my SL enabled web services, my asp.net projects, my silverlight projects.  Really it's a beautiful thing.

Once this was done I added "message" classes to Company.Project.Dal and again shared them with the other entites using linked files.  These messages are things like MyObjectRequest; they are class

Deserialization issue with returned from web service

Hi, I have a VS 2008 C#  client using a proxy generated by the Service Reference tool from a schema for a (prob Java?) ASMX web service.  I got serialisation errors when I tried connecting to the service around<xs:date> date fields, and on inspecting the incoming XML discovered the date format was yyyy-mm-dd hh:mm:ss.sss.   So 2 questions really.. 1) Is the schema I've been supplied with incorrect? 2)Is there a way to work around this, apart from manually editing the schema to xs:datetime and regenerating the classes?   Thanks MJ

How to use ESB Transformation Service in .Net Code

Good day everyone, I am creating a .Net application which receives different XML files. Some of them need conevrsion from one format to another format. I have created some BizTalk maps for them. But I don't know how to use them in .Net code. I found some info that there is some ESB Transformation services in BizTalk, which could be call from .Net code. Can some one tell me some sample code or some article which explains that how will we use these ESB transformation Services? Thanx in advance.  

SSIS And Sybase Source OLEDB connectivity issue with code page for character set

Hi I am using SSIS 2008 to connect the Sybase Server version 15.0.3 64-bit. The default character set id used by this Sybase server is 4 (i.e. roman8). (http://manuals.sybase.com/onlinebooks/group-charc/chg0300e/charsets/@Generic__BookTextView/1706;pt=266) I had installed Sybase Client for Sybase OLEDB Driver (ASEOLEDB) to integrate this in OLEDB Source Editor. As per guidance from one of the past MSDN forum discussion, I tried setting property of AlwaysUseDefaultCodePage property to "FALSE"  (http://social.msdn.microsoft.com/forums/en-US/sqlintegrationservices/thread/f5af9328-e1fb-48d7-a85d-1d08bb7cf0e5/). However, I am still experiencing error message as follows:- ********************************************************* Error at Package2 [Connection manager "xxxxxx.xxxxxxx"]: SSIS Error Code DTS_E_OLEDBERROR.  An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available.  Source: "ASEOLEDB"  Hresult: 0x80004005  Description: "[00000] [Native Code: 30061] [ASEOLEDB]Could not load code page for requested charset". An OLE DB record is available.  Source: "ASEOLEDB"  Hresult: 0x80004005  Description: "[1ZZ001] [Native Code: 30016] [ASEOLEDB]Internal Error". Error at Data Flow Task 2 [OLE DB Source [1]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMC

How to Find out Windows service application path from Code ?

Dear frnds, Could you please help me to find out the path of  windows serivce exe ( application path ) from code?   Regards. Sajid P K  

An issue of using UDF in Excel Service

I am using Excel Service and it call an UDF(User Defined Function) to get data from a list. Currently I come accross following issues. Any one can give me suggestions are very appriciated. 1. In the UDF, if I marked the method as "ReturnsPersonalInformation=true". The data cannot be shown correctly, all cells appear "#Value?". 2. When I fist time upload a excel file to the Document Library, then open the excel on browser. All cells appear "<nativehr>0x80070005</nativehr><nativestack></nativestack>". When I manually click "Calculate Workbook", then the data comes correctly. Thanks again for any hints.

Permissions issue for custom web service in the _vti_bin folder.

Hello, I have created a custom ASMX webservice that returns in JSON format so that I can call the data from JQuery on SharePoint page content.  I placed it in the ISAPI (_vti_bin) folder and it works just fine when I go directly to the web service and call it the way JQuery calls it: /_vti_bin/ServiceabilityCheck.asmx/GetSystemIDByZIPCode?ipaddress= Which returns: <string>{"SystemID":"5"}</string> When I try to call it from the SharePoint site with JQuery, it errors out and gives an unspecified error.  Fiddler shows {"Message":"Authentication failed.","StackTrace":null,"ExceptionType":"System.InvalidOperationException"} as the response from the web service call. When I have the webservice on an IIS web app outside of SharePoint, it works fine.  I have anonymous access enabled on the SharePoint site, why would it give me this error?John Chapman | Blog: http://www.johnchapman.name

WF Service using EF4 POCO Entities Issue

Hi I've a WF Service using my EDMX and my Classes generated using a poco t4 template, but on execution when i include navigation properties related to a 1 to many or many to many relationships i got an underlying connection was closed error. I've traced the error and i got 2 exceptions different exceptions depending on which parameters i pass to my context and my ReciveAndSendReply Action. One is the related to that Navigation Property and the fact that it is generating a cyclic reference A.B  B.List<A> or viceversa and cant be serialized. The other changing my context property to enabling/disabling the proxy creation i get a overflow on the max message size or max message on the trace (the cyclic reference is doing an overflow and the entity back from the WF service is not coming back. Hope you can help me guys to figure out whats going on. Thx Pedro

Issue with SPTimer Service

I'm having isues creating a brand new SharePoint 2007 farm that I've never encountered before.  I'm installing a slipstream SharePoint 2007 EE with SP2, Infrastrucutre Updates and Dec 09 cumulative patchs (version 12.0.6524) I didn't have any issues or errors during the installation or during the configuration wizard but once I started to configure the farm, things just don't seem right. For example, if I try to start the Server Search Service, I'll get the error: An unhandled exception occurred in the user interface.Exception Information: Could not connect to the search administration Web service on server CDC-SPI-P01 because the web server is not running. I'll get this until I cycle both IIS and SPTimerv3 on both the Indexer and the Central Admin server. Also when I try to stop/start the timer server, it will hang on stopping and has to be manually killed. The last thing I noticed (and this might be the root cause) is that if I go to the Timer Job Status page, I'll get : There are no items to show in this view. even though jobs should have been run.  If I look at jobs in the definition page, even jobs that are suppose to run every minute have 'n/a' next to their last run time. Has anyone else seen something like this? I've used these binaries before so I know they're good but I am willing to do a complete uninstall/reinstall if its warranted.

The Sanboxed code execution request was refused because the sandboxed code host service was too busy

I am getting following error when I am running my sandbx solution ona virtual machine. "The Sanboxed code execution request was refused because the sandboxed code host service was too busy to handle the request" I verified  in central admin that my  Usercode service is already running. I also tried to run below script using powershell. $acl = Get-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $person = [System.Security.Principal.NTAccount]"Users" $access = [System.Security.AccessControl.RegistryRights]::FullControl $inheritance = [System.Security.AccessControl.InheritanceFlags]"ContainerInherit, ObjectInherit" $propagation = [System.Security.AccessControl.PropagationFlags]::None $type = [System.Security.AccessControl.AccessControlType]::Allow $rule = New-Object System.Security.AccessControl.RegistryAccessRule($person, $access, $inheritance, $propagation, $type) $acl.AddAccessRule($rule) Set-Acl HKLM:\System\CurrentControlSet\Control\ComputerName $acl Any pointer would be highly appreciated!!  

SvcUtil-generated code or shared interface/data contract assembly?

If you control both service and client is there any benefit in using svcutil.exe to generate client proxies? Or is it better to share interface/data contract assembly between client and service?
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