How to send soapRequest field as type="xsd:date" instead of type="xsd:string"

I have an issue, after creating a WSD as consumer and running the connector i noticed one of the fields is getting generated as string in request :

2008-05-09T100:00:00Z

instead as date:

2008-05-09T100:00:00Z

If I generate the soap request using soapUI it generated the request field as date, and if I copy paste the request in soapUI generated by IS and substitue the string with date it works fine, otherwise I get the same soap fault in soapUI as in IS which is:

java.lang.IllegalArgumentException: java.lang.ClassCastException@1cb2466

Is there any way of generating the request with type date instead of string ? I have tried creating the object with java.util.date type and creating string with date contentType but all of them giving me the same result i.e. string type in soap request.

By the way the web service I am calling is RPC(hate the fact but can’t change it) and using :
IS = 7.1.1
OS = SunOS
OS = Platform sparc
OS = Version 5.10

How is the request defined in the WSDL?

In WSDL it is defined as date :

This is an optional field. This element indicates the beginning search date.

Thats is the weird part

What happens if you change that type to xsd:dateTime? The sample value you posted fits that type better.

M

One of the combination i tried was the dateTime i.e. the dataType of the input was string and Content type was “dateTime {XML Schema}” in properties but still request is getting generated as xsi:type=“xsd:string”.

I have told my client to change the field type to string but I am just curious if there is a way to manipulate the data type.

IIRC, there is a Content type property on the property pane to set the the desired encoding to use. You may have already explored that but in case you haven’t I thought I might point it out. The SOAP Developer’s Guide covers encoding in the “Encoding the Input Parameter for the Remote Procedure Call” section in chapter 9. (I’m looking at a 6.1 doc so the section and chapter may now be different.)

To get the encoder to use the Content types from the IS doc type, the targetInputSignature input must be set. Otherwise, it determines the content type from the underlying Java class–and for date that probably won’t do what you want.

HTH.

Thanks Rob, because of some webMethods 7.1 RPC webconnector bug I had to tweak the webconnector little bit including the replacement of “pub.client.soapClient” to “pub.client.soapRPC” to make webservice call. Since in pub.client.soapRPC targetInputSignature and targetOutputSignature are optional i didn’t set them, and after looking into “Encoding the Input Parameter for the Remote Procedure Call”,you mentioned, it is clear why soap request was getting generated with string instead to date even though content Type was set to date in input document.

Thanks for pointing that out and thanks Mark for pointing out few things which didn’t know before.

By the way, the bug I am talking about is that webConnector was adding few prefixes to field tags which weren’t even in the WSDL i.e. <tns2_x003A_requestorId> instead of , I have already opened a ticket for that and I have been told that developers have been included in that request.

I take it that things are now working as desired?

Yes they are.