|
Hi Scott
This is the complete program .. (I copied you EXAMPLE16)
*
H DFTACTGRP(*NO) BNDDIR('HTTPAPI':'QC2LE')
D EXAMPLE16A PR ExtPgm('EXAMPLE16A')
D Msg 128A const
D EXAMPLE16A PI
D Msg 128A const
/copy httpapi_h
D StartOfElement 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 EndOfElement PR
D UserData * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D attrs * dim(32767)
D const options(*varsize)
D CRLF C CONST(x'0D25')
D SOAP s 32767A varying
D rc s 10I 0
D rate s 8F
D Result s 12P 2
/free
if ( %parms < 1 );
http_comp( 'Please pass parms. e.g. CALL EXAMPLE16A'
+ 'PARM( Message )');
return;
endif;
// Note: http_debug(*ON/*OFF) can be used to turn debugging
// on and off. When debugging is turned on, diagnostic
// info is written to an IFS file named
// /tmp/httpapi_debug.txt
http_debug(*ON);
// Note: http_XmlStripCRLF(*ON/*OFF) controls whether or not
// the XML parser removes CR and LF characters from the
// Xml data that's passed to your 'Incoming' procedure.
http_XmlStripCRLF(*Off);
SOAP =
// '<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>'
' <?xml version="1.0"?>'
+ ' <soapenv:Envelope xmlns:soapenv='
+ '"http://schemas.xmlsoap.org/soap/envelope/"'
+ ' xmlns:mob="http://api.mobyt.it/mobws">'
+ ' <soapenv:Header/> '
+ ' <soapenv:Body> '
+ ' <mob:sendSMS> '
+ ' <|--Optional:--> '
+ ' <username>myuser</username> '
+ ' <|--Optional:--> '
+ ' <password>mypsw</password> '
+ ' <|--Optional:--> '
+ ' <message_type>N</message_type> '
+ ' <|--Optional:--> '
+ ' <sender>test</sender> '
+ ' <|--Optional:--> '
+ ' <recipient>myphonenbr</recipient> '
+ ' <|--Optional:--> '
+ ' <message>Hi</message> '
+ ' <|--Optional:--> '
+ ' <order_id>?</order_id> '
+ ' </mob:sendSMS> '
+ ' </soapenv:Body> '
+ '</soapenv:Envelope>' ;
http_debug(*ON);
rc = http_url_post_xml('http://api.mobyt.it:80/mobws'
: %addr(SOAP:*DATA)
: %len(SOAP)
: *NULL
: *NULL
: *NULL
: HTTP_TIMEOUT
: HTTP_USERAGENT
: 'text/xml; charset=UTF-8');
if (rc <> 1);
http_crash();
else;
// Result = %dech(Amount * rate: 12: 2);
// http_comp(%trim(Country1) + ' ' + %char(%dec(Amount:12:2))
// + ' = ' + %trim(Country2) + ' '+ %char(Result));
endif;
*inlr = *on;
/end-free
P StartOfElement B
D StartOfElement 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
/end-free
P E
P EndOfElement B
D EndOfElement PI
D UserData * value
D depth 10I 0 value
D name 1024A varying const
D path 24576A varying const
D value 65535A varying const
D attrs * dim(32767)
D const options(*varsize)
/free
/end-free
P E
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.