Unable to add a date in the SOAPElement while calling a web service
lakshmi desai
Greenhorn
Joined: Feb 28, 2008
Posts: 16
posted
0
I have written a java client that consumes .NET web service. The web service takes few string values and a date which is type DATE. The xsi:type is "date".I am using SOAPElement to add all the input values, but I cannot add the date field, since it accepts only string and I get the below exception:
Can somebody help me with this?how I can pass the date value?
Exception in thread "main" AxisFault faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Client faultSubcode: faultString: Server was unable to read request. ---> There is an error in XML document (1, 801). ---> String was not recognized as a valid DateTime. faultActor: faultNode: faultDetail: {http://xml.apache.org/axis/}stackTrace:Server was unable to read request. ---> There is an error in XML document (1, 801). ---> String was not recognized as a valid DateTime. at org.apache.axis.message.SOAPFaultBuilder.createFault(SOAPFaultBuilder.java:222) at org.apache.axis.message.SOAPFaultBuilder.endElement(SOAPFaultBuilder.java:129) at org.apache.axis.encoding.DeserializationContext.endElement(DeserializationContext.java:1087) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl.parse(Unknown Source) at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227) at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696) at org.apache.axis.Message.getSOAPEnvelope(Message.java:435) at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:62) at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206) at org.apache.axis.client.Call.invokeEngine(Call.java:2784) at org.apache.axis.client.Call.invoke(Call.java:2767) at org.apache.axis.client.Call.invoke(Call.java:1910) at com.ess.vv.util.TestWeb.callUsingCustomEnvelope(TestWeb.java:196) at com.ess.vv.util.TestWeb.main(TestWeb.java:83)
Thanks in advance.
Dan Drillich
Ranch Hand
Joined: Jul 09, 2001
Posts: 1121
posted
0
Hi Lakshmi,
Can you show us please the SOAP request?
Regards, Dan
William Butler Yeats: All life is a preparation for something that probably will never happen. Unless you make it happen.
Maybe it's a DateTime problem related to this thread.
Hope that helps... Aloha, Doug
-- Nothing is impossible if I'mPossible
lakshmi desai
Greenhorn
Joined: Feb 28, 2008
Posts: 16
posted
0
Dan,
Its a valid xml schema definition.
Doug,
I have gone through the thread and mine is different. I need to send a date value to the web service adding it as a SOAPElement.
Thanks for your reply.
Dan Drillich
Ranch Hand
Joined: Jul 09, 2001
Posts: 1121
posted
0
Originally posted by lakshmi desai: Dan,
Its a valid xml schema definition.
Oh - please check it :roll: [ May 06, 2008: Message edited by: Dan Drillich ]
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
Originally posted by lakshmi desai: {http://xml.apache.org/axis/}stackTrace:Server was unable to read request. ---> There is an error in XML document (1, 801). ---> There is an error in XML document (1, 801). ---> String was not recognized as a valid DateTime.
Thanks Peer, it worked. I am not getting the error message now. I am working on the other part of it and if I need any help I will post my problem....Thanks again for your suggestion....
Peer Reynders
Bartender
Joined: Aug 19, 2005
Posts: 2906
posted
0
Originally posted by Dan Drillich: {http://tempuri.org/Request.xsd} doesn't seem to point to an XML Schema Definition.
It doesn't have to. Namespace names are URIs (Universal Resource Identifier), not URLs (Universal Resource Locators). It isn't mandatory that somebody publish the schema at the identical URL. It is the schemaLocation attribute that is used to identify the location of the schema. And that isn't always used either because tools rather use their own configured location so that they can use a cached version, rather that accessing the schema over the network every time they need it.
It is however sloppy to use the tempuri.org domain. Tools like Visual Studio .NET always use this as the default - it is supposed to be replaced with the domain name of your organization in order to avoid global (as in the whole internet) namespace collisions. "tempuri.org" roughly stands for "temporary uri for your organization" - i.e. "place your organization's domain name here". [ May 06, 2008: Message edited by: Peer Reynders ]