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

RE: Web services



Hello Scott:

Thank you for your answer, Yes the Postdata is a Varying field
D postData        s          40000A   varying  

We are running V6R1 and this is how the Post data Look in the Program and
when is doing the 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|'                                              ;   
                                                                   
rc = http_url_post('https://paytrace.com/api/default.pay?'         
                      : %addr(postData:*DATA)                      
                      : %len(%trimr(postData))                     
                      : '/tmp/httptest.html');                     


Now I do not see the Special character anymore but now Still Paytrace is
sending me the following error below:

ERROR~990. Please provide a properly formatted parameter string.|   


See the attached Text File for the Debug Log 

I really appreciate all your help that you provide to all of us in using
your excellent tool for web services.


Regards,

Carlos Lugo

Multitec Consultants Group Inc.

( 310-717-7327

JCLUGO@xxxxxxxxx

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: Friday, October 12, 2012 3:51 PM
To: HTTPAPI and FTPAPI Projects
Subject: 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]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]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('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
>
>     JCLUGO@xxxxxxxxx
>
> References
>
>     1.
https://paytrace.com/api/default.pay?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|
>     2. https://paytrace.com/api/default.pay
>
>
>
> ----------------------------------------------------------------------
> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> ----------------------------------------------------------------------
> -

 ************Beginning of data**************                                    
HTTPAPI Ver 1.23 released 2008-04-24                                            
OS/400 Ver V6R1M0                                                               
                                                                                
New iconv() objects set, PostRem=819. PostLoc=0. ProtRem=819. ProtLoc=0         
http_url_post(): entered                                                        
http_persist_open(): entered                                                    
http_long_ParseURL(): entered                                                   
DNS resolver retrans: 2                                                         
DNS resolver retry  : 2                                                         
DNS resolver options: x'00000136'                                               
DNS default domain: AS400PVFT.COM                                               
DNS server found: XXX.XXX.XXX.XXX                                                  
DNS server found: XXX.XXX.XXX.XXX                                                  
DNS server found: XXX.XXX.XXX.XXX
https_init(): entered                                                           
--------------------------------------------------------------------------------
Dump of local-side certificate information:                                     
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Dump of server-side certificate information:                                    
--------------------------------------------------------------------------------
Cert Validation Code = 6000                                                     
-----BEGIN CERTIFICATE-----                                                     
MIIFyjCCBLKgAwIBAgIRAJgVqM3YiRF9rUyUjxYUqQUwDQYJKoZIhvcNAQEFBQAw                
fzELMAkGA1UEBhMCVVMxCzAJBgNVBAgTAlVUMRcwFQYDVQQHEw5TYWx0IExha2Ug                
Q2l0eTEeMBwGA1UEChMVVGhlIFVTRVJUUlVTVCBOZXR3b3JrMSowKAYDVQQDEyFV                
U0VSVHJ1c3QgTGVnY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MCcwJQYIKwYBBQUHAgEWGWh0dHBzOi8vY3BzLnVzZXJ0cnVz     
dC5jb20wSwYDVR0fBEQwQjBAoD6gPIY6aHR0cDovL2NybC51c2VydHJ1c3QuY29t     
L1VTRVJUcnVzdExlZ2FjeVNlY3VyZVNlcnZlckNBLmNybDB9BggrBgEFBQcBAQRx     
MG8wRgYIKwYBBQUHMAKGOmh0dHA6Ly9jcnQudXNlcnRydXN0LmNvbS9VU0VSVHJ1     
c3RMZWdhY3lTZWN1cmVTZXJ2ZXJDQS5jcnQwJQYIKwYBBQUHMAGGGWh0dHA6Ly9v     
Y3NwLnVzZXJ0cnVzdC5jb20wJwYDVR0RBCAwHoIOKi5wYXl0cmFjZS5jb22CDHBh     
eXRyYWNlLmNvbTANBgkqhkiG9w0BAQUFAAOCAQEAyks6DYf3OKKyhZuCa5dqSu3b     
KOR2bjjt1TFOcJAkBGf04S1EV2u4yYv1xUCz1ybwJ3ugJYrOKwcAuc+dJXm8aTYw     
Qo8hcUmBg5SrGf/Hka/NtBlnXcVH8JU4y15yUTZXjOXD0UeRfnTuIzw22atPKDRw     
cN6OeMsSwAS4bsZ+5bF7Vz2AvyRx8xfX9YpY/iofsMAnI0xCYVBqoj8+bE9XMOJu     
EQRK5f6cTffN91EKkZd3TpT17L17Aip8LuTRGkfoqen8lvq/oAanSkrt+qoM05Kl     
pkjJ0rEoZeSGqp44KqE1ukPyuNH57k/LmYsXh3ka6vAjwCkS/GG7fEIWhLhqaQ==     
-----END CERTIFICATE-----                                            
Serial Number: 00:98:15:A8:CD:D8:89:11:7D:AD:4C:94:8F:16:14:A9:05    
Common Name: *.paytrace.com                                                     
Country: US                                                                     
State/Province: WA                                                              
Locality: Vancouver                                                             
Org Unit: PayTrace, LLC                                                         
Org: PremiumSSL Legacy Wildcard, OU=Issued through PayTrace, LLC E-PKI Manager, OU=PayTrace Payment Gateway                                                                          
PostalCode: 98668                                                               
Issuer CN: USERTrust Legacy Secure Server CA                                    
Issuer Country: US                                                              
Issuer State/Province: UT                                                       
Issuer Locality: Salt Lake City                                                 
Issuer Org: The USERTRUST Network                                               
Version: 03                                                                     
not before: 20111020000000 
not after: 20140117235959                                  
pub key alg: 1.2.840.113549.1.1.5                          
                                                           
Protocol Used: TLS Version 1                               
http_persist_post(): entered                               
http_long_ParseURL(): entered                              
do_post(): entered                                         
POST /api/default.pay? HTTP/1.1                            
Host: paytrace.com                                         
User-Agent: http-api/1.23                                  
Content-Type: text/xml                                     
Expect: 100-continue                                       
Content-Length: 183                                                                                             
                                                                                
recvresp(): entered                                                             
HTTP/1.1 100 Continue                                                           
                                                                                
                                                                                
SetError() #13: HTTP/1.1 100 Continue                                           
senddoc(): entered                                                              
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|                                                                                                                                                                                                                                                  
recvresp(): entered                                                             
HTTP/1.1 200 OK                                                                 
Connection: close                                                               
Date: Mon, 15 Oct 2012 16:45:03 GMT                                             
Server: Microsoft-IIS/6.0                                                       
X-Powered-By: ASP.NET                                                           
Content-Type: text/html                                                      
Set-Cookie: ASPSESSIONIDAADAQTCC=DCBGMNNBCPKMKHOKIHGAEIBA; path=/            
Cache-control: private                                                       
                                                                             
                                                                             
SetError() #13: HTTP/1.1 200 OK                                              
recvdoc parms: identity 0                                                    
header_load_cookies() entered                                                
cookie_parse() entered                                                       
cookie =  ASPSESSIONIDAADAQTCC=DCBGMNNBCPKMKHOKIHGAEIBA; path=/              
cookie attr aspsessionidaadaqtcc=DCBGMNNBCPKMKHOKIHGAEIBA                    
cookie attr path=/                                                           
recvdoc(): entered                                                           
SetError() #0:                                                               
ERROR~990. Please provide a properly formatted parameter string.|          
SetError() #44: CommSSL_read:  connection broken                           
http_close(): entered                                                      
 ************End of Data********************                               






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