How to pass parameters in outbound SOAP web service using script??

Prasun
Giga Guru

we have an outbound SOAP connection and the xml is like below:

<PartyInteractionRole>

            <!--Optional:-->

                            <CustomerContact>

                                  <!--Optional:-->

                                  <emailAddress>${emailAddress}</emailAddress>

                                  <IndividualName>

                                        <!--Optional:-->

                                        <firstName>${firstName}</firstName>

                                        <!--Optional:-->

                                        <lastName>${lastName}</lastName>

                                  </IndividualName>

                                  <!--Optional:-->

                                  <ContactMedium>

                                        <!--Optional:-->

                                        <emailAddress>${emailAddress}</emailAddress>

                                        <!--Optional:-->

                                        <cellNumber>${cellNumber}</cellNumber>

                                  </ContactMedium>

                            </CustomerContact>

                      </PartyInteractionRole>

We have two emailAddress field and two of them under different xml tag, my question is how to set a parameter like below script so that I can send only under ContactMedium tag?

because if I do it like below script, all the variables named emailAddress was replaced with the value.

var s = new SOAPMessage('SOAPRequest', 'SOAPFunction');

  s.setStringParameter('emailAddress', "abc@example.com"));

Can someone help?

2 REPLIES 2

Chuck Tomasi
Tera Patron

Hi Prasun,



You have to use unique symbols in this case to do the replacement independently. There is no other way to say "replace one and not the other" if both are identical. It's a simple search/replace going on.


Atul Kumar2
Giga Guru

Hi Prasun, You should remove the element from the envelope of function of the web service entry. and keep only specific element which is required and save it. it will work. Regards, Atul Kumar