/**
   * Creates new exception with translation code for i18n.
   *
   * @param faultCode the fault code
   * @param trCode the translation code
   * @param faultMessage the message
   * @return CodedException
   */
  public static CodedException tr(String faultCode, String trCode, String faultMessage) {
    CodedException ret = new CodedException(faultCode, faultMessage);

    ret.translationCode = trCode;

    return ret;
  }
  /**
   * Creates new exception with full SOAP fault details.
   *
   * @param faultCode the fault code
   * @param faultString the fault string (e.g. the message)
   * @param faultActor the fault actor
   * @param faultDetail the details
   * @return new proxy exception
   */
  public static CodedException fromFault(
      String faultCode, String faultString, String faultActor, String faultDetail) {
    CodedException ret = new Fault(faultCode, faultString);

    ret.faultActor = faultActor;
    ret.faultDetail = faultDetail;

    return ret;
  }
  private void parseResponse(HttpSender httpSender) throws Exception {
    log.trace("parseResponse()");

    response = new ProxyMessage();

    ProxyMessageDecoder decoder =
        new ProxyMessageDecoder(
            response, httpSender.getResponseContentType(), getHashAlgoId(httpSender));
    try {
      decoder.parse(httpSender.getResponseContent());
    } catch (CodedException ex) {
      throw ex.withPrefix(X_SERVICE_FAILED_X);
    }

    // Ensure we have the required parts.
    checkResponse();

    decoder.verify(requestServiceId.getClientId(), response.getSignature());
  }