Ir para conteúdo principal

Web Método GetRequestDetails

Web Método GetRequestDetails da Interface SOAP do CAP Workflow

Escrito por Luis Fernando Gushiken

GetRequestDetails

Obtém detalhes de uma Solicitação específica.

Disponível no Web Service CAPRequests.asmx

Parâmetros

  • requestId [Integer]: ID da Solicitação

  • cultureName [String]: Nome da Cultura (utilizado para identificação do Workflow, Área, localização de Atributos e Etapas e/ou no retorno de valores em um idioma específico)

Exemplo de Solicitação/Resposta SOAP (v1.2)

POST /Services/CAPRequests.asmx HTTP/1.1
Host: nossocap.capworkflow.com
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetRequestDetails xmlns="http://iteris.cap.webservices">
      <requestId>int</requestId>
      <cultureName>string</cultureName>
    </GetRequestDetails>
  </soap12:Body>
</soap12:Envelope>

---

HTTP/1.1 200 OK
Content-Type: application/soap+xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetRequestDetailsResponse xmlns="http://iteris.cap.webservices">
      <GetRequestDetailsResult>
        <RequestId>int</RequestId>
        <ParentRequestId>int</ParentRequestId>
        <Timestamp>dateTime</Timestamp>
        <WorkflowStartedTimestamp>dateTime</WorkflowStartedTimestamp>
        <WorkflowCompletedTimestamp>dateTime</WorkflowCompletedTimestamp>
        <Service>
          <Id>int</Id>
          <Name>string</Name>
          <Path>string</Path>
          <Status>Disabled or Published or Draft</Status>
          <Folder>
            <Id>int</Id>
            <Name>string</Name>
            <Path>string</Path>
            <Enabled>boolean</Enabled>
            <ParentFolder xsi:nil="true" />
          </Folder>
        </Service>
        <Status>Running or Uninitialized or Completed or Canceled or Interrupted or Errored or Draft</Status>
        <Tasks>
          <TaskDetails>
            <Id>int</Id>
            <Name>string</Name>
            <StartedTimestamp>dateTime</StartedTimestamp>
            <CompletedTimestamp>dateTime</CompletedTimestamp>
            <ExecutionOrder>int</ExecutionOrder>
            <Availability>string</Availability>
            <Type>None or Approval or Notification or Integration or Interruption or Finalization</Type>
            <Assignees xsi:nil="true" />
            <SLA xsi:nil="true" />
            <CanCurrentUserDelegateTask>boolean</CanCurrentUserDelegateTask>
            <CanCurrentUserLockTask>boolean</CanCurrentUserLockTask>
            <CanCurrentUserUnlockTask>boolean</CanCurrentUserUnlockTask>
            <Outcome>None or Continue or Return or ReturnToIssuer or Interrupt or Escalate or Skipped or Cancel</Outcome>
            <Comments>string</Comments>
            <Locked xsi:nil="true" />
            <Respondent xsi:nil="true" />
          </TaskDetails>
          <TaskDetails>
            <Id>int</Id>
            <Name>string</Name>
            <StartedTimestamp>dateTime</StartedTimestamp>
            <CompletedTimestamp>dateTime</CompletedTimestamp>
            <ExecutionOrder>int</ExecutionOrder>
            <Availability>string</Availability>
            <Type>None or Approval or Notification or Integration or Interruption or Finalization</Type>
            <Assignees xsi:nil="true" />
            <SLA xsi:nil="true" />
            <CanCurrentUserDelegateTask>boolean</CanCurrentUserDelegateTask>
            <CanCurrentUserLockTask>boolean</CanCurrentUserLockTask>
            <CanCurrentUserUnlockTask>boolean</CanCurrentUserUnlockTask>
            <Outcome>None or Continue or Return or ReturnToIssuer or Interrupt or Escalate or Skipped or Cancel</Outcome>
            <Comments>string</Comments>
            <Locked xsi:nil="true" />
            <Respondent xsi:nil="true" />
          </TaskDetails>
        </Tasks>
        <Metadata>
          <MetadataDetails>
            <Id>int</Id>
            <Name>string</Name>
            <Value />
            <Type>None or Text or Number or DateTime or Choice or YesNo or Attachment or ListLookup or Password or People or MultilineText or Hyperlink or Table</Type>
            <DisplayOrder>int</DisplayOrder>
          </MetadataDetails>
          <MetadataDetails>
            <Id>int</Id>
            <Name>string</Name>
            <Value />
            <Type>None or Text or Number or DateTime or Choice or YesNo or Attachment or ListLookup or Password or People or MultilineText or Hyperlink or Table</Type>
            <DisplayOrder>int</DisplayOrder>
          </MetadataDetails>
        </Metadata>
        <Issuer>
          <Id>int</Id>
          <Name>string</Name>
          <LogOnName>string</LogOnName>
          <Email>string</Email>
        </Issuer>
        <SLA>
          <TimeSpan>string</TimeSpan>
          <DueDate>dateTime</DueDate>
          <Status>None or WithinDueDate or Expiring or Expired</Status>
          <Percentage>double</Percentage>
        </SLA>
        <Availability>string</Availability>
        <Comments>string</Comments>
        <CanCurrentUserRestartWorkflow>boolean</CanCurrentUserRestartWorkflow>
        <CanCurrentUserUseAsTemplate>boolean</CanCurrentUserUseAsTemplate>
        <CanCurrentUserCancel>boolean</CanCurrentUserCancel>
        <Link>string</Link>
      </GetRequestDetailsResult>
    </GetRequestDetailsResponse>
  </soap12:Body>
