Skip to main content
Announcements
Accelerate Your Success: Fuel your data and AI journey with the right services, delivered by our experts. Learn More
cancel
Showing results for 
Search instead for 
Did you mean: 
JY3
Contributor
Contributor

how to provide the date input variable into tSOAP

Hi experts,

My tSOAP is capturing the input data from text file as below. All other field are okay but I receive the error when I add the date.

0695b00000cfEGMAA2.png

I can process all other variables but I was not able to process the date. I used the below syntax to map the date.

0695b00000cfEVRAA2.png

I'm getting the below error only when I include the date field. Would you please advise me what is the right format for date, logical and numeric variables for SoapUI input?

Starting job DEV_Job_File_To_QAD_PO at 13:20 25/01/2023.

[statistics] connecting to socket on port 3701

[statistics] connected

Jan. 25, 2023 1:20:28 PM com.sun.xml.messaging.saaj.soap.impl.BodyImpl extractContentAsDocument

SEVERE: SAAJ0251: Unable to extract Document from body

Exception in component tSOAP_1 (DEV_Job_File_To_QAD_PO)

com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to extract Document from body

at com.sun.xml.messaging.saaj.soap.impl.BodyImpl.extractContentAsDocument(BodyImpl.java:347)

at org.talend.soap.SOAPUtil.extractContentAsDocument(SOAPUtil.java:192)

at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:159)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.tFileInputDelimited_1Process(DEV_Job_File_To_QAD_PO.java:2390)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.runJobInTOS(DEV_Job_File_To_QAD_PO.java:3279)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.main(DEV_Job_File_To_QAD_PO.java:3108)

Caused by: org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:153)

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:84)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2097)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1548)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1750)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1504)

at com.sun.xml.messaging.saaj.soap.impl.BodyImpl.extractContentAsDocument(BodyImpl.java:338)

... 5 more

CAUSE:

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:153)

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:84)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2097)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1548)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1750)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1504)

at com.sun.xml.messaging.saaj.soap.impl.BodyImpl.extractContentAsDocument(BodyImpl.java:338)

at org.talend.soap.SOAPUtil.extractContentAsDocument(SOAPUtil.java:192)

at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:159)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.tFileInputDelimited_1Process(DEV_Job_File_To_QAD_PO.java:2390)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.runJobInTOS(DEV_Job_File_To_QAD_PO.java:3279)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.main(DEV_Job_File_To_QAD_PO.java:3108)

CAUSE:

org.w3c.dom.DOMException: NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.setName(ElementNSImpl.java:153)

at java.xml/com.sun.org.apache.xerces.internal.dom.ElementNSImpl.<init>(ElementNSImpl.java:84)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.createElementNS(CoreDocumentImpl.java:2097)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1548)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1750)

at java.xml/com.sun.org.apache.xerces.internal.dom.CoreDocumentImpl.importNode(CoreDocumentImpl.java:1504)

at com.sun.xml.messaging.saaj.soap.impl.BodyImpl.extractContentAsDocument(BodyImpl.java:338)

at org.talend.soap.SOAPUtil.extractContentAsDocument(SOAPUtil.java:192)

at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:159)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.tFileInputDelimited_1Process(DEV_Job_File_To_QAD_PO.java:2390)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.runJobInTOS(DEV_Job_File_To_QAD_PO.java:3279)

at precoro_qad.dev_job_file_to_qad_po_0_1.DEV_Job_File_To_QAD_PO.main(DEV_Job_File_To_QAD_PO.java:3108)

[statistics] disconnected

Job DEV_Job_File_To_QAD_PO ended at 13:20 25/01/2023. [Exit code = 1]

Labels (3)
3 Replies
Anonymous
Not applicable

I suspect that this is because you are supplying your date without casting it from an Object (the globalMap returns everything as an Object) AND (more importantly) your Object is essentially a Date and not a String. The SOAP message essentially transfers everything in the form of a String. So with dates, I suspect that the SOAP message will require it to be sent as a String and not a Date.

JY3
Contributor
Contributor
Author

I changed it to

         <urn1:poDueDate>" + (String)globalMap.get("row3.po_due_date") + "</urn1:poDueDate>

 

then I get the below error.

 

Starting job Repeat_of_DEV_File_To_QAD_PO_Header at 23:49 25/01/2023.

[statistics] connecting to socket on port 3437

[statistics] connected

Exception in component tSOAP_1 (Repeat_of_DEV_File_To_QAD_PO_Header)

java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap')

at precoro_qad.repeat_of_dev_file_to_qad_po_header_0_1.Repeat_of_DEV_File_To_QAD_PO_Header.tFileInputDelimited_1Process(Repeat_of_DEV_File_To_QAD_PO_Header.java:2414)

at precoro_qad.repeat_of_dev_file_to_qad_po_header_0_1.Repeat_of_DEV_File_To_QAD_PO_Header.runJobInTOS(Repeat_of_DEV_File_To_QAD_PO_Header.java:3291)

at precoro_qad.repeat_of_dev_file_to_qad_po_header_0_1.Repeat_of_DEV_File_To_QAD_PO_Header.main(Repeat_of_DEV_File_To_QAD_PO_Header.java:3119)

[statistics] disconnected

 

Job Repeat_of_DEV_File_To_QAD_PO_Header ended at 23:49 25/01/2023. [Exit code = 1]

Anonymous
Not applicable

This line here gives you the reason for this.....

 

java.lang.ClassCastException: class java.util.Date cannot be cast to class java.lang.String (java.util.Date and java.lang.String are in module java.base of loader 'bootstrap')

 

The column is a Date column. You cannot cast from Date to String. You will need to change the column to be a String and convert the Date to be formatted as a String before the data is passed to the column. You can use the tConvertType component to do this. This is described here...

 

https://help.talend.com/r/en-US/8.0/processing/tconverttype-standard-properties