InvalidOperationException: ‘date’ is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

InvalidOperationException: ‘date’ is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

You will get this error while consuming a webservice in BizTalk.

To resolve this, you need to make some changes to the WSDL file that you got from your business partner/department. Take the WSDL file and search for nillable=”true” type=”xsd:date”

Remove the nillable property for the date fields. This is because .Net doesnt support nillable date fields.

There is also one more option, instead of removing the nillable property, you can change the xsd:date type to xsd:datetime. This datatype in .Net will allow nullable implementation.

Downside:

You will have to keep in mind, that if the partner/department updates the WSDL file then you need to do the above change before you generate the proxies out of this WSDL.

Shankar

Advertisements

One thought on “InvalidOperationException: ‘date’ is an invalid value for the SoapElementAttribute.DataType property. The property may only be specified for primitive types.

  1. I had the same problem when I was consuming a Java webservice with c#. This is a really bad behaviour of the WSDL-generator!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s