[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Soap Application using http_url_post_xml appears to be skippingAuthentication elements
Good Afternoon,
I am very new to the concepts of xml. Nevertheless, I am trying to
utilize a web service that will assist in the correct configuration of
an international address, hopefully passed from one of our green
screen apps.. The service can be found at
[1]http://validator2.addressdoctor.com/addInteractive/Interactive.asmx
. I have made the connection to the site with the program. What I
see when I debug, though, is that the system works its way through the
path (/soap:Envelope/soap:Body), the next time around, the path reads
/soap:Envelope/soap:Body/ValidateResponse ...... and the message is
"<addInteractiveRequest> tag must be supplied." Does the httpapi_h
source allow for authentication? Pardon my lack of knowledge, but I'm
clueless as to where to go here. My first order of business is to try
to get a response from it, other than the error.
Code looks like this:
H DFTACTGRP(*NO) BNDDIR('HTTPAPI')
/copy httpapi_h
D Outgoing PR
D UserData * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D attrs * dim(32767)
D const options(*varsize)
D Incoming PR
D ValidatedAdd 32767A varying
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 32767A varying const
D attrs * dim(32767)
D const options(*varsize)
D
D Add_SOAPACTION PR
D Header 1024A varying
D UserData * value
D
D DS
D SOAP s 32767a varying
D x s 5s 0
D rc s 10I 0
D String s 2000A varying
D Lang s 32A
D LangMode s 41A varying
D formadd s 300A varying
D ValidatedAdd s 32767A varying
D sact s 5s 0
/free
SOAP =
'<?xml version="1.0" encoding="utf-8"?>'
+'<soap:Envelope'
+' xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">'
+' <soap:Body>'
+' <ad:Validate'
+' xmlns:ad="http://validator2.AddressDoctor.com/'
+ 'addInteractive/Interactive.asmx?WSDL">'
+' <ad:addInteractiveRequest>'
+ '
<ad:Authentication>'
+ '
<ad:CustomerID>108912</ad:CustomerID>'
+ '
<ad:DepartmentID>0</ad:DepartmentID>'
+ '
<ad:Password>dq5Abkcu</ad:Password>'
+ '
</ad:Authentication>'
+ '
<ad:CampaignID>x45s</ad:CampaignID>'
+ ' <ad:JobToken></ad:JobToken>'
+ '
<ad:Parameters>'
+ '
<ad:CountryOfOrigin>COO_USA</ad:CountryOfOrigin>'
+ '
<ad:StreetWithHNO>True</ad:StreetWithHNO>'
+ '
<ad:CountryType>NAME_EN</ad:CountryType>'
+ '
<ad:LineSeparator>LST_LF</ad:LineSeparator>'
+ '
<ad:PreferredLanguage>PFL_NO_CHANGE</ad:PreferredLanguage>'
+ '
<ad:Capitalization>NO_CHANGE</ad:Capitalization>'
+ '
<ad:FormattedAddressWithCompany>False</ad:FormattedAddress'
+
'WithCompany>'
+ '
<ad:ParsedInput>NEVER</ad:ParsedInput>'
+ '
<ad:RemoveDiacritics>False</ad:RemoveDiacritics>'
+ '
</ad:Parameters>'
+ '
<ad:Address>'
+ '
<ad:RecordID>998887</ad:RecordID>'
+ ' <ad:Organization>Platon Data Technology
GmbH</ad:Organization>'
+ '
<ad:Department>Marketing</ad:Department>'
+ ' <ad:Contact>Sascha
Schulz</ad:Contact>'
+ '
<ad:Building></ad:Building>'
+ ' <ad:Street>Röntgenstr.
9</ad:Street>'
+ ' <ad:HouseNumber></ad:HouseNumber>'
+ '
<ad:POBox></ad:POBox>'
+ '
<ad:Locality>Maxdof</ad:Locality>'
+ '
<ad:Postalcode>67133</ad:Postalcode>'
+ '
<ad:Province></ad:Province>'
+ '
<ad:Country>Deutschland</ad:Country>'
+ '
<ad:Residue></ad:Residue>'
+
'<ad:CountrySpecificLocalityLine></ad:CountrySpecificLocalityLine>'
+ '
<ad:DeliveryAddressLines></ad:DeliveryAddressLines>'
+ '
<ad:FormattedAddress></ad:FormattedAddress>'
+ ' </ad:Address>'
+ '
</ad:addInteractiveRequest>'
+'
</ad:Validate>'
+' </soap:Body>'
+'</soap:Envelope>';
http_debug(*ON);
// This tells HTTPAPI to call our subprocedure (in this example,
// the subprocedure is name ADD_SOAPACTION) when assembling the
// HTTP headers to send to the remote server.
http_xproc( HTTP_POINT_ADDL_HEADER
: %paddr(Add_SOAPACTION) );
rc =
http_url_post_xml(
'http://validator2.AddressDoctor.com/addInteractive/Interactive.asmx '
: %addr(SOAP) +
2
:
%len(SOAP)
:
%paddr(Outgoing)
:
%paddr(Incoming)
:
%addr(ValidatedAdd)
:
HTTP_TIMEOUT
: HTTP_USERAGENT
:
'text/xml');
if (rc <>
1);
http_crash();
else;
http_comp(formadd);
endif;
*inlr =
*on;
/end-free
P Outgoing B
D Outgoing PI
D UserData * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D attrs * dim(32767)
D const options(*varsize)
/free
if path = '/TrackResponse/Shipment/Package' and name='Activity';
(THIS IS SIMPLY IN THERE TO ALLOW ME TO TRACK THE PATH IN DEBUG)
sact = sact + 1;
endif;
/end-free
P E
P Incoming B
D Incoming PI
D ValidatedAdd 32767A
varying
D depth 10I 0
value
D name 1024A varying
const
D path 24576A varying
const
D value 32767A varying
const
D attrs *
dim(32767)
D const
options(*varsize)
/free
if (name =
'ValidateResponse');
ValidatedAdd =
value;
endif;
/end-free
P
E
*
P Add_SOAPACTION B
D Add_SOAPACTION PI
D Header 1024A varying
D UserData * value
/free
Header = 'SOAPAction: '
+ 'http://validator2.AddressDoctor.com/'
+ 'addInteractive/Interactive/Validate'
+ x'0d25';
/end-free
P E
Thanks, in advance. Any help would be much
appreciated.
Kevin
References
1. http://validator2.addressdoctor.com/addInteractive/Interactive.asmx
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------