Webservice serialization - problem while generating wsdl when complex type contains seperate date and time field

I have a problem when serializing both date and time inside a complex type. 

A function is exposed in webservice which accepts a complex type as i/p -TestDateSerialisation

Fields of TestDateSerialisation -
TestTimeField - another type defined below
TestDateField - Date field
Namefield - string.

Field of TestTimeField
TestTime - time.

Problem: When I deploy the webservice in machine 1 and machine 2, I get 2 different wsdl.

machine 1 - IIS 5.1, windows XP Proffesional SP2, .NET Framework 2.0 Configuration (version 2.0.50727.42)
o/p obtained - TestDateField is shown as  type - date, Testtime is shown as type - time 
Result - This is correct.

machine 2 - IIS 6.0, Windows 2003 server SP1, .NET Framework 2.0 Configuration (version 2.0.50727.42)
o/p obtained - TestDateField is shown as type - time, Testtime is shown as type - time
Result - This is wrong. TestDateField should be having the datatype date. But wsdl shows wrong value here.

The code is attached below.

Would be great if this problem can be solved. Thanks in advance

---------------------------------------------------------------------------------------------------------------------------------------------------------------

using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
using System.ComponentModel;

namespace TestWebService

{


[System.Web.Services.WebServiceAttribute(Namespace = "http://www.mywebservice.com")]

[System.Web.Services.WebServiceBindingAttribute(Name = "mymethod", Namespace = "http://www.mywebservice.com")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

[ToolboxItem(false)]

 

public class TestService : System.Web.Services.WebService

{

[WebMethod]

[System.Web.Services.Protocols.SoapDocumentMethodAttribute("", RequestNamespace = "urn:mymethod", OneWay = true, Use = System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle = System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]

public void TestDateTimeCheck([System.Xml.Serialization.XmlElementAttribute(IsNullable = true)] TestDateSerialisation TestDateSerialisation)

{

}

}

}

[System.SerializableAttribute()]

[System.Xml.Serialization.XmlTypeAttribute]

public partial class TestTimeSerialisation

{

private System.Nullable<System.DateTime> testTimeField;

[System.Xml.Serialization.XmlElementAttribute(ElementName = "TestTime", DataType = "time", IsNullable = true)]

public System.Nullable<System.DateTime> TestTime

{

get

{

return this.testTimeField;

}

set

{

this.testTimeField = value;

}

}

}

[System.SerializableAttribute()]

[System.Xml.Serialization.XmlTypeAttribute]

public partial class TestDateSerialisation

{

private System.Nullable<System.DateTime> testDateField;

private bool testDateFieldSpecified;

private string testNameField;

private TestTimeSerialisation testTimeSerial;

public TestTimeSerialisation TestTimeField {

get {

return this.testTimeSerial;

}

set {

this.testTimeSerial = value;

}

}

 

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(ElementName = "TestDateField", DataType = "date", IsNullable = true)]

public System.Nullable<System.DateTime> OperationDate

{

get

{

return this.testDateField;

}

set

{

this.testDateField = value;

}

}

/// <remarks/>

[System.Xml.Serialization.XmlIgnoreAttribute()]

public bool DateFieldSpecified

{

get

{

return this.testDateFieldSpecified;

}

set

{

this.testDateFieldSpecified = value;

}

}

/// <remarks/>

[System.Xml.Serialization.XmlElementAttribute(IsNullable = true)]

public string Namefield

{

get

{

return this.testNameField;

}

set

{

this.testNameField = value;

}

}

}

--------------------------------------------------------------------------------

 

0
ajithkh
8/11/2007 7:22:06 AM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

2 Replies
576 Views

Similar Articles

[PageSpeed] 8

Hi,

Welcome to ASP.NET forum and thanks for your post.

It *should* be a known issue fixed in the hotfix Q925272 http://support.microsoft.com/?id=925272.

You can choose to install updates from Windows Update.

If it doesn't help please contact Microsoft Product Support Services to obtain the hotfix.


NOTE:If you find my response contains a reference to a third party World Wide Web site, I am providing this information as a convenience to you.Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,Microsoft cannot make any representations regarding the quality,safety, or suitability of any software or information found there.
__________________________________________________

Sincerely,
Young Fang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
Young
8/14/2007 6:29:25 AM

Another patch works. -- KB928365

Thanks

 

0
ajithkh
9/3/2007 1:24:20 AM
Reply:

Similar Artilces:

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

How to call a .net web service from another .net web service?
Hi all,I have developed two asp .net web services using visual studio .net 2003.I wish to call one web service from another web service.I tried adding a web reference of the web service in another web service and was able to do so.but i m not able to access the web methods provided by the web servicecould you please suggest a way to go about itExpecting quick replyThanxCharmy try to make sure that you reference it in the web reference and call it properly this is sample  [WebMethod()] public double CalcDistance(int x1, int y1, int x2, int y2) { Calculator.Service1 calc = new...

Web Services, Complex Types, .NET Soap Engine and Sybase
Just wanted to let everyone know, our company logged a case with Sybase recently because we were unable to access a web service in PB 11 where the response was a complex type described using the <xml any> element. They replied that the XMLNode is a .Net Data type that could not be mapped to anything other than Powerbuilder any. I replied that they should be able to return the entire message content as a Powerbuilder any and let the program worry about parsing the message. This is their final reply: >Actually, PB Web Servcie client using .NET engine is much bett...

Can You Generate .NET-Ready WSDL From Java Web Service Implementations?
So here's the situation. I'm looking into interfacing with a Java Web service at a client location. I won't actually be able to call the Web service for security reasons (the application will be installed at the client location, then pointed to the service) but I need to write code for it. This seems like it would be pretty straightforward: they'd give me a WSDL contract and I'd generate a proxy for it with WSDL.exe which could be reconfigured to point to the client's actual URL after installation. What I'm wondering, though, is if it's really that simple? Are most Java Web servi...

Pass complex type to .NET 2.0 Web Service, possible?
I'm trying to pass a business object to my web service.  It builds fine but once consumed the problem compile error comes up.  It seems that the business object namespace is the local consumed namespace instead of the one specified in the web service.  Here is the error:"The best overloaded method match for 'Test_Project.ArcXmlRequestService.ArcXmlRequestService.ArcXmlMapRequest(Test_Project.ArcXmlRequestService.ArcXmlMapRequest)' has some invalid arguments""Argument '1': cannot convert from 'Company.Project.ArcXml.ArcXmlRequest' to 'Test_Project.ArcXmlRequestService.ArcXmlMap...

Passing a dataset via web service without refering to complex type WSDL
Hi,I'm passing a dataset via a web service web method and the resulting web method  produces a WSDL and it referrers to a complex type. This complex type defines all the properties like the data type of the columns in the dataset data tables I'm passing.  Is there a way to create a web method that will generate a WSDL which has all the data types defined in the WSDL with out referring to a ComplexType at the client side.  Any advice appreciated. ThanksVij  Sounds tricky. You can control WSDL generation by making your own class derived from System.Data.DataSet an...

WSDL.EXE cannot properly generate webservice proxy classes that have arrays of complex types
We have started using the Visual Studios 2005 in a couple of test projects, in preparation for it's release and have encountered some issues. We need to use SOAP to connect to a proprietary data source and the code generated by the Visual Studio's code generator (wsdl.exe) doesn't seem to work properly. Although the Java code stub generators works seamlessly. The issue is discussed on these two sites. We have tried both the VS2002, VS2003, VS2005 and none of the toolkits generate the proper code. Because this is a third-party web service we can not change the schema files. http://theserv...

(for Bruce) XML with complex types in SOAP envelope fails in PB web service client
Hi Bruce, I have a web service developed in WSAD which takes XML as input and outputs XML. Can this service be consumed by Powerbuilder, I tried and it fails. Soap Request get convered from RPC/literal style into RPC/Encoding automaticaly. Do you think PB can send and receive XML as a SOAP message ? If yes how ? It has complex types in it. Please help, Thanks, Dinesh Generally XML is exactly what you send in a SOAP message. That (rather than structures) is generally what I return from mine, and sometimes use as the arguments to. Are you sure it's XML (i.e. a formatted stri...

PB 11.5
I have a wsdl that I'm generating proxy classes for in PB 11.5 using the Web Service Proxy Wizard (.Net engine), and have noticed that for types that are derived from an abstract type, that the derived types are being declared as being derived from nonvisualobject, and NOT the base type. Example to reproduce (11.5 build 2137): <!-- beginning of wsdl schema snippet --> <!-- here is the abstract type --> <s:complexType name=3d"PaymentAccountInformation" abstract=3d"true"/> <!-- first derived type; note, it is an extension of the abo...

GridView Auto-generated fields not run-time type fields
Hi All,I'm developing a user control which has a GridView and a DetailsView. The idea is, I can re-use this control whenever I want to display a List of some objects (in Master-Detail fashion). I have an interface IMyObject (which has a member "Name") and two classes that implement that interface: Pair (which has two properties "Name" and "Value") and Triplet (which has three properties "Name", "Type" and "Value").In user control code, I assign a List of IMyObject to DataSource of GridView: public int SetDataSource(List objs)...

Web service in .NET from Java Web Service
Hi there,I'm pretty new to .net (although i have years of experience with the old vb 6, access 2k, as well as java)... and need some with perhaps either some syntax or something.Here is the wsdl.<wsdl:definitions targetNamespace="http://www.dynix.com/schema/book">−<wsdl:types>−<schema targetNamespace="GetBookInfoByISBN">−<complexType name="BookInfoType">−<sequence><element maxOccurs="1" minOccurs="0" name="Title" nillable="true" type="xsd:string"/><element maxOccurs=&quo...

just Time or date portion of a date/time field
Good Day, From a DateTime data column how do I get just a Time portin or just a date portion of data to be displayed. i.e from 11/6/2003 10:03:20 AM I need to display date and time seperately in my data display page. Thanks Regards, In code you could use Dim dt as System.Date Dim day, month, year as integer day = dt.Day month= dt.Month year = dt.Year This also works with DateTime In SQL you could use DATEPART(<datepart>,<datetime>) where <datepart> is the abbreviations mentioned in post 385301 and <datetime> is a...

.NET web services Vs Java Web Services
Hello, does anyone know of a book or good source of information that compares .NET and Java Web Services? (I would like soemthing neutral if possible). I am thinking of approaching this subject for my dissertation? Many Thanks Rob Hi Rob, Last year I had to give a powepoint presentation on Web Services. I noticed some good books at barnes and noble that discussed the subject. These books were specific to Java and discussed Web Services in a very clear fashion. They gave some elementary examples that were easy to understand. I have not yet had the pleasure of creatin .NET Web Servi...

Web Service with XML Serialization
Hi I am creating a custom web service to communicate with Datacash. The creation is fine using XML serialization except that when it comes to creating/serializing something similar to the following: <addressDetails> <address line="1">1</address> <addressDetails> OK To get this you have to do the following:public class AddressDetail { [XmlAttribute("side")] public string side; [XmlElement("address")] public address line = new address(); [XmlElement("postcode")]...

Container in .NET Web Service
There have lots of materials and free software about container in J2EE Web Service, do you know where to find materials and free softwares about container in .NET Web Service ? Thanks, Toby Hello Toby, I am not sure what a container is in Java.  Can you explain to me what it is and then I could hopefully find a similiar .Net package!?!  If an answer has been provided to you question please mark it as an answer. Here is something for J2EE. I just want to know do we have the same stuff in .NET ? http://www.developer.com/java/web/article.php/2230731 The core components that ...

Web resources about - Webservice serialization - problem while generating wsdl when complex type contains seperate date and time field - asp.net.xml-web-services

Serialization - Wikipedia, the free encyclopedia
When the resulting series of bits is reread according to the serialization format, it can be used to create a semantically identical clone of ...

FlatBuffers 1.1: a memory-efficient serialization library
... in development, the FlatBuffers 1.1 update is here. Originally released in June 2014, it’s a highly efficient open source cross-platform serialization ...

Increase Java Serialization Performance
The simplest way to send and receive a Java object is to use an ObjectOutputStream/ ObjectInputStream object pair, but is it the most efficient ...

Jackson Data Binding Message Serialization
... ObjectMapper is simple: objectMapper = new ObjectMapper( new JsonFactory(); objectMapper.disableDefaultTyping(); objectMapper.disable(Se ...


Performance at Scale: SSDs, Silver Bullets, and Serialization
... occur when customers are trying to speed up the wrong thing. A common phenomena at the heart of the disappointing SSD outcomes is serialization. ...

LDS Serializations - Meridian Magazine - LDS, Mormon and Latter-day Saint News and Views
Meridian Magazine is the place where Latter-day Saints [LDS] gather online. Meridian is a values-based publication, drawing upon the standards, ...

Is Object Serialization Evil?
... to be the comparison of the various data stores, but the comparison of how data is stored. More specifically, I want to show the object serialization, ...

Serialization Vulnerabilities Put Many Android Devices at Risk
Researchers at IBM have identified vulnerabilities that can be exploited by malicious Android applications to escalate privileges, allowing cybercriminals ...

New Fall Shows Mix It Up by Adding Serialization, ‘Blacklist’-Style
One reason “The Simpsons” has run long enough to sustain an uninterrupted 12-day marathon is that nothing much changes around Springfield. The ...

Resources last updated: 11/26/2015 10:34:36 AM