WCF / ASMX :: Client DataContract Has Empty/null Values From Service?
Mar 26, 2010
I have a simple WCF service that returns the time from the server. I've confirmed that data is being sent by checking with Fiddler. Here's the result object xml that my service sends according to fiddler.
[Code]....
Literally the only difference is the namespaces within the application. But still the values being returned are null, empty or a .NET default.
View 1 Replies
Similar Messages:
Mar 11, 2011
I've created a WCF Service that Performs Insert User, What it does is, it'l get user name, age,gender,address,phone no and inserts these values into SQL database.
Problem is :
These things are working fine, if i give all the values in the WCF Test Client, It's Not working when i din't enter value for Address and click "Invoke" Button, It's throwing an Exception Procedure or Function "Insert_User" Expects
ADDRESS' Which was not supplied. I've created the SQL table Which allow Null Values for Address.
I've did the same Operaion in WebService also, there it's working fine, if i din't enter any value for tha Allow Null Colums, it's accepting the Null value and inserting into Database.
Why this Problem comes in WCF Test client, Guide me to Get rid of this Problem.
View 1 Replies
Apr 1, 2011
I have a WCF service with cyclic references that I was using the CyclicReferencesAwareAttribute attribute (http://chabster.blogspot.com/2008/02/wcf-cyclic-references-support.html) to solve. However now I want to use the same service with a Silverlight client. Receiving data works well on the Silverlight client with this method, however the CyclicReferencesAwareAttribute attribute does not work on the Silverlight side when I want to send objects back again.
I have changed to use the IsReference property on the data contract which is supposed to get round with this issue. However now the objects that are returned are empty! (All fields are either default or null). This is the same in my ASP.NET client (original) and my Silverlight client.
Has anyone hit is issue before? Here is the attribute [System.Runtime.Serialization.DataContract(Namespace="http://testnamespace.co.uk/entities", IsReference=true)]
View 1 Replies
Nov 8, 2010
A customer reported that our asmx web service is continually increasing in memory (mem usage as well as private bytes). We are able to reproduce the problem in our lab with Windows 2003 Server SP2 (fully patched) on some of the machines. The customer is using Windows 2008.
We created a Hello World web service targeting the 2.0 framework built under VS2005 SP1 and a test client that continues to call it. The memory increases steadily - approximately 40K per client request. If the test app is paused, the memory remains the same. When it is closed, the memory drops. Explicit calling of GC.Collect does not drop the memory.
We have run the memory profiler on the service and the leak is all native memory. We have uninstalled/re-installed the Framework on one of the machines but no difference. To our knowledge all of the security and IIS settings are not modified. We have compared app pool, default web site and virtual directory properties to machines that have no problem and they are identical.
View 11 Replies
Apr 5, 2010
I am constructing a wcf service, shares a data contract to client. Now, I am facing two issues.
1. The serialized Generic List data member, is having duplicate elements, specially a parent element with xml element name as data member name and child elements(since collection) with same name.
eg. if my data member in data contract is List<abc> then, the output is <abc><abc></abc><abc></abc></abc>. But expected is juts <abc></abc><abc></abc><abc></abc>... I tried adding xml element name attribute to data member. but didn't succeed.
2. ExtensionData xml element is present in the serialized response data contract even though my datacontract in not implementing the IExtensibleDataObject.
View 1 Replies
Jan 30, 2010
For coonverting Linq to DataTable I am using the following Extension Method(Taken from Stackoverflow)
L[code]....
The Extension Method creates XML file.But for null values no element is created in XML file.Say if Commission field is null then commission element is missing in Xml generation.
I want to insert element with empty string for null values (ref type) and (0.00) for decimals and (0) for integers. where do i need to make change?
View 1 Replies
Oct 14, 2010
I am creating few WCF services. The number may be high. And we have used a pattern in each service to handle different targets. Now the issue is like each service is having 3 classes. And these three classes are similar in all sevrices with minor changes. These classes use corresponding data contracts in thier classes and the remaing logic is same. Now i am trying to reduce no of classes in each service. So I've added a class librray to solution and these classes are available in that library. And I am referring these library in each service. Since all services use this library, I am referring all data contracts in this newly created library.
My question is what is the impact of referring a dll(s) in class library. Is it ok to refer all dlls in one library and refer that library in each service? Earlier implementation is referring corresponding data contract dll in each service. Now all the data contracts are removed from services and moved to one library. Am I doing correct in terms of performance and maintainability?
View 3 Replies
Jun 1, 2012
If I have JSON like this and pass it to the engine I am using to create a PDF file, the word "null" appears on the PDF. This isn't really my example, but I googled "json replace null empty string" and this was a hit, which is a good representation of my data, also:
{
"relationship": {
"type": "relationship",
"id": null,
"followed_id": null
}
}
We use a rendering engine that creates a PDF from a fixed template and variable data in the form of a json string. But our customers don't want to read that the id is "null", they want to read that the id is blank. In my C# program, the json is just a string, so I can easily do something like this:
jsonString = jsonString.Replace("null,", ",");but the issue is I can't replace null-comma with a comma, because then it's invalid json.
how to I make the rendering engine *and* my customer both happy?
View 18 Replies
Mar 14, 2012
this is my sql query and its work fine in my code but it only check ParentDeptID IS NULL it not working when ParentDeptID field is empty how can i check it
("select DeptID,DeptName,(select count(*) FROM HrDept " _
& "WHERE ParentDeptID=sc.DeptID) childnodecount FROM HrDept sc where ParentDeptID IS NULL ", _
objConn)
View 1 Replies
Oct 13, 2010
On the client I want to instantiate an instance of an entity (that has a datacontract on the server side), send it to the server, let the server modify it in some way, and send it back. I'm talking about using standard-issue, ordinary WCF objects with DataContract/DataMember attributes.
The only way I could figure out to accomplish the above is to pass the object by reference. Is there another way?
In researching this, I found the links below, one of which says it is not possible to pass by ref (yes I realize we are passing a copy, but it is the result I'm interested in. Perhaps that is what the author is alluding to??).
Sorry for having to ask this but I'm confused (again).
http://stackoverflow.com/questions/1956039/by-ref-arguments-in-wcf-bad-or-good
http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/8d7c424d-af31-442d-94d3-119f371300e5
http://msdn.microsoft.com/en-us/library/ms733070.aspx
Server code:
[Code]....
Client code:
[Code]....
View 2 Replies
Sep 2, 2010
I have an Asp.net web service that I created using Visual Studio 2005. I can acess the web service in my test environment, call methods and return data as expected. If this web service is published to the outside world (Outside of the company firewall), it will return a null why this might be happening? The same code is being used,against the same database. The only difference is that the published website is giving back the null reference exception. If I type in the URL for the web service "https://secure.theSiteGeist.com/wsIndigo.asmx" a list of methods for the web service is displayed in my browser. Yet if I try and call any methods on the web service I get back the null reference exception. Note that the URL I posted above is not the real name of my web service, but is just used for reference sake.
View 3 Replies
Mar 8, 2011
when client call my web service, i read owner cookie?
For example : When Guest browse www.abc.com, i write a cookie that its name BrowseTime.
www.xyz.com using web service on www.abc.com . Can I get abc.com's BrowseTime cookie when xyz.com call WebService? Or alternative solution like (third part cookie or any)
View 3 Replies
Oct 15, 2010
I'm trying to receive a Client Certificate in a Web Service and having some problems.
Client
[Code]....
The certificate seems to be correclty loading and added to the client.
The client connects to the server with HTTPS.
Server:
[Code]....
cert.IsPresent is false and all certificate fields are empty.
IIS is configured to Accept Client Certificates.
Reproduced in two environments:
- Windows 7 x64, IIS 7, VS 2008, .NET 3.5
- XP x86, IIS 5, VS 2008, .NET 3.5
Always in the Web Service the Client Certificate is not proesent. I haven't been able to find any other configuration I should do.
View 1 Replies
Dec 15, 2010
I am having a strange issue in my C# Console Application:
Name Space: WcfConsoleApp
Main Class: Program.cs
Name Space: WcfConsoleApp.ServiceReference
this namespace contains the WCF service reference
After building the project, the Program.exe avaliable in Debug folder is executing fine as expected.But when i move the exe to Client, where i need to actually run this exe, it works fine up to the line where i am referencing the Service, the line is:
WcfConsoleApp.ServiceReference.ServiceClient service = new WcfConsoleApp.ServiceReference.ServiceClient();
the consoel app crashes on the client machine at this line. (i know this because before this line, i display some mesage on the console)the same .exe and works fine at my development machine.I am sure it has to do some thing with reference path, i think the program is not getting to the path where service reference is avaliable. I have copied the full project folder as it is to the client, but still its is not working.
View 4 Replies
Aug 30, 2010
I have consumed an external webservice in my client application using WCF. And every thing works great in my Dev box(XP with IIS5.1)But when the same application is moved to Prod server(Win Server 2003 with IIS6.0) it fails. Below is the exception caught:
There was no endpoint listening at http://MyExternalWebServiceUrlWithSessionId could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.And the InnerException is: Unable to connect to the remote server.My Config file has the below settings:
[Code]....
View 1 Replies
May 20, 2010
I am consuming the java web service in .net client, when i sent a request to that web service, i am getting one exception in response object.It says "Client found response content type of 'text/plain', but expected 'text/xml'", along with this message i am getting the response in that exception.
View 2 Replies
Apr 30, 2010
I receive the following error, when trying to consume Wcf service:
"An existing connection was forcibly closed by the remote host". Consuming the service works fine when the host and the client are on the same machine. When I move the client to Hyper-V virtual machine (I didn't try it on a real computer) - it throws the error. Both firewalls are turned off Do you know what can cause such behaviour? Here are the details:
Both the client (hyper-v) and the service are on Windows server 2008 R2
Service url - http://wcftest/CalculatorService.svc (wcftest is the website and is mapped in the hosts file to localhost)
Service config:
[Code]....
Client config:
[Code]....
Are there any configuration settings which I'm missing?
View 1 Replies
Sep 7, 2010
I am working on WCF Data service which imported stored procedure, as below.
[WebGet]
public List<GetMTSearchResultTest_Result> GettMTSearchResultTest()
{
MediaMarketResearch_PRODEntities ent = new MediaMarketResearch_PRODEntities();
return ent.GetMTSearchResultTest().ToList();
}
when i consuming this in my client application it says error as "The closed type MMRClient.MMRServiceReference.GetMTSearchResultTest_Result does not have a corresponding element settable property." I am getting this error while bind to the grid view as below.
DataServiceContext context = new DataServiceContext(new [URL])); IEnumerable<GetMTSearchResultTest_Result> empResult = context.Execute<GetMTSearchResultTest_Result>(new Uri [URL];
GridView1.DataSource = empResult;
GridView1.DataBind();
Note: I imported this stored proc as complex type.
View 1 Replies
Jan 5, 2011
I was wondering if anything special is required to add a .NET web services to the "Services" tab in NetBeans to allow my java app to consume a .NET web service. I go and add my WSDL (simple method, 1 operation, takes a string), and I continuously get a NullReferenceError as below:
java.lang.NullPointerException
at org.netbeans.modules.websvc.saas.model.wsdl.impl.WsdlModel.getServices(WsdlModel.java:65)
at org.netbeans.modules.websvc.saas.wsdl.websvcmgr.WebServiceManager.addWebService(WebServiceManager.java:142)
at org.netbeans.modules.websvc.saas.wsdl.websvcmgr.WsdlDataManagerImpl$1.run(WsdlDataManagerImpl.java:79)
at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1418)
[catch] at org.openide.util.RequestProcessor$Processor.run(RequestProcessor.java:1957)
Is this something common? I'm using Netbeans 6.9.1 and yes, the webservice is a stub that takes a string and displays a static message right now.
View 1 Replies
Jan 26, 2011
I have a silverlight application that uses WCF service and i need to provide windows authentication using wcf.In order to achieve this i am trying to retrieve the client's credentials (windows credentials)inside wcf.
View 1 Replies
Feb 23, 2011
I need to store a pdf file on client machine using a web service.
I am unable to find IP address of client machine in web service so that I can insert pdf file in C-drive of client machine.
I am using asp.net 3.5 using c#.
View 2 Replies
Aug 2, 2010
I would like to pass xml document to a method in WCF service by client that server will get xmldocument,parse it and send back the xml response.What are best practice for thi?The xml document is conform to XSD so i would like to create managed type that represent the schema and then expose thatIf anybody has done it before or know any example please point it out so i can see it.
View 1 Replies
Mar 29, 2011
Most WCF web service I have developed were consumed in a server side code (by adding a service reference in visual studio or creating a proxy class using svcutil.exe. I have never consumed a web service in a client code. So I apologize if I am using wrong terminology or my question does not make sense.We have a browser add-on or plugin that connect to a device on client computer (think of it as active-x control for internet explorer) inside a asp.net web page.This browser plugin/add-on then will be sending measurement data to the web server. After some research it appears to me that I can do eithera) Develop an AJAX enabled WCF web service and use script manager and javascript to consume it inside the web page that interact with browser pluginb) Develop a WCF web servcice (not sure about AJAX enable) that serialize request and response to JSON, and use JQuery inside asp.net page to consume it.QuestionWhat's difference between approach a) and b)? Which is better in particular scenario I have described.
View 4 Replies
Apr 8, 2010
I have a (relatively) simple web service host. This ws exposes two methods: verify and processRequest.
Is there a way for the host to get information about where the request is coming from?
I am looking for things like IP Address, time/date sent, payload size (and maybe entire message size), etc...
I can not use custom SOAP headers, so I need to rely on whatever is in the default SOAP header.
I am writing my code in C#.
View 1 Replies
Jun 18, 2010
I have a module that subscribes to PreRequestHandlerExecute event, which uses the Session object. When i set the webconfig compilationdebug flag to false, the Session object is null when making requests to the web service. It works fine for .aspx requests, but only have problems for .asmx. When i set the debug flag to true everything works fine. I need to set this flag to false for production, but can't seem to get it work.I'm using II7 and the integrated pipeline, so this event will fire for all requests.
View 1 Replies