![]() ![]() Now we can add a new URI template with some special syntax to tell the REST IB listener to expect a list value. You can think of it as similar to an array. We have to make some changes to both the Document Template and the URI templates.įirst we need to add collection to the document and a child text primitive.Ĭollection: A data type on the document that can have multiple “rows” or values. CONFLICTING URI TEMPLATES CODEOur code will parse those values and only return those phone types if they exists. Let’s imagine that we allow the client to pass in a CSV list of phone types they want back. Let’s look at an example by expanding our person get example. There can be times when you need to pass a comma separated list of values in the URL query string as a parameter. A client must use one of those patterns or they will get a cryptic 500 errors. Your handler code does NOT need to try to determine what pattern was used. No matter what URL pattern that was used, those two lines of code would end up populating the &EMPLIDParameter variable with the parameter. Local string &EMPLIDParameter = &reqDOC.GetElement("EMPLID").value Local Document &reqDOC = &msgRequest.GetURIDocument() In your handler, in order to parse the EMPLID parameter for all these different URL patterns is the following two lines of code. If you were trying to get information in EMPLID 12345 you could use any of these URL patterns. The document template only has one parameter. In this example, we have configured the service operation to be able to “speak the client’s language” and they can pass EMPLID in several ways. This is a rather extreme example but you could see something like this if some clients use different nomenclature to reference the ID. We have configured five different templates to pass EMPLID. Here is our example service operation that does an “Person Get”. Let’s try some examples to clarify some common use cases. I have read it several times and I am positive I have only scratched the surface. PeopleBooks does have some good discussion on this but the documentation is dense and hard to understand. These work in conjunction with the Document Template and your handler code. When configuring a REST Service operation, you have a broad array of options to pass parameters in the URL. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |