Skip to Content
0

Send the XML in PowerBuilder 12.6 classic(PB 12 classic - consume RESTFUL service)

Sep 26, 2017 at 08:58 PM

113

avatar image
Former Member

Hi Former Member,

As per your suggested code I am using the standard user object n_cst_internet with Blob datatype and pass the XML in Blob. But problem is I am not able to get the value in Blob data type and getting null exception value JDBC . I am using below code.

MSXML.

MSXML:

loo_xmlhttp = CREATE oleobject

// make a connection to Msxml2.XMLHTTP.4.0

loo_xmlhttp.ConnectToNewObject("Msxml2.XMLHTTP.6.0")

// invoke POST method for REST web service

loo_xmlhttp.open (astr_rs.in_method_type, is_url_send, false)

// building HTTP request headers

lblb_args = blob(astr_rs.in_arg_data)

ll_length = Len(lblb_args)

loo_xmlhttp.setRequestHeader("Content-Type", is_headers_content_type)

loo_xmlhttp.setRequestHeader("Content-Length", String( ll_length ))

loo_xmlhttp.setRequestHeader("Authorization", is_headers_authorization)

loo_xmlhttp.setRequestHeader("If-Modified-Since", string(today()))

loo_xmlhttp.setRequestHeader("Accept", 'text/xml')

// send request XML

loo_xmlhttp.send(astr_rs.in_arg_data)

Kindly please help the same .

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

René Ullrich Sep 27, 2017 at 01:38 PM
0

Your code seems to be ok.

Have you tried to use less request headers? Do you really need them? Maybe some of the values (e.g. content type) are not ok?

I don't use content-length header for my calls. For authentication I use the optional parameters (4. and 5.) of OPEN method instead of request header.

Share
10 |10000 characters needed characters left characters exceeded