Wrox Programmer Forums
Go Back   Wrox Programmer Forums > .NET > Other .NET > .NET Web Services
| Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 15th, 2008, 02:09 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default Values getting changed while returning/receiving

Hi,
 I’m returning one object from web service, object contains DateTime, String and int values . Its showing Perfectly in the Webservice till return statement. In the receiving end im getting string value perfectly, But int value changed to 0( Zero) and DateTime value changed to 01/01/0001 00:00:00

Please tell me if any faced similar issue.. How to resolve this...

Thanks,
Veera



 
Old January 15th, 2008, 10:26 AM
planoie's Avatar
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

What is the receiving end?
How are you checking the values?
Is the value for the int actually "0 (Zero)" or "0" and you added the "(Zero)"?

The value for the date makes some amount of sense.

-Peter
 
Old January 15th, 2008, 11:12 AM
Wrox Author
Points: 13,255, Level: 49
Points: 13,255, Level: 49 Points: 13,255, Level: 49 Points: 13,255, Level: 49
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2005
Location: Ohio, USA
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Based upon the values you are getting on the receiving end, your valuse are reinitialized to their default values. (By default I mean the value the type takes if is is declared but not initialized with a specific value).

How are you accessing your object?

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor :.
Wrox Books 24 x 7
================================================== =========
 
Old January 16th, 2008, 12:10 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank you for your quick response.

when returning the object from web service, i am able to see the property values in debug mode. My recieving end is NUNIT. Here is the example scenario.

object[] AssignObjs = null;
AssignObjs = service1.assignments_select(UserID);

The return type of the assignments_select(UserID) is of object[] type. When returing object collection from web serivce all values are pretty fine, but in receiving end datetime value is getting changed to "01/01/0001 00:00:00".



 
Old January 17th, 2008, 08:54 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
Posts: 22
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey i resolved my issue..

the problem is in XSD..
Actually im using a .cs file which was generated from xsd.
I changed the Use value Default to required.
Now im getting the vlaues perfectly..

<xs:attribute name="testID" type="xs:int" use="required" />

Regards,
veera





Similar Threads
Thread Thread Starter Forum Replies Last Post
Returning Values from a Stored Procedure kadjw SQL Server ASP 1 September 13th, 2006 12:08 PM
update values of changed cells into database using changusee2k PHP Databases 0 March 9th, 2006 01:05 PM
Returning Decimal values from database hasanali00 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 October 10th, 2005 08:10 PM
returning values with SQL stu9820 SQL Language 6 December 8th, 2003 02:36 PM
Returning index values from an associated array Jams30 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 4 October 7th, 2003 11:42 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.