cancel
Showing results for 
Search instead for 
Did you mean: 

Validate dateTime value in Proxy

Former Member
0 Kudos

Hi, I've created a deployable proxy to consume a .NET web service, the comunication is working fine but it is sending dateTime values in this format:

2006-06-01T12:00:00.0000000

which I think it is not standard but the company cannot change this. The error message that the servlet which consumes this web services show this error:

Ex=java.rmi.RemoteException: Service call exception; nested exception is:

com.sap.engine.services.webservices.jaxrpc.exceptions.XmlUnmarshalException: XML Deserialization Error. Can not create instance of [java.util.Calendar] from string [2006-06-01T12:00:00.0000000] with schema type [http://www.w3.org/2001/XMLSchema][date].

My question is, there's any way to catch this error and parse the string (I've heard of customb serializer and wrappers) before it stops running the program?

Regards

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

hi there,

obviously you get data of type 'dateTime' in a field typed as date. See <a href="http://www.w3.org/TR/xmlschema-2/#dateTime">this</a> for reference.

This is clearly a bug of the service.

I'd try to download the Service's WSDL, edit date into dateTime and recreate the proxy based on this WSDL.

I think that should work as a workaround.

regards,

anton

Former Member
0 Kudos

Hi Anton, very helpful answear, you were write, the WSDL definition has the definition:

<s:element minOccurs="0" maxOccurs="1" name="FechaExpiracionLote" type="s:date"/>

and the value that is coming is a dateTime.

But now, How can I download the complete wsdl definition from the server? My generate deployable proxy created a file called "wsdlroot_1_1_0.wsdl" is this the same one that is in the server? Can I edit this, save it locally and generate the client proxy from this one?

What things do I have to edit in it in order generate the client again??

Regards

Former Member
0 Kudos

hi,

enter the WSDL's URL into a webbrowser. If you use IE you'll see it formatted. Right click and select View Source. Now you see the WSDL in plain text. Use File->Save to save it to your hard disk. Edit it with the the browser of your choice.

Now create a webservice client (proxy) based on that file on your harddisk (I suppose you have got some option to either load a WSDL from an URL or a local file).

Hope this helps.

anton

Former Member
0 Kudos

Perfecto Anton, That solved the problem!

I downloaded the WSDL and edited the field which was wrong. After this, I deleted the Logical Port from the Client Proxy and created a new one (trying to do it with the same package name and Proxy name, so you don't have to change all the EAR application and the JNDI names).

You made my day.

Thanks and best Regards.

Answers (0)