cancel
Showing results for 
Search instead for 
Did you mean: 

conversion xsd:date to xs:date

Former Member
0 Kudos

hi,

i am doing a scenario Webservice1XIWebservice2.i have to send date from webservice1 to webservice2. In webservice1 i am sending currentdate (Form Date Function.) to webservice2(xs:date).

i am getting error as "Invalid date value: wrong type:"

what could be the reason...

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

I think you have to use "DateTrans" function to map correct date format.

Regards,

P.Venkat

Former Member
0 Kudos

thanks for quick response ..

i have used "Date Trans" function in mapping no use.

current date to Date Trans function to Web service date.

any other way to figure out this issue....

Former Member
0 Kudos

Hello azias,

As far as i understand u r target web service needs date value in different format , u will have to convert the current date value in that appropriate format.

Regards,

keith

Former Member
0 Kudos

thanks for quick repsonse

my web service has a data type as xs:date

i am mapping current date to webservice date(xs:date)..

is there any function in XI to convert current date to xs:date format.

Former Member
0 Kudos

Hi,

In date functions you have a "dateTrans" function available for this purpose.

In dateTrans function you need to set the properties. Double click the date trans function, it will open the properties. You need to specify the type you require. Usually its a trial and error method to find the required date type.

Go thro this link:

http://help.sap.com/saphelp_nw04/helpdata/en/2c/2d8c4024d26e1de10000000a1550b0/content.htm

Regards,

P.Venkat

Message was edited by:

Venkataramanan

Former Member
0 Kudos

hi venkat,

i have tried but no use.. i got same wrong type in the response..

i wondering what is the difference between xsd:date and xs:date, becoz my web service defined data type as xs:date and XI has defined data type as xsd:date

is this could be the reason for the error

Former Member
0 Kudos

Hi,

In the datatype, just check the namespace prefix.

xsd and xs are prefixes. Check the 'uri' for these two structures.

i.e the root element will have a attribute xmlns:xsd and in the other one xmlns:xs.

But i dont think this is the reason for the error. There are many different possible ways of representing the date. Try in a SOAP Client, wat type of date is accepted by the webservice, then give that type using 'DateTrans' function.

And also post ur error data fully, so that it will be useful to help you(In moni and message monitoring).

Regards,

P.Venkat

Former Member
0 Kudos

my concern is to send the BAPI date to SOAP Client.

the date type accepted by the SOAP client is xs:date YYYY-MM-DD format . I am using DateTrans function to transfer the format to the SOAP client required but still i am getting this error in sxmb_moni.

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>

- <!-- Request Message Mapping

-->

- <SubmitRequisitionResp xmlns="http://ws.prst.com/sapservice/types" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">

<succeeded>false</succeeded>

- <errors>

<code xmlns="http://ws.prst.com/types">date</code>

<reason xmlns="http://ws.prst.com/types">Invalid date value: wrong type:</reason>

</errors>

</SubmitRequisitionResp>

Former Member
0 Kudos

Hi,

Are you able to test successfully your webservice2 separately in a SOAP client?

Check in test tab of message mapping whether the date is getting poupulated in the required way you need.

Wat abt the other datatypes in webservice2, are they xs: or xsd:?

Regards,

P.Venkat

Former Member
0 Kudos

<i>"Are you able to test successfully your webservice2 separately in a SOAP client?"</i>

Yes able to test successfully

<i>"Check in test tab of message mapping whether the date is getting poupulated in the required way you need.

"</i>

Yes it is populating in the required way only...

<i>"Wat abt the other datatypes in webservice2, are they xs: or xsd:?

"</i>

all are xs: type only......

Former Member
0 Kudos

Hi,

Then the other data types like 'string' are compatible from xsd: to xs: and only the 'date' datatype is giving problems. Is it so?

What data type have you used xsd:date or xsd:datetime?

May be you can try changing to xsd:date or xsd:datetime.

Sorry for asking lot of questions...

Regards,

P.Venkat

Former Member
0 Kudos

hi,

<i>"Then the other data types like 'string' are compatible from xsd: to xs: and only the 'date' datatype is giving problems. Is it so?

"</i>

yes other data types are compatible...

i am using xsd:date...

yes i have tried changing xsd:date and xsd:datetime as well. but i did find any solution ...

i appreciate you for trying your best to solve this issue....

Former Member
0 Kudos

Hi,

Then its not because of xs: and xsd: problem.

Try giving the date also as xsd:string in XI and in the required format(as given while testing). I think the webservice will convert it to required xs:date type.

If this works then, you can give current date as input to a UDF and solve the issue.

Regards,

P.Venkat