Can I integrate with a Servlet API?

0
Hello, I have an application that offers 2 types of API integration: through a Servlet API and trough a REST API. I fail to call them with the web service tools Mendix offers, but it fails. API documentation of the other application: ServiceDesk Plus API
asked
6 answers
3

RESTful and form-based (the servlet api you're referring to) are both custom (web service) calls. There is no formal definition of the service (such as is the case with SOAP: WSDL) so you need to code the entire interaction yourself.

In your case, I would read up on how REST works and then code a java client to interact with servicedesk. Note that this is not for the faint of heart, you probably need someone (relatively) well versed in java.

answered
1

The community commons library provides two functions that might come in handy if you want to access the ServletAPI using mendix:

  • RetrieveURL - Retrieves data (such as an HTML page) from an URL using the HTTP protocol, and returns it as string.
  • StoreURLToFileDocument - Retrieve a document from an URL using a HTTP GET request.

(See https://appstore.mendix.com/link/app/Community%20Commons%20Function%20Library for more details)

answered
0

Maybe you could tell us why the ws call fails.

answered
0

OK - meanwhile I learned in link text that RESTful is not an option with Mendix. How about the other Servlet API?

answered
0

Thanks for the help!

This is what I managed to do: I created a microflow with a java call to the retrieveURL (community commons java call), parameters: url = 'http://localhost:8080/api/xml/getRequest?apikey=3881A009-3E68-484A-9CFE-08D6F1137BEF&account=nowhow.be' (yes... all is hard coded in this parameter) postdata = '' (maybe due to my stupidness, but it took me quite a while to discover how not to set to POST as mentioned in the component documentation - just a hint to extend this)

It works: I get an answer that I now save in a text field for testing purposes.

Now I doubt (how) to continue. If I do, I'll need to setup a whole sync process. With a WSDL webservice this is fast setup in Mendix. I wonder if I would not better use Talend (ETL tool) that works easier for this kind of operations. Any advise?

answered
0

this is the http answer (I replaced all < and > by ( and ) - if not, it wouldn't display in this forum)

(?xml version="1.0" encoding="UTF-8"?) (response uri="/api/xml/getRequest") (result) (status)Success(/status) (statuscode)200(/statuscode) (requests) (request) (form name="item"/) (form name="product"/) (form name="level"/) (form name="contract"/) (form name="supportRep"/) (form name="productID"/) (form name="respondedTime"/) (form name="dueByTime")May 3, 2011 11:51 AM(/form) (form name="requestID")1(/form) (form name="subAccountID"/) (form name="isFirstResponseOverDue")false(/form) (form name="accountID")301(/form) (form name="productType"/) (form name="businessUnit")General(/form) (form name="subAccount"/) (form name="isOverDue")false(/form) (form name="subCategory"/) (form name="priority")Normal(/form) (form name="contractServices"/) (form name="timeSpentOnRequest"/) (form name="group"/) (form name="completedTime"/) (form name="firstResponseDueByTime"/) (form name="account")nowhow.be(/form) (form name="category"/) (form name="mode")Web Form(/form) (form name="supportPlan"/) (form name="createdBy"/) (form name="status")Open(/form) (form name="contractNumber"/) (form name="createdTime")May 3, 2011 09:51 AM(/form) (form name="contact")ikke(/form) (form name="contactID")601(/form) (form name="subject")testje(/form) (/request) (request) (form name="item"/) (form name="product")Huffy Titanium Portable Basketball System(/form) (form name="level")Tier 1(/form) (form name="contract"/) (form name="supportRep")Heather Graham(/form) (form name="productID")3(/form) (form name="respondedTime"/) (form name="dueByTime")May 3, 2011 10:59 AM(/form) (form name="requestID")2(/form) (form name="subAccountID"/) (form name="isFirstResponseOverDue")false(/form) (form name="accountID")301(/form) (form name="productType")Basketball(/form) (form name="businessUnit")General(/form) (form name="subAccount"/) (form name="isOverDue")true(/form) (form name="subCategory"/) (form name="priority")High(/form) (form name="contractServices"/) (form name="timeSpentOnRequest"/) (form name="group")Defective Item Group(/form) (form name="completedTime"/) (form name="firstResponseDueByTime"/) (form name="account")nowhow.be(/form) (form name="category")Warranty Problem(/form) (form name="mode"/) (form name="supportPlan"/) (form name="createdBy")administrator(/form) (form name="status")Open(/form) (form name="contractNumber"/) (form name="createdTime")May 3, 2011 09:59 AM(/form) (form name="contact")Guest(/form) (form name="contactID")2(/form) (form name="subject")This is MyTest(/form) (/request) (/requests) (/result) (/response)

answered