[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Web services
Hi Carlos,
My guess would be that postData is a VARYING field. This is just a
guess, because you did not include the definition of this field in your
message, but it would explain the behavior you're seeing.
VARYING fields are stored in memory as a 2 or 4 byte unsigned integer
that keeps track of the current length of the field, followed by the
actual characters in the field. So if your postData variable is 65535
long or shorter, the first two bytes in memory would be the length.
When you pass %addr(postData) to HTTPAPI, the address you're supplying
points to those length bytes, so HTTPAPI dutifully sends those length
bytes to the server.
That's why in some of my examples, you'll see me do: %addr(myVar) +
2. The +2 provides an address that's two bytes higher -- i.e. it
skips over those two length bytes. On V6R1 and higher, IBM gave us a
way to do that automatically with %ADDR(myVar:*DATA), which is better
because it's more self-documenting.
Anyway, try changing your code to %ADDR(postData: *DATA) or if you're
still on V5R4 or earlier, do %ADDR(postData)+2 and see if that solves
the problem.
Good luck!
On 10/12/2012 1:48 PM, J. Carlos Lugo wrote:
Hello All:
I am submitting a HTTP Post to Pay Trace web services but when pay
trace received my Data String shows a weird character
Here is the Data String submitted to Pay Trace
Hello, and thank you for contacting Pay Trace.
We can see ' ¬- ' before the parmlist. Beyond that it is formatted
correctly. Here is the same information without the ' ¬- ' in there
which works correctly when submitted through a browser.
[1][1]https://paytrace.com/api/default.pay?parmlist=UN~demo123|PSWD~demo12
3|TERMS~Y|METHOD~ProcessTranx|TRANXTYPE~Authorization|CC~40128818888188
88|EXPMNTH~12|EXPYR~12|AMOUNT~1.00|CSC~999|BADDRESS~1234|BZIP~83852|INV
OICE~8888|
HERE is your string
[2][2]https://paytrace.com/api/default.pay?
¬-parmlist=UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ProcessTranx|TRANXTYP
E~Authorization|CC~4012881888818888|EXPMNTH~12|EXPYR~12|AMOUNT~1.00|CSC
~999|BADDRESS~1234|BZIP~83852|INVOICE~8888|
Here is what I have in the program to test the HTTP Post
postData =
'parmlist=' +
'UN~demo123|PSWD~demo123|TERMS~Y|METHOD~ProcessTranx|' +
'TRANXTYPE~Authorization|CC~4012881888818888|EXPMNTH~12|' +
'EXPYR~12|AMOUNT~1.00|CSC~999|BADDRESS~1234|BZIP~83852|' +
'INVOICE~8888|'+ CRLF ;
rc = http_url_post('[3]https://paytrace.com/api/default.pay?'
: %addr(postData)
: %len(%trimr(postData))
: '/tmp/httptest.html');
Any advise will be appreciate it if I am using the right HTTP_URL_POST
or should I use a Different POST Process to void the character that
they Pay trace found in my data string.
http_url_post_raw?
Regards,
Carlos Lugo
Multitec Consultants Group Inc.
( 310-717-7327
[4]JCLUGO@xxxxxxxxx
References
1. [5]https://paytrace.com/api/default.pay?parmlist=UN~demo123|PSWD~demo123|T
ERMS~Y|METHOD~ProcessTranx|TRANXTYPE~Authorization|CC~4012881888818888|EXPMNTH~1
2|EXPYR~12|AMOUNT~1.00|CSC~999|BADDRESS~1234|BZIP~83852|INVOICE~8888|
2. [6]https://paytrace.com/api/default.pay
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
[7]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
References
1. https://paytrace.com/api/default.pay?parmlist=UN~demo123
2. https://paytrace.com/api/default.pay
3. https://paytrace.com/api/default.pay
4. mailto:JCLUGO@xxxxxxxxx
5. https://paytrace.com/api/default.pay?parmlist=UN~demo123
6. https://paytrace.com/api/default.pay
7. 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
-----------------------------------------------------------------------