@Test public void testEVFailWrongNamespace() { generateEV(tsd, "MyNamespace"); OperationKey key = new OperationKey(TestServiceDefinition.TEST_GET, "WrongNamespace"); observer = new PassFailExecutionObserver(true, false); try { client.execute(createEC(null, null, false), key, new Object[] {TEST_TEXT }, observer, ev, DefaultTimeConstraints.NO_CONSTRAINTS); } catch (NullPointerException e) { assert true; } }
@Override public void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args, final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints) { final ClientCallContext callContext = CallContextFactory.createSubContext(ctx); tracer.startCall(ctx.getRequestUUID(), callContext.getRequestUUID(), key); final OperationDefinition operationDefinition = executionVenue.getOperationDefinition(key); final Parameter[] parameters = operationDefinition.getParameters(); final RescriptOperationBindingDescriptor operationBinding = (RescriptOperationBindingDescriptor) descriptorMap.get(key.getLocalKey()); final Message message = messageBuilder.build(args, parameters, operationBinding); String contextPath = serviceBindingDescriptor.getServiceContextPath(); String remoteAddress = remoteAddressRef.get(); if (remoteAddress.endsWith("/") && contextPath.startsWith("/")) { contextPath = contextPath.substring(1); } final String uri = remoteAddress + contextPath +"v"+ serviceBindingDescriptor.getServiceVersion().getMajor() + operationBinding.getURI(); final String queryString = queryStringGeneratorFactory.getQueryStringGenerator() .generate(message.getQueryParmMap()); final String httpMethod = operationBinding.getHttpMethod(); HR request = requestFactory.create(uri + queryString, httpMethod, message, dataBindingFactory.getMarshaller(), CONTENT_TYPE, callContext, timeConstraints); Exception exception = null; Object result = null; InputStream inputStream = null; if (identityTokenResolver != null && getIdentityResolver() != null && identityTokenResolver.isRewriteSupported()) { final List<IdentityToken> identityTokens = getIdentityResolver().tokenise(ctx.getIdentity()); identityTokenResolver.rewrite(identityTokens, request); if (LOGGER.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (IdentityToken it: identityTokens) { if (sb.length() > 0) { sb.append(","); } sb.append(it.getName()).append("=").append(it.getValue()); } LOGGER.debug("Rewrote tokens " + sb + " to http request"); } } sendRequest(request, new TracingEndObserver(tracer, obs, ctx.getRequestUUID(), callContext.getRequestUUID(), key), operationDefinition); }
AbstractHttpExecutable extends AbstractClientTransport { @Override public void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args, final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints) { final ClientCallContext callContext = CallContextFactory.createSubContext(ctx); tracer.startCall(ctx.getRequestUUID(), callContext.getRequestUUID(), key); final OperationDefinition operationDefinition = executionVenue.getOperationDefinition(key); final Parameter[] parameters = operationDefinition.getParameters(); final RescriptOperationBindingDescriptor operationBinding = (RescriptOperationBindingDescriptor) descriptorMap.get(key.getLocalKey()); final Message message = messageBuilder.build(args, parameters, operationBinding); String contextPath = serviceBindingDescriptor.getServiceContextPath(); String remoteAddress = remoteAddressRef.get(); if (remoteAddress.endsWith("/") && contextPath.startsWith("/")) { contextPath = contextPath.substring(1); } final String uri = remoteAddress + contextPath +"v"+ serviceBindingDescriptor.getServiceVersion().getMajor() + operationBinding.getURI(); final String queryString = queryStringGeneratorFactory.getQueryStringGenerator() .generate(message.getQueryParmMap()); final String httpMethod = operationBinding.getHttpMethod(); HR request = requestFactory.create(uri + queryString, httpMethod, message, dataBindingFactory.getMarshaller(), CONTENT_TYPE, callContext, timeConstraints); Exception exception = null; Object result = null; InputStream inputStream = null; if (identityTokenResolver != null && getIdentityResolver() != null && identityTokenResolver.isRewriteSupported()) { final List<IdentityToken> identityTokens = getIdentityResolver().tokenise(ctx.getIdentity()); identityTokenResolver.rewrite(identityTokens, request); if (LOGGER.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (IdentityToken it: identityTokens) { if (sb.length() > 0) { sb.append(","); } sb.append(it.getName()).append("=").append(it.getValue()); } LOGGER.debug("Rewrote tokens " + sb + " to http request"); } } sendRequest(request, new TracingEndObserver(tracer, obs, ctx.getRequestUUID(), callContext.getRequestUUID(), key), operationDefinition); } }
AbstractHttpExecutable extends AbstractClientTransport { @Override public void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args, final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints) { final ClientCallContext callContext = CallContextFactory.createSubContext(ctx); tracer.startCall(ctx.getRequestUUID(), callContext.getRequestUUID(), key); final OperationDefinition operationDefinition = executionVenue.getOperationDefinition(key); final Parameter[] parameters = operationDefinition.getParameters(); final RescriptOperationBindingDescriptor operationBinding = (RescriptOperationBindingDescriptor) descriptorMap.get(key.getLocalKey()); final Message message = messageBuilder.build(args, parameters, operationBinding); String contextPath = serviceBindingDescriptor.getServiceContextPath(); String remoteAddress = remoteAddressRef.get(); if (remoteAddress.endsWith("/") && contextPath.startsWith("/")) { contextPath = contextPath.substring(1); } final String uri = remoteAddress + contextPath +"v"+ serviceBindingDescriptor.getServiceVersion().getMajor() + operationBinding.getURI(); final String queryString = queryStringGeneratorFactory.getQueryStringGenerator() .generate(message.getQueryParmMap()); final String httpMethod = operationBinding.getHttpMethod(); HR request = requestFactory.create(uri + queryString, httpMethod, message, dataBindingFactory.getMarshaller(), CONTENT_TYPE, callContext, timeConstraints); Exception exception = null; Object result = null; InputStream inputStream = null; if (identityTokenResolver != null && getIdentityResolver() != null && identityTokenResolver.isRewriteSupported()) { final List<IdentityToken> identityTokens = getIdentityResolver().tokenise(ctx.getIdentity()); identityTokenResolver.rewrite(identityTokens, request); if (LOGGER.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (IdentityToken it: identityTokens) { if (sb.length() > 0) { sb.append(","); } sb.append(it.getName()).append("=").append(it.getValue()); } LOGGER.debug("Rewrote tokens " + sb + " to http request"); } } sendRequest(request, new TracingEndObserver(tracer, obs, ctx.getRequestUUID(), callContext.getRequestUUID(), key), operationDefinition); } protected  AbstractHttpExecutable(final HttpServiceBindingDescriptor bindingDescriptor,
                                  CougarRequestFactory<HR> requestFactory,
                                  Tracer tracer); }