</soap12:Envelope>

Exemplo de Utilização em PowerShell via New-WebServiceProxy

$baseUrl = "https://env.capworkflow.com";
$userName = "test.user@capworkflow.com";
$password = "MyVeryStrongPassword@123";
# Cria o proxy para o serviço de autenticação do CAP.
$wsAuth = New-WebServiceProxy -Uri "$baseUrl/Services/CAPAuthentication.asmx" -Namespace "CAP.Services";
# Atribui um Cookie Container ao proxy para armazenar o cookie de autorização a ser retornado.
$wsAuth.CookieContainer = New-Object System.Net.CookieContainer;
# Realiza a autenticação do usuário.
$wsAuth.Login($userName, $password);
# Como o proxy do PowerShell não suporta passar as informações de autenticação no momento da sua criação,
# é necessário baixar a definição do serviço em um etapa anterior, passando o cookie de autorização através
# de uma nova sessão web.
$authSession = New-Object Microsoft.PowerShell.Commands.WebRequestSession;
$authSession.Cookies = $wsAuth.CookieContainer;
$wsReqWsdl = Invoke-WebRequest -Uri "$baseUrl/Services/CAPRequests.asmx?wsdl" -Method Get -WebSession $authSession;
$wsReqWsdl.Content | Out-File -FilePath "D:\temp\wsReq.wsdl" -Encoding utf8;
# Cria o proxy para o serviço de configuração do CAP.
$wsReq = New-WebServiceProxy -Uri "D:\temp\wsReq.wsdl" -Namespace "CAP.Services";
# Atribui o Cookie Container com o cookie de autorização ao proxy.
$wsReq.CookieContainer = $wsAuth.CookieContainer;
$wsReq.GetRequestDetails(2225, "pt-BR");

Exemplo de Utilização em PowerShell via Invoke-WebRequest

$baseUrl = "https://env.capworkflow.com";
$userName = "test.user@capworkflow.com";
$password = "MyVeryStrongPassword@123";
# Montagem da mensagem SOAP com os parâmetros de autenticação.
$soapMessage = @"
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <Login xmlns="http://iteris.cap.webservices">
      <userLogOnName>$userName</userLogOnName>
      <password>$password</password>
    </Login>
  </soap12:Body>
</soap12:Envelope>
"@;
# Requisição POST passando a mensagem SOAP e armazenando
# o cookie de autorização na variável de sessão $authSession.
Invoke-WebRequest -Uri "$baseUrl/Services/CAPAuthentication.asmx" -Method Post -ContentType "application/soap+xml; charset=utf-8" -Body $soapMessage -SessionVariable authSession;
# Montagem da mensagem SOAP com os parâmetros necessários.
$reqSoapMessage = @"
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetRequestDetails xmlns="http://iteris.cap.webservices">
      <requestId>2225</requestId>
      <cultureName>pt-BR</cultureName>
    </GetRequestDetails>
  </soap12:Body>
</soap12:Envelope>
"@;
# Requisição POST passando a mensagem SOAP e a variável
# de sessão $authSession criada no momento da autenticação.
Invoke-WebRequest -Uri "$baseUrl/Services/CAPRequests.asmx" -Method Post -ContentType "application/soap+xml; charset=utf-8" -Body $reqSoapMessage -WebSession $authSession;

Exemplo de Utilização em PowerShell via Invoke-WebRequest e Basic Authentication

$baseUrl = "https://env.capworkflow.com";
$userName = "test.user@capworkflow.com";
$password = "MyVeryStrongPassword@123";
# Montagem da mensagem SOAP com os parâmetros necessários.
$reqSoapMessage = @"
<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Body>
    <GetRequestDetails xmlns="http://iteris.cap.webservices">
      <requestId>2225</requestId>
      <cultureName>pt-BR</cultureName>
    </GetRequestDetails>
  </soap12:Body>
</soap12:Envelope>
"@;
# Monta o valor do cabeçalho de autenticação para Basic Authentication.
$credential = [Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("$($userName):$password"));
# Requisição POST passando a mensagem SOAP e o cabeçalho
# de autenticação básica.
Invoke-WebRequest -Uri "$baseUrl/Services/CAPRequests.asmx" -Method Post -ContentType "application/soap+xml; charset=utf-8" -Body $reqSoapMessage -Headers @{ "Authorization" = "Basic $credential" };
Isto respondeu à sua pergunta?