Page 1 of 1

Sending Array to WSDL

Posted: Wed Aug 29, 2007 12:12 pm
by dspxguy
I have input as in one record I will have 3 phone numbers--->
phone0
phone1
phone2
3 input phone number from one row in to one column
I have to send all the phone numbers from one record in one call to WSDL so that WSDL can take them in to one phone(array) then WSDL should be updated for example like the below
- <Phones>
<Phone>
<Type />
<Number>phone0</Number>
</Phone>
<Phone>
<Type />
<Number>phone1</Number>
</Phone>
<Phone>
<Type />
<Number>phone2</Number>
</Phone>
</Phones>
In my job I have a sequential file-->web services trnsformer-->sequential file.
The web service will validate the information I am sending and will give me an ID which I will store in the output file.
Thanks in advance for the help...........

Re: Sending Array to WSDL

Posted: Wed Aug 29, 2007 12:34 pm
by sud
Use a transformer before the web services transformer to create the input xml for the web service. In this transformer concatenate the xml tags for each phone number until you have all the phone numbers and then push out the consolidated xml.

I am not clear about how you are getting the data though. How are you getting all phone numbers in the same column.

Re: Sending Array to WSDL

Posted: Wed Aug 29, 2007 3:25 pm
by dspxguy
I concatinated the phonenumbers with space.....xmltags....they didn't work
so i tried with
Make vector...I got the following error message
Web_Services_Transformer: Error when checking operator: When binding input interface field "Number" to field "Number": Fixed-length vectors have differing lengths.
Then i tried Make subrecords.....I got the following error message
Web_Services_Transformer: Error when checking operator: Input "Number" is not a value field.

when i used XML Tags the tags are being converted to some charecters and displays all number in between one tag in one string.
<Phones>
<Phone>
<Type />
<Number>phone0!&phone1!&phone2</Number>
</Phone>
<Phone>
<Type />
</Phones>

Re: Sending Array to WSDL

Posted: Wed Aug 29, 2007 5:47 pm
by sud
Well so the problem is that the web services stage is throwing errors. Try this, the xml data that you are creating change the "<" to "<" and ">" into ">".

Re: Sending Array to WSDL

Posted: Thu Aug 30, 2007 2:28 pm
by dspxguy
sud wrote:Well so the problem is that the web services stage is throwing errors. Try this, the xml data that you are creating change the "<" to "<" and ">" into ">".
I tryed that i got follewong meesage in WSDL
<Number>3232962643&lt;Phone&gt;&lt;Type /&gt;&lt;Number&gt;0000000000&lt;/Number&gt;&lt;/Phone&gt;&lt;/Phones&gt;</Number>

My actual code is
PNumber:"<Phone><Type /><Number>":LNK_TRN_Split.BP1WKP:"</Number></Phone></Phones>"
Pnumber and LNK_TRN_Split.BP1WKP are phone numbers