Extracts the return object from the context.
@param <T>
@param <T>

@param context
the message context.
@return the return object for the message.
@throws SoapFault
191299
@SuppressWarnings("unchecked")
    protected <T> List<T>  getSOAPResponseObject(SOAPMessageContext context, Class<T> clazz) {
        // return result

        Object responseObject = getSOAPResponseObject(context);
        ArrayList<T> resultList = new ArrayList<T>();
        for (Method m:responseObject.getClass().getDeclaredMethods()){
            if (m.getReturnType() == clazz) {
                try {
                    resultList.add((T)m.invoke(responseObject));
                } catch (Exception e) {
                    logger.error(e.toString(),e);
                    throw CXFUtility.getFault(e);
                }
            }
        }

        return resultList;
    }
25100
@Pure
	public static Object getContext() throws AndroidException {
		final Object ctx;
		synchronized (Android.class) {
			if (context == null) {
				throw new AndroidException();
			}
			ctx = context.get();
		}
		if (ctx == null) {
			throw new AndroidException();
		}
		return ctx;
	}
338052
public void init(HttpInboundServiceContext context) {
        this.message = context.getRequest();
        if (this.useEE7Streams) {
            this.body = new HttpInputStreamEE7(context);
        } else {
            this.body = new HttpInputStreamImpl(context);
        }
    }
1284005
private void addSoapFault(SoapMessage response, SoapFault replyMessage) throws TransformerException {
        SoapBody soapBody = response.getSoapBody();
        org.springframework.ws.soap.SoapFault soapFault;
        
        if (SoapFaultDefinition.SERVER.equals(replyMessage.getFaultCodeQName()) ||
                SoapFaultDefinition.RECEIVER.equals(replyMessage.getFaultCodeQName())) {
            soapFault = soapBody.addServerOrReceiverFault(replyMessage.getFaultString(),
                    replyMessage.getLocale());
        } else if (SoapFaultDefinition.CLIENT.equals(replyMessage.getFaultCodeQName()) ||
                SoapFaultDefinition.SENDER.equals(replyMessage.getFaultCodeQName())) {
            soapFault = soapBody.addClientOrSenderFault(replyMessage.getFaultString(),
                    replyMessage.getLocale());
        } else if (soapBody instanceof Soap11Body) {
            Soap11Body soap11Body = (Soap11Body) soapBody;
            soapFault = soap11Body.addFault(replyMessage.getFaultCodeQName(),
                    replyMessage.getFaultString(),
                    replyMessage.getLocale());
        } else if (soapBody instanceof Soap12Body) {
            Soap12Body soap12Body = (Soap12Body) soapBody;
            Soap12Fault soap12Fault = soap12Body.addServerOrReceiverFault(replyMessage.getFaultString(),
                            replyMessage.getLocale());
            soap12Fault.addFaultSubcode(replyMessage.getFaultCodeQName());
            
            soapFault = soap12Fault;
        } else {
                throw new CitrusRuntimeException("Found unsupported SOAP implementation. Use SOAP 1.1 or SOAP 1.2.");
        }
        
        if (replyMessage.getFaultActor() != null) {
            soapFault.setFaultActorOrRole(replyMessage.getFaultActor());
        }
        
        List<String> soapFaultDetails = replyMessage.getFaultDetails();
        if (!soapFaultDetails.isEmpty()) {
            TransformerFactory transformerFactory = TransformerFactory.newInstance();
            Transformer transformer = transformerFactory.newTransformer();
            
            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
            
            SoapFaultDetail faultDetail = soapFault.addFaultDetail();
            for (int i = 0; i < soapFaultDetails.size(); i++) {
                transformer.transform(new StringSource(soapFaultDetails.get(i)), faultDetail.getResult());
            }
        }
    }
1243746
def ReceiveFault(self, **kw):
        '''
        '''
        self.ReceiveSOAP(**kw)
        if not self.ps.IsAFault():
            raise TypeError("Expected SOAP Fault not found")
        return FaultFromFaultMessage(self.ps)
990577
@Override
    @SuppressWarnings("unchecked")
    public <T> T get(Contextual<T> contextual, CreationalContext<T> creationalContext) {
        Bean bean = (Bean) contextual;
        // you can store the bean somewhere
        if (somewhere.containsKey(bean.getName())) {
            return (T) somewhere.get(bean.getName());
        } else {
            T t = (T) bean.create(creationalContext);
            somewhere.put(bean.getName(), t);
            return t;
        }
    }
252416
function create(context) {
    return {
        ReturnStatement(node) {
            if (isCommonJsWrapper(nearestFunction(node).parent)) {
                context.report(node, message);
            }
        }
    };
}
670019
public static JsonObject serialize(Context<?> context) {
    if (context instanceof NetworkContext) {
      return serialize(NetworkContext.class.cast(context));
    } else if (context instanceof ComponentContext) {
      return serialize(ComponentContext.class.cast(context));
    } else if (context instanceof InstanceContext) {
      return serialize(InstanceContext.class.cast(context));
    } else if (context instanceof IOContext) {
      return serialize(IOContext.class.cast(context));
    } else if (context instanceof InputPortContext) {
      return serialize(InputPortContext.class.cast(context));
    } else if (context instanceof OutputPortContext) {
      return serialize(OutputPortContext.class.cast(context));
    } else {
      throw new UnsupportedOperationException("Cannot serialize " + context.getClass().getCanonicalName() + " type contexts");
    }
  }
90019
@SuppressWarnings("unchecked") //
  public static <T> T getDaggerComponent(Context context) {
    //noinspection ResourceType
    return (T) context.getSystemService(SERVICE_NAME);
  }
282176
public static <T> String get(Message<T> text, T context) {
        for (AlternativeUiTextProvider p : all()) {
            String s = p.getText(text, context);
            if (s!=null)
                return s;
        }
        return null;
    }
463539
public Service retrieve(final RequestContext context) {
        val request = WebUtils.getHttpServletRequestFromExternalWebflowContext(context);

        val wCtx = request.getParameter(WCTX);
        LOGGER.debug("Parameter [{}] received: [{}]", WCTX, wCtx);
        if (StringUtils.isBlank(wCtx)) {
            LOGGER.error("No [{}] parameter is found", WCTX);
            throw new IllegalArgumentException("No " + WCTX + " parameter is found");
        }

        val configuration = configurations.stream()
            .filter(c -> c.getId().equalsIgnoreCase(wCtx))
            .findFirst()
            .orElse(null);
        val cookieGen = configuration.getCookieGenerator();
        val value = cookieGen.retrieveCookieValue(request);
        if (StringUtils.isBlank(value)) {
            LOGGER.error("No cookie value could be retrieved to determine the state of the delegated authentication session");
            throw new IllegalArgumentException("No cookie could be found to determine session state");
        }
        val blob = EncodingUtils.hexDecode(value);
        val session = serializer.from(blob);
        request.setAttribute(this.themeParamName, session.get(this.themeParamName));
        request.setAttribute(this.localParamName, session.get(this.localParamName));
        request.setAttribute(CasProtocolConstants.PARAMETER_METHOD, session.get(CasProtocolConstants.PARAMETER_METHOD));

        val serviceKey = CasProtocolConstants.PARAMETER_SERVICE + '-' + wCtx;
        val service = (Service) session.get(serviceKey);
        LOGGER.debug("Located service [{}] from session cookie", service);
        WebUtils.putServiceIntoFlowScope(context, service);
        return service;
    }
606788
static public Object get(String key) {
        if (setContext()) {
            return m_context.get(key);
        } else {
            return m_defaultContext.get(key);
        }
    }
315293
public com.google.api.Context getContext() {
    return context_ == null ? com.google.api.Context.getDefaultInstance() : context_;
  }
219666
public static JAXBSerialiser getInstance(JAXBContext context)
	{
		if (log.isTraceEnabled())
			log.trace("Create serialiser for context " + context);

		return new JAXBSerialiser(context);
	}
138933
public static JavacMessages instance(Context context) {
        JavacMessages instance = context.get(messagesKey);
        if (instance == null)
            instance = new JavacMessages(context);
        return instance;
    }
658496
@Override
    public IQueryResult<T> fetch(IQueryContext context) {
        try {
            return QueryUtil.packageResult(processData(context, service.callRPC(rpcName, getArguments(context))));
        } catch (Exception e) {
            return QueryUtil.errorResult(e);
        }
    }
362239
public void renderSoapHeader(final Map<String, String> context, final SOAPHeader soapHeader) {
		renderSoapHeader(SOAP_HEADER_MARSHALLER, context, soapHeader);
	}