[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Parsing a soap response



EXAMPLE17 probably isn't the easiest to work with in this case. It appears you have a rather simple web service and could simply "read" the elements in a procedure and get the data.

So rather than give you some code, let's explain what is happening.

EXAMPLE17 works with a webservice that returns XML inside of XML. So the program is attempting to pull out the inner XML so that it can parsed easier. The SaveEmbed procedure is doing that. It is pulling out the inner XML and writing it to another place. If you keep debugging the SaveEmbed procedure in YOUR program you will see that Name and Value  will increment through your XML. At some point, you will have to decide what data you are interested in and save it someplace you can access it in your program. In EXAMPLE17 that is happening in procedure embedded.

If you look at EXAMPLE16, it is probably a little more clear. In that program, the parser procedure is called Incoming and it gets control for each element of the XML. When it finds the element it is interested in, it saves the data.

Since this appears to relatively easy Fedex related question, this forum post will probably get you a long way towards your goal and is pretty straight forward:
http://www.scottklement.com/archives/ftpapi/201303/msg00023.html

One thing that appears to be missing here is the declaration for Severity and Delivery. They are probably global variables (top of program) inside a data structure called RESP.

 D RESP            DS                                           
 D   Severity                    25A                   
 D   Delivery                   128A

I had no idea how big the variables needed to be so I just made up the length, but they should be adequate to get the results.



-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Debra Abelow
Sent: Friday, April 12, 2013 10:50 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Parsing a soap response

Good afternoon,
I am receiving the soapfile back from the URL using Httpapi and I don't know how to parse it. (I'm a beginner.)

I'm using example 17 (which returns the bank routing data) as a starting point to parse the data. (see attached).
The soapfile displays correctly.
The SaveEmbed procedure is called. The value in the name field at the beginning of the SaveEmbed procedure is env:Header.

I need to get to the elements beyond that.
I greatly appreciate your help,

Debra Abelow
Systems Analyst/Developer III
Anda Inc.
2915 Weston Road
Weston, FL 33331
1-800-331-ANDA (4784) Ext. 74784
Fax 954-217-4377
Debra.Abelow@xxxxxxxxxxx



-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------