AbstractHttpExecutable extends AbstractClientTransport { @Override public void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args, final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints) { final ClientCallContext callContext = CallContextFactory.createSubContext(ctx); tracer.startCall(ctx.getRequestUUID(), callContext.getRequestUUID(), key); final OperationDefinition operationDefinition = executionVenue.getOperationDefinition(key); final Parameter[] parameters = operationDefinition.getParameters(); final RescriptOperationBindingDescriptor operationBinding = (RescriptOperationBindingDescriptor) descriptorMap.get(key.getLocalKey()); final Message message = messageBuilder.build(args, parameters, operationBinding); String contextPath = serviceBindingDescriptor.getServiceContextPath(); String remoteAddress = remoteAddressRef.get(); if (remoteAddress.endsWith("/") && contextPath.startsWith("/")) { contextPath = contextPath.substring(1); } final String uri = remoteAddress + contextPath +"v"+ serviceBindingDescriptor.getServiceVersion().getMajor() + operationBinding.getURI(); final String queryString = queryStringGeneratorFactory.getQueryStringGenerator() .generate(message.getQueryParmMap()); final String httpMethod = operationBinding.getHttpMethod(); HR request = requestFactory.create(uri + queryString, httpMethod, message, dataBindingFactory.getMarshaller(), CONTENT_TYPE, callContext, timeConstraints); Exception exception = null; Object result = null; InputStream inputStream = null; if (identityTokenResolver != null && getIdentityResolver() != null && identityTokenResolver.isRewriteSupported()) { final List<IdentityToken> identityTokens = getIdentityResolver().tokenise(ctx.getIdentity()); identityTokenResolver.rewrite(identityTokens, request); if (LOGGER.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (IdentityToken it: identityTokens) { if (sb.length() > 0) { sb.append(","); } sb.append(it.getName()).append("=").append(it.getValue()); } LOGGER.debug("Rewrote tokens " + sb + " to http request"); } } sendRequest(request, new TracingEndObserver(tracer, obs, ctx.getRequestUUID(), callContext.getRequestUUID(), key), operationDefinition); } protected  AbstractHttpExecutable(final HttpServiceBindingDescriptor bindingDescriptor,
                                  CougarRequestFactory<HR> requestFactory,
                                  Tracer tracer); void init(); @Override void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args,
                        final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) void setRemoteAddress(final String host); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) String getRemoteAddress(); @ManagedAttribute(description = SERVICE_CONTEXT_PATH_DESCRIPTION) String getServiceContextPath(); abstract TransportMetrics getTransportMetrics(); void setDataBindingFactory(DataBindingFactory dataBindingFactory); void setQueryStringGeneratorFactory(QueryStringGeneratorFactory queryStringGeneratorFactory); void setIdentityTokenResolver(IdentityTokenResolver<HR, HR, X509Certificate[]> identityTokenResolver); void setExceptionTransformer(ExceptionTransformer exceptionTransformer); void setExceptionFactory(ExceptionFactory exceptionFactory); void setTransportSSLEnabled(boolean transportSSLEnabled); void setHttpsKeyPassword(String httpsKeyPassword); void setHttpsKeystore(Resource httpsKeystore); void setHttpsKeystoreType(String httpsKeystoreType); void setHttpsTrustPassword(String httpsTrustPassword); void setHttpsTruststore(Resource httpsTruststore); void setHttpsTruststoreType(String httpsTruststoreType); void setConnectTimeout(int timeout); void setIdleTimeout(int idleTimeout); void setHostnameVerificationDisabled(final boolean hostnameVerificationDisabled); void setRequestFactory(CougarRequestFactory<HR> requestFactory); @ManagedAttribute int getIdleTimeout(); @ManagedAttribute int getConnectTimeout(); @ManagedAttribute String getHttpsTruststoreType(); @ManagedAttribute Resource getHttpsTruststore(); @ManagedAttribute String getHttpsKeystoreType(); @ManagedAttribute Resource getHttpsKeystore(); @ManagedAttribute boolean isHostnameVerificationDisabled(); @ManagedAttribute boolean isTransportSSLEnabled(); @ManagedAttribute boolean isHardFailEnumDeserialisation(); void setHardFailEnumDeserialisation(boolean hardFailEnumDeserialisation); @ManagedAttribute boolean isGzipCompressionEnabled(); @ManagedAttribute void setGzipCompressionEnabled(boolean gzipCompressionEnabled); }
AbstractHttpExecutable extends AbstractClientTransport { @Override public void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args, final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints) { final ClientCallContext callContext = CallContextFactory.createSubContext(ctx); tracer.startCall(ctx.getRequestUUID(), callContext.getRequestUUID(), key); final OperationDefinition operationDefinition = executionVenue.getOperationDefinition(key); final Parameter[] parameters = operationDefinition.getParameters(); final RescriptOperationBindingDescriptor operationBinding = (RescriptOperationBindingDescriptor) descriptorMap.get(key.getLocalKey()); final Message message = messageBuilder.build(args, parameters, operationBinding); String contextPath = serviceBindingDescriptor.getServiceContextPath(); String remoteAddress = remoteAddressRef.get(); if (remoteAddress.endsWith("/") && contextPath.startsWith("/")) { contextPath = contextPath.substring(1); } final String uri = remoteAddress + contextPath +"v"+ serviceBindingDescriptor.getServiceVersion().getMajor() + operationBinding.getURI(); final String queryString = queryStringGeneratorFactory.getQueryStringGenerator() .generate(message.getQueryParmMap()); final String httpMethod = operationBinding.getHttpMethod(); HR request = requestFactory.create(uri + queryString, httpMethod, message, dataBindingFactory.getMarshaller(), CONTENT_TYPE, callContext, timeConstraints); Exception exception = null; Object result = null; InputStream inputStream = null; if (identityTokenResolver != null && getIdentityResolver() != null && identityTokenResolver.isRewriteSupported()) { final List<IdentityToken> identityTokens = getIdentityResolver().tokenise(ctx.getIdentity()); identityTokenResolver.rewrite(identityTokens, request); if (LOGGER.isDebugEnabled()) { StringBuilder sb = new StringBuilder(); for (IdentityToken it: identityTokens) { if (sb.length() > 0) { sb.append(","); } sb.append(it.getName()).append("=").append(it.getValue()); } LOGGER.debug("Rewrote tokens " + sb + " to http request"); } } sendRequest(request, new TracingEndObserver(tracer, obs, ctx.getRequestUUID(), callContext.getRequestUUID(), key), operationDefinition); } protected  AbstractHttpExecutable(final HttpServiceBindingDescriptor bindingDescriptor,
                                  CougarRequestFactory<HR> requestFactory,
                                  Tracer tracer); void init(); @Override void execute(final ExecutionContext ctx, final OperationKey key, final Object[] args,
                        final ExecutionObserver obs, final ExecutionVenue executionVenue, final TimeConstraints timeConstraints); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) void setRemoteAddress(final String host); @ManagedAttribute(description = REMOTE_ADDRESS_DESCRIPTION) String getRemoteAddress(); @ManagedAttribute(description = SERVICE_CONTEXT_PATH_DESCRIPTION) String getServiceContextPath(); abstract TransportMetrics getTransportMetrics(); void setDataBindingFactory(DataBindingFactory dataBindingFactory); void setQueryStringGeneratorFactory(QueryStringGeneratorFactory queryStringGeneratorFactory); void setIdentityTokenResolver(IdentityTokenResolver<HR, HR, X509Certificate[]> identityTokenResolver); void setExceptionTransformer(ExceptionTransformer exceptionTransformer); void setExceptionFactory(ExceptionFactory exceptionFactory); void setTransportSSLEnabled(boolean transportSSLEnabled); void setHttpsKeyPassword(String httpsKeyPassword); void setHttpsKeystore(Resource httpsKeystore); void setHttpsKeystoreType(String httpsKeystoreType); void setHttpsTrustPassword(String httpsTrustPassword); void setHttpsTruststore(Resource httpsTruststore); void setHttpsTruststoreType(String httpsTruststoreType); void setConnectTimeout(int timeout); void setIdleTimeout(int idleTimeout); void setHostnameVerificationDisabled(final boolean hostnameVerificationDisabled); void setRequestFactory(CougarRequestFactory<HR> requestFactory); @ManagedAttribute int getIdleTimeout(); @ManagedAttribute int getConnectTimeout(); @ManagedAttribute String getHttpsTruststoreType(); @ManagedAttribute Resource getHttpsTruststore(); @ManagedAttribute String getHttpsKeystoreType(); @ManagedAttribute Resource getHttpsKeystore(); @ManagedAttribute boolean isHostnameVerificationDisabled(); @ManagedAttribute boolean isTransportSSLEnabled(); @ManagedAttribute boolean isHardFailEnumDeserialisation(); void setHardFailEnumDeserialisation(boolean hardFailEnumDeserialisation); @ManagedAttribute boolean isGzipCompressionEnabled(); @ManagedAttribute void setGzipCompressionEnabled(boolean gzipCompressionEnabled);  }