Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I am quite new to Talend.
i am using the tSOAP component and if i use the blow flow it works fine.
tsoap --> LogRow
I can paste the SOAP Request message into SOAP Message section of the tsoap node and it works fine..
But now i want to read sql table and dynamically pass the value to SOAP Message of tSOAP component .I tried to produce this but it not work.
to check the dynamic value
insert the dynamic value into the soap message
Any help is really appreciated.
Good!
Are you sure you have no space between ' and " in the SOAP message : it looks like there is a space in your screenshot
it should be :
<country code='" + (String)globalMap.get("coutryCode") + "' />
not (note the spaces between the ' and the " after and before your globalMap.get...:
<country code=' " + (String)globalMap.get("coutryCode") + " ' />
Hi,
the SOAP message content is a String (see the quotes "around it).
You are currently writing the text (String)globalMap.get(countryCode) in your message which is not what you want
You want to concatenates the value of the globale variable countryCode to your message.
Strings concatenation in Java is made with + operator.
You need to use :
".... beginning of your message ... <country code='" + (String)globalMap.get("countryCode") + "' /> .... end of your message ..."
Note how I use quotes to end the fixed String after : <country code='
I then concatenate your variable value
And start a new fixed String for the end of your message : ' />
Regards
Hi lennelei,
i try to update the soap message ,but i get this error :
my bad I took your code and forgot to add the missing quotes!
...globalMap.get("countryCode")...
another error
Could you please post the whole error and the content of the soap message text box?
the error:
juil. 24, 2019 1:28:24 PM com.sun.xml.messaging.saaj.soap.EnvelopeFactory createEnvelope
GRAVE: SAAJ0511: Unable to create envelope from given source
Exception in component tSOAP_5 (myGO_V1)
com.sun.xml.messaging.saaj.SOAPExceptionImpl: Unable to create envelope from given source:
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:148)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:102)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:156)
at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:155)
at xml_project.mygo_v1_0_1.myGO_V1.tDBInput_3Process(myGO_V1.java:969)
at xml_project.mygo_v1_0_1.myGO_V1.runJobInTOS(myGO_V1.java:1491)
at xml_project.mygo_v1_0_1.myGO_V1.main(myGO_V1.java:1342)
Caused by: java.lang.NullPointerException
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.java:176)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:149)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:138)
... 6 more
CAUSE:
java.lang.NullPointerException
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.java:176)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:149)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:138)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:102)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:156)
at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:155)
at xml_project.mygo_v1_0_1.myGO_V1.tDBInput_3Process(myGO_V1.java:969)
at xml_project.mygo_v1_0_1.myGO_V1.runJobInTOS(myGO_V1.java:1491)
at xml_project.mygo_v1_0_1.myGO_V1.main(myGO_V1.java:1342)
CAUSE:
java.lang.NullPointerException
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.lookForEnvelope(SOAPPartImpl.java:176)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:149)
at com.sun.xml.messaging.saaj.soap.EnvelopeFactory.createEnvelope(EnvelopeFactory.java:138)
at com.sun.xml.messaging.saaj.soap.ver1_1.SOAPPart1_1Impl.createEnvelopeFromSource(SOAPPart1_1Impl.java:102)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getEnvelope(SOAPPartImpl.java:156)
at org.talend.soap.SOAPUtil.invokeSOAP(SOAPUtil.java:155)
at xml_project.mygo_v1_0_1.myGO_V1.tDBInput_3Process(myGO_V1.java:969)
at xml_project.mygo_v1_0_1.myGO_V1.runJobInTOS(myGO_V1.java:1491)
at xml_project.mygo_v1_0_1.myGO_V1.main(myGO_V1.java:1342)
[statistics] disconnected
tSOAP Message:
i correct it ...but the response of the tsoap return this xml :
while when i try this with SOAPUI and replace the coutryCode with "I" .it return the correct xml with all the cities of the country.
Good!
Are you sure you have no space between ' and " in the SOAP message : it looks like there is a space in your screenshot
it should be :
<country code='" + (String)globalMap.get("coutryCode") + "' />
not (note the spaces between the ' and the " after and before your globalMap.get...:
<country code=' " + (String)globalMap.get("coutryCode") + " ' />
Thanks, your solution worked