cancel
Showing results for 
Search instead for 
Did you mean: 

DateTime element in web service wsdl

Former Member
0 Kudos

Hi all,

I have the following problem.

I want to call a web service that have a datetime element(xsd:dateTime). In VC it appears as D field.

When I fill it with a date , the web service is called with the date I have filled in(and returns an exception), but I need the time too.

So, When I try to fill the date field with a string representing a dateTime ("2001-10-26T21:32:52") I see in the log, that the date field is not filled in and null is sent with the request.

Does anyone know how can i use this type in a VC application?

I use VC 7.1 on CE 4. In the master guide it is written that the DVAL(@TIME_FIELD,XML) can be used, but I get an expression error that I have too many parameters.

best regards,

v s

Edited by: v s on Sep 5, 2008 11:03 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Maybe no solution temporally. If someone has any ideas...

Former Member
0 Kudos

Hi VS,

Is the Web Service created in JAVA?

When I created a Web Service for MS SQL, in the web service itself I had a String defined for the DATETIME field and then in VC I saw the format of the DATETime without any errors.

May be this is something you can try....

Let me know if it helps.

Best regards,

Dharmi

Former Member
0 Kudos

Hi Dharmi,

thanks for the answer.

The web service was defined in esr, then I generated a java skeleton, implemented it and published it on the server (the wsdl contains a xsd:datetime element).

What version of VC are you using? In my version there is only DATE or TIME field , but not DATETIME.

What do you mean by: "in the web service itself I had a String defined for the DATETIME field and then in VC I saw the format of the DATETime without any errors"?

Thanks in advance!

best regards,

v s

Former Member
0 Kudos

Hi VS,

Can you in your Java skeleton, change that field into String?

I am using VC 7.1, there is indeed no DATETIME field. If your Web Service has the String defined say for e.g. for InvoiceDT then in VC Table grid you would see that as Text field but then at runtime you see the exact DATETIME presentation for the InvoiceDT.

Let me know....

Best regards,

Dharmi

Former Member
0 Kudos

Hi Dharmi,

now I can change the java skeleton, but in the future the java implementation wont be on my server and I wont have access to change it. So, I need actually to try to solve my problem on the VC side.

Thanks for the hints though!

Best regards,

v s

Former Member
0 Kudos

Hi VS,

Yes we can try to solve it on VC side then:

Can you please give me exactly what have you in your expresion and whether it is String / date? And also, you are only presenting information form your WS in VC table isn't it?

Have you tried it with WSnavigator and seen what it gives you?

Best regards,

Dharmi

Former Member
0 Kudos

Hi Dharmi,

I have a web service, which I use as data service in VC. I have a form with 2 fields : DATE field @date and TIME field @time. I want to use these fields to call a web service that takes a dateTime as input. When I drag the service to the storyboard, the dateTIme field appears as DATE field. I want to use both the DATE and TIME fields. So I write the following expression:

DSTR(@date, 'YYYY-MM-DD')&"T"&TSTR(@time,'HH:NN:SS') , so I can get 2008-01-01T12:10:10 and sent it. It is not recognized by the date service though.

Best regards,

v s

Former Member
0 Kudos

Hi V.S,

[Here|http://img144.imageshack.us/my.php?image=datetimekb1.jpg] by the screenshot of the working example.

The expression that I have used is :


=DSTR(@DATE1,"XML_DATE")&TSTR(@TIME1,"XML_TIME")

Where,

XML_DATE YYYY-MM-DD 2001-01-31

XML_TIME THH:NN:SS 02:39:40

This should work now. Let me know.

Best regards,

Dharmi

Edited by: Dharmi Tanna on Sep 8, 2008 2:29 PM

Former Member
0 Kudos

Hi Dharmi,

What type is the output field in the example? I could use the expression for outputting to text field, but I can not use it for DATE output field.

Best regards,

v s

Former Member
0 Kudos

Hi VS,

The outputfiled is Text. You can use it for Date output field but then you would only see the date and not the time part since it is the Date UI Element.

Can you not pass this text element to you web Service?

Best regards,

Dharmi

Former Member
0 Kudos

Hi Dharmi,

unfortunately not. I can not pass text field to a DATE field in the web service. A null gets sent when I try to map the text field to the DATE field of the service.

When I use a normal date field to send, its ok and gets sent. But I need the date in exactly this format.

Best regards,

v ss

Former Member
0 Kudos

Hi Dharmi,

I have just read note 1147616 from SAP and it says:

Symptom

A field of type that appears in the ws navigator as DateTime or Duration is treated in VC as Date.

Solution

There is no known workaround for this issue at the moment

That should be my problem. Many thanks for your help!

Best regards,

v s