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

RE: http_url_post_xml problem



I see in the debug file there was a xml parse error.
Since you're using a name space of s I would think you need to setup your envelope, header, and body as follows.

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/";>
<s:Header>
</s:Header>
<s:Body>
</s:Body>

SOAP greatly confuses me, but following this convention has worked for me. 

-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of John Clark(Hotmail)
Sent: Friday, January 23, 2009 8:55 AM
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: http_url_post_xml problem

I am trying to set up a test web service call to a tax calculation program, but I am getting a 500 error.  I am new to using this stuff, so I have no idea what the problem could be.  I have attached the debug log.

Thanks in advance,

John

Here is my test program:

SOAP =                                                               
   '<?xml version="1.0" encoding="UTF-8"?>'                          
+  '<Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/";>'  
+    '<Header>'                                                      
+      '<Security mustUnderstand="1" xmlns:wsse="http://docs.oasis-' 
+                'open.org/wss/2004/01/oasis-200401-wss-wssecurity-' 
+                'secext-1.0.xsd">'                                  
+        '<UsernameToken Id="uuid-90128b0b-6212-4e16-9382-'          
+                       'e55489fa6444-1">'                           
+          '<Username>' + %TRIM(MerchID) + '</Username>'             
+          '<Password Type="http://docs.oasis-open.org/wss/2004/01/' 
+                    'oasis-200401-wssusername-token-profile-1.0'    
+                    '#PasswordText">' + %TRIM(Password)             
+          '</Password>'                                             
+        '</UsernameToken>'                                              
+      '</Security>'                                                     
+    '</Header>'                                                         
+    '<Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; '      
+          'xmlns:xsd="http://www.w3.org/2001/XMLSchema";>'               
                                                                         
+      '<requestMessage xmlns="urn:schemas-cybersource-com:transaction-' 
+                      'data-1.18">'                                     
+        '<merchantID>' + %TRIM(MerchID) + '</merchantID>'               
+        '<merchantReferenceCode>482046C3A7E94F5</merchantReferenceCode>'
+        '<billTo>'                                                      
+          '<street1>1295 Charleston Rd.</street1>'                      
+          '<city>Mountain View</city>'                                  
+          '<state>CA</state>'                                           
+          '<postalCode>94043</postalCode>'                              
+          '<country>US</country>'                                       
+        '</billTo>'                                                     
+        '<item id="0">'                                                 
+          '<unitPrice>100.00</unitPrice>'                                
+          '<quantity>1</quantity>'                                       
+          '<productCode>18902</productCode>'                             
+          '<productName>Test Product</productName>'                      
+          '<productSKU>2B1079</productSKU>'                              
+        '</item>'                                                        
+        '<taxService run="true"/>'                                       
+      '</requestMessage>'                                                
+    '</Body>'                                                            
+  '</Envelope>';                                                         
                                                                          
                                                                          
http_debug(*ON);                                                          
                                                                          
rc = http_url_post_xml(                                                   
           'https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor' 
                  : %addr(SOAP) + 2                                       
                  : %len(SOAP)                                            
                  : *NULL            
                  : %paddr(Incoming) 
                  : *NULL);          
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------