Apache Java libraries

0
Hi All... I need to POST HTTP requests in Mendix to a remote server and i need to import the following libraries into my Mendix project, how best can i do it import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.entity.ContentType; import org.apache.http.HttpResponse; import org.json.simple.parser.JSONParser; import org.json.simple.JSONObject; import org.json.simple.parser.ParseException; import java.util.Map; Thanks
asked
3 answers
1

You can put the jar files for the libraries you want to use in the userlib folder in your project folder. When you run your application, any jars located there will be added to the classpath and will be available to use in Java.

By the way, if you are working with HTTP requests and JSON, as your imports seem to say, you might want to take a look at the REST module in the appstore.

answered
0

i did look at the REST module but i am getting this error: java.lang.IllegalStateException: Primitive IDNumber should not be null!

at MyModule.IVK_Post(JavaAction : 'Call 'post'')

I am posting data and i have called the Post java action and one of its argument is a type of Any object and its not allowing me to enter details for JSON serialisation in its parameter.

{
"Nr": 1,

"Total": 9.4, "OrderCustomer": "http://localhost:8080/rest/customers/3", "OrderLines":3 "Description": "Coffee Biscuits 36pcs", "Amount": 2, "Price": 0.89 }, { "Description": "Dark Coffee 36pads Limited Edition", "Amount": 3, "Price": 2.54 } ] }

answered
0

Thanks a lot. This is the new error i am now getting: java.security.AccessControlException: access denied "java.net.socketpermission" " localhost: 0" "listen, resolve" access denied).

How can i grant socket permissions

answered