/
Exemplo de cliente da chamada delete
The following macros are not currently supported in the header:
- style
Exemplo de cliente da chamada delete
A seguir está um exemplo de um programa Axis cliente que chama a operação deleteAttachment para excluir a entrada de documento de anexo do banco de dados identificado pelo Row Id# 12.
public class AttachmentClient { public void main ( String [] args) { try { // Create the request AttachmentStub attachmentStub = new AttachmentStub(); AttachmentStub.Credentials credentials = new AttachmentStub.Credentials(); AttachmentStub.ExtendedSettings extParams = new AttachmentStub.ExtendedSettings(); // Initialize Credentials (User Name & User Password / Authorization Token & Slice Token) credentials.setUserName ( "wsuser"); credentials.setUserPassword ( "wsuser"); // Initialize Extended Settings such as Response Format (XML, JSON) extParams.setResponseFormat ( "JSON"); // Invoke the DELETE service AttachmentStub.DefaultServiceResponse serviceResponse = attachmentStub.deleteAttachment (credentials, extParams, "12"); // Inspect successful execution of service and retrieve the response text if (serviceResponse.getResponseStatus ().equals ( "OK")) { System.out.println( "JSON Response : " + serviceResponse.getResponseText ()); } // Retrieve the status code, status message and error messages, in case of failures else { System.out.println( "Status Code : " + serviceResponse.getStatusCode ()); System.out.println( "Status Message : " + serviceResponse.getStatusMessage ()); System.out.println( "Errors : " + Arrays.asList (serviceResponse.getErrors ()).toString ()); } } catch (Exception e) { System.out.println ( "Exception: " + e.getMessage()); } } }
© 2017 ServiceAide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com