Hi
We have some coade that makes a soap call using Rolands Stuff, the importnat part is the message header, see below.
Blob lblob_data, lblob_response
string ls_mimetype, ls_response, ls_return, ls_test
Integer li_rc, li_fnum
ULong lul_length
n_winhttp ln_http
// Validate data is set up correctly
if isnull(is_username) or isnull(is_password) or isnull(is_hotel) or isnull(is_hotel_code) then return false
if trim(is_username) = '' or trim(is_password) = '' or trim(is_hotel) = '' or trim(is_hotel_code) = '' then return false
if isnull(as_message) or trim(as_message) = '' then return false
// Get a new messageid
of_messageid( long(string(today(), 'yyyymmdd')), long(string(now(),'hhmmss')), 999, 1234, 10000001)
// Build Message
lblob_data = blob(of_message_header(true) + &
'' + &
'' + as_message + '', EncodingANSI!)
// Get mimetype
ls_mimetype = ln_http.GetMIMEType('', lblob_data)
// Store the XML for now
ls_test = string(lblob_data, EncodingANSI!)
// Post SOAP Call
lul_length = ln_http.Postsoap(of_url(), &
lblob_data, ls_mimetype, lblob_response,'OTA_PMS')
If lul_length > 0 Then
// Data Returned
ls_response = String(lblob_response, EncodingAnsi!)
if pos(ls_response, 'Success') > 0 then
ls_return = mid(ls_response, pos(ls_response, 'EchoData>') + 9, pos(mid(ls_response, pos(ls_response, 'EchoData>') + 10), '<') )
if ls_return = as_message then
Return True
end if
end if
as_message = of_geterror(ls_response)
return false
End If
ln_http.getlasterror( )
as_message = ln_http.lasterrortext
Return False
-------------------------------------------------------------------------------------------------------------------------------
Important bit, Message header function
string ls_header
long ll_cnt
string ls_mimetype, ls_response, ls_test
n_winhttp ln_http
ulong lul_length
of_messageid( long(string(today(), 'yyyymmdd')), long(string(now(),'hhmmss')), 999, 1234, 10000001)
ls_header = '' + &
'
'xmlns:ns ="http://www.opentravel.org/OTA/2003/05" ' + &
'xmlns:oas ="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" ' + &
'xmlns:add ="http://schemas.xmlsoap.org/ws/2004/08/addressing">' + &
'' + &
'
ls_header += ':mustUnderstand = "1">'
ls_header += '' + is_username + '' + &
'' + is_password + '' + &
' ' + &
'' + is_messageid + ' '
ls_header += 'http://www.myhotel.com/ws/ota' + &
'http://www.myhotel.com/ws/ota/OTA_ReadRQ' + &
'http://schemas.xmlsoap.org/ws/2004/12/addressing/role/anonymous'
ls_header += ' '
return ls_header
Hope that this helps.
i don't know how to reduce the message size. they provide a web service, and give us a tip about how to call the method. one of the parameters is a long xml string. i think maybe only sum those formatted tags will over 1024.
i have to say , PB is not a popular develop IDE here any more, and most of the young even never hear about it . that's why they only give a .Net solution. but my program was developed in PB. :(