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

Example 18 and an Unparsed Character Response



Hello, everyone!

I'm using Example 18 of HTTPAPI to consume a web service that returns
prescription data on a client (we are an insurance company).

The web service requires that the data is sent in a soap wrapper, and
that the main request (variable strVar), is unparsed. Here is what my
SOAP request looks like:

SOAP =

 '<?xml version="1.0" encoding="UTF-8"?>'

+'<soapenv:Envelope '

+%trim('    xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";')

+' xmlns:eos="http://QuestWebServices/EOService";>'

+'<soapenv:Header />'

+'<soapenv:Body>'

+'  <eos:DeliverExamOneContent>'

+'    <eos:username>username</eos:username>'                    
+'    <eos:password>password</eos:password>'

+'    <eos:destinationID>RX</eos:destinationID>'

+'    <eos:payload><![CDATA['

+ %trim(strVar)

+']]></eos:payload>'

+'</eos:DeliverExamOneContent>'

+'</soapenv:Body>'

+'</soapenv:Envelope>';


This is working very well, but it's the response (INCOMING) I need to
ask your advice on. 

In the response, the data I want is in an unparsed piece between the
tags <DeliverContentResult> and </DeliverContentResult>. I was hoping it
would be returned as nicely formatted XML, but that's not the case. The
response looks like this--

<?xml version="1.0" encoding="utf-8"?><soap:Envelope
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:xsd="http://www.w3.org/2001/XMLSchema";><soap:Body><DeliverContentR
esponse xmlns="http://somewebservice/service";>

<DeliverContentResult>

&lt;ReturnValues&gt;&lt;TransactionID&gt;7106c824-6cbd-4dec-aacd-94745f3
a5802&lt;/TransactionID&gt;&lt;ResponseCode&gt;1&lt;/ResponseCode&gt;&lt
;ResponseCodeText&gt;Route completed
successfully&lt;/ResponseCodeText&gt;&lt;ResponseMessage&gt;&lt;TXLife
xmlns="http://ACORD.org/Standards/Life/2";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xsi:schemaLocation="http://ACORD.org/Standards/Life/2
TXLife2.19.00.xsd"&gt;&lt;TXLifeRequest
PrimaryObjectID="ID_1"&gt;&lt;TransRefGUID&gt;TES099912301-2010-12-0616:
24:41&lt;/TransRefGUID&gt;&lt;TransType tc="1122"&gt;General Requirement
Status/Results
Transmittal&lt;/TransType&gt;&lt;TransExeDate&gt;2010-12-10&lt;/TransExe
Date&gt;&lt;TransExeTime&gt;15:21:12&lt;/TransExeTime&gt;&lt;TransMode
tc="2"&gt;Original&lt;/TransMode&gt;&lt;NoResponseOK tc="1"
/&gt;&lt;OLifE&gt;&lt;SourceInfo&gt;&lt;SourceInfoName&gt;DataCentral&lt
;/SourceInfoName&gt;&lt;/SourceInfo&gt;&lt;Party
id="ID_1"&gt;&lt;PartyTypeCode
tc="1"&gt;Person&lt;/PartyTypeCode&gt;&lt;PartyKey&gt;ID_1&lt;/PartyKey&
gt;&lt;GovtID&gt;123456789&lt;/GovtID&gt;&lt;Person&gt;&lt;FirstName&gt;
KIMBERLEE&lt;/FirstName&gt;&lt;LastName&gt;TESTINGTHIS&lt;/LastName&gt;&
lt;BirthDate&gt;1944-10-12&lt;/BirthDate&gt;&lt;/Person&gt;&lt;Address&g
t;&lt;AddressTypeCode
tc="1"&gt;Home&lt;/AddressTypeCode&gt;&lt;Zip&gt;83605&lt;/Zip&gt;&lt;/A
ddress&gt;&lt;Carrier /&gt;&lt;Risk&gt;&lt;PrescriptionDataStatus
tc="1"&gt;An order has already been sent, but our provider has not
responded yet.  Please consult with your system admin for service
hours.&lt;/PrescriptionDataStatus&gt;&lt;/Risk&gt;&lt;/Party&gt;&lt;/OLi
fE&gt;&lt;/TXLifeRequest&gt;&lt;/TXLife&gt;&lt;/ResponseMessage&gt;&lt;/
ReturnValues&gt;

</DeliverContentResult></DeliverContentResponse></soap:Body></soap:Envel
ope>

Do you have any suggestions for parsing this unparsed data? There's
probably some really cool API or something that I'm not aware of?

Thanks so much for your feedback---I've gotten SO much use out of
HTTPAPI, and since attending Scott's classes at COMMON last Spring in
Orlando, my boss is now on board with HTTPAPI, too!

Kim Gibson

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