To utilize a RESTful Web service from your application, you must create a RESTful Web service reference.
To create a RESTful Web service reference:
- Navigate to the Web Service References page. See "Accessing the Web Service References Page".
- Click Create.
- Select REST and click Next.
- For REST Details, specify the following:
- Name - Enter a name to identify the reference.
- URL - Enter the URL endpoint of the Web service.
- Proxy - Enter a proxy to override the application proxy for this service (optional).
- HTTP Method - Choose the http method used for the request to the Web service. Select GET, HEAD, POST, PUT or DELETE.
- Basic Authentication - Select Yes to require HTTP Basic Authentication. Otherwise, select No.
- HTTP Headers - Enter the names of the HTTP headers to send with the request.
- Click Next.
- For REST Input parameters, specify the following:
- Name - Enter the name of the input parameter expected by the method.
- Type - Select the input type.
- Click Add Parameter.
- Repeat steps a though c for each expected input.
- Click Next.
- For REST Output parameters, specify the following:
- Output Format - Select XML or Text for the response format expected from the Web service.
- XPath to Output Parameters (XML only) - Enter an XPath expression to the relevant part of the response.
- Response Namespace (XML only) - Enter the namespace corresponding to the Response XPath.
- Parameter Delimiter (Text only)- Enter the character or sequence that separates parameters returned from the Web service. Use
\n
to indicate a new line and\t
to indicate a tab character. - New Record Delimiter (Text only) - Enter the character or sequence that determines a new record in a text response from the Web service. Use
\n
to indicate a new line and\t
to indicate a tab character. - Name - Enter the name of the output parameter returned by the method.
- Type - Select the output type.
- Click Add Parameter.
- Repeat steps f though h for each returned output parameter.
Note:Click Test to send a request to a RESTful Web service and see the response. This test process will help you in specifying the appropriate Output parameters. - Click Create.
The Create Web Service Reference Success page appears. The Web service reference is added to the Web Service References Repository.
No comments:
Post a Comment