[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTP request
Sean, thanks for pointing me in the right direction. The URL was not the
problem. I replaced the actual url with "url" and didn't do it the same in
both spots. It appears to be the encoding. I looked at the examples, but
they all seemed to deal with post, not get, where you are setting individual
parameters. I am pretty sure I need to be using a get. So anyway, I put
the whole argument in the encoder, and to my surprise, it worked. Kinda.
After my call to http_url_get_xml, I am getting a -1 in rc. And, my
ParseData routine is not being called. But, when I check the log, I can see
the proper results. Below is my code. Below that is the bottom of the log
file. I am getting a "SetError() #44: CommSSL_read: connection broken"
error.
Any thoughts on why it's returning the -1 and not calling my procedure.
John
------------------------------------------------
xmldata = '<?xml version="1.0"?>'
+ '<PraxellMessage>'
+ '<V2CC_WithdrawRequest AcountType="ATypePrivateLabel">'
+ '<VendorID>1234</VendorID>'
+ '<AcountID>4444333322221111</AcountID>'
+ '<Password>NULL</Password>'
+ '<Amount Currency="USD">'
+ '<TotalAmount>100</TotalAmount>'
+ '</Amount>'
+ '<TargetTrxState>AUTH</TargetTrxState>'
+ '</V2CC_WithdrawRequest>'
+ '</PraxellMessage>';
enc = http_url_encoder_new();
http_url_encoder_addvar(enc:'xmlString'
:%addr(xmldata)+2:%len(xmldata));
http_url_encoder_getptr(enc: encd: size);
http_url_encoder_free(enc);
PostURL = 'https://url/vnv/'
+ 'vendor_transaction.ReceiveXMLmessage?'
+ %TRIM(encodeddata);
rc = http_url_get_xml(PostURL
: *NULL
: %paddr(ParseData)
error = http_error(rc);
rc = https_cleanup();
-------------------------------------------------------------------------------------
Log file
-------
.
.
.
HTTP/1.1
Host: www.sdvsvcard.com
User-Agent: http-api/1.21
recvresp(): entered
<?xml version="1.0" ?><PraxellMessage>
<CC2V_WithdrawResponse>
<Amount Currency="USD">
<TotalAmount>
100
</TotalAmount>
</Amount>
<TransactionID>
0008362742972579
</TransactionID>
<Date>
2009-09-22T07:09:19
</Date>
<TargetTrxState>
AUTH
</TargetTrxState>
<Status StatusCode="PstatOK">
<Description>
Success
</Description>
</Status>
</CC2V_WithdrawResponse>
</PraxellMessage>
SetError() #44: CommSSL_read: connection broken
http_close(): entered
---------------------------------------------------------------
----- Original Message -----
From: "Porterfield, Sean" <SPorterfield@xxxxxxxxxxxxxxxxxxxxxxx>
To: "HTTPAPI and FTPAPI Projects" <ftpapi@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Monday, September 21, 2009 9:31 AM
Subject: RE: HTTP request
>> From: John Clark
>
>> As mentioned, I am trying to duplicate this request:
>
>
>> https://url/vendor_transaction.ReceiveXMLmessage?xmlString=<?xml%20version=%221.0%22?><PraxellMessage><V2CC_WithdrawRequest%20AcountType=%22ATypePrivateLabel%22%20><VendorID>1234</VendorID><AcountID>4444333322221111</AcountID><Password>NULL</Password><Amount%20Currency=%22USD%22><TotalAmount>1000</TotalAmount></Amount><TargetTrxState>AUTH</TargetTrxState></V2CC_WithdrawRequest></PraxellMessage>
>
>
>> My code looks something like this:
>
>
>> URL = 'https://url/vnv/'
> + 'vendor_transaction.ReceiveXMLmessage?xmlString='
> + '<?xml version="1.0"?>'
>
>> GET /vnv/vendor_transaction.ReceiveXMLmessage?xmlString=<?xml
>> version="1.0"?>
>
> I see a couple things that may be problems. Note your request to
> duplicate is http://url/vendor_transaction while your code is
> https://url/vnv/.
>
> Second, you have spaces (and other invalid characters) embedded in the
> URL. You probably want to convert them to valid characters as displayed
> in the URL you're trying to duplicate. I believe there is a URL encoding
> function in HTTPAPI.
> --
> Sean Porterfield
>
> This email is confidential, intended only for the named recipient(s) above
> and may contain information that is privileged. If you have received this
> message in error or are not the named recipient(s), please notify the
> sender immediately and delete this email message from your computer as any
> and all unauthorized distribution or use of this message is strictly
> prohibited. Thank you.
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list. To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------