Developer examples
This reference information provides examples and shows code snippets, command syntax, and configuration values that are relevant to performing application design, development, assembly, and deployment tasks.
You can also search for developer examples by title or by using keywords.
Subtópicos
Call stub generator CSG.xml file
The CSG.xml file provides a complete example of how to start the COBOL call stub generator from Ant using the <csg> custom task or within Rational® Application Developer as an Ant build.Call stub generator CSGBatch.xml file
The CSGBatch.xml Ant build file provides an example for running <csg> against a batch of COBOL files, such as all *.cbl files in a directory. The call stub generator and CSGBatch.xml file are available with the IBM® Rational Application Developer for WebSphere® Software product.COBOL call stub Java class usage example
The COBOL call stub Java™ class usage example shows how a batch application can invoke a COBOL procedure using the COBOL container.COBOL container for batch troubleshooting
If you encounter problems when using COBOL container for batch troubleshooting, there are a number of options that are available to you.COBOL RETURNING, RETURN-CODE, getReturnValue, and getReturnCode parameters
If the COBOL module specifies a RETURNING parameter, it can be retrieved from the stub using the stub.getReturnValue() method. The method returns the Java object representation of the RETURNING parameter, which is the data bindings class generated by the COBOL call stub generator tool.Example: A com.ibm.wsspi.security.token.AuthenticationToken implementation
The following example illustrates an authentication token implementation. The following sample code does not extend an abstract class, but rather implements the com.ibm.wsspi.security.token.AuthenticationToken interface directly. You can implement the interface directly, but it might cause you to write duplicate code. However, you might choose to implement the interface directly if considerable differences exist between how you handle the various token implementations.Example: A com.ibm.wsspi.security.token.SingleSignonToken implementation
Use this file to see an example of a single sign-on implementation. The following sample code does not extend an abstract class, but implements the com.ibm.wsspi.security.token.SingleSignonToken interface directly. You can implement the interface directly, but it might cause you to write duplicate code. However, you might choose to implement the interface directly if considerable differences exist between how you handle the various token implementations.Example: ActiveX client application calling Java methods
In the ActiveX to Enterprise Java Beans (EJB) bridge, methods are called using the native language method invocation syntax.Example: ActiveX client application using helper methods for data type conversion
Generally, data type conversion between ActiveX (Visual Basic and VBScript) and Java methods occurs automatically, as described in ActiveX to EJB bridge, converting data types. However, the byte helper function and currency helper function are provided for cases where automatic conversion is not possible:Example: A custom authentication token login module
This examples shows how to determine if the login is an initial login or a propagation login.Example: A custom single sign-on token login module
This file shows how to determine if the login is an initial login or a propagation login.Example: An HTTP cookie retrieval
The following example shows you how to retrieve a cookie from an HTTP request, decode the cookie so that it is back to your original bytes, and create your custom SingleSignonToken object from the bytes. This example shows how to complete these steps from a login module. However, you also can complete these steps using a servlet.Example: Applet client code requirements
The code used by an applet to talk to an enterprise bean is the same as that used by a stand-alone Java program or a servlet, except for one additional property called java.naming.applet. This property informs the InitialContext and the Object Request Broker (ORB) that this client is an applet rather than a stand-alone Java application or servlet.Example: Applet client tag requirements
Standard applets require the HTML <APPLET> tag to identify the applet to the browser. The <APPLET> tag invokes the Java virtual machine (JVM) of the browser. It can also be replaced by <OBJECT> and <EMBED> tags.Exemplo: Cache de um objeto de comando
Os comandos que podem ser armazenados em cache são armazenados em cache para reutilização em um mecanismo semelhante para servlets e arquivos JSP (JavaServer Pages).Exemplo: Armazenando em Cache Serviços da Web.
É possível construir um conjunto de políticas de cache e mensagens SOAP para um aplicativo de serviços da web.Example: com.ibm.wsspi.security.token.AuthorizationToken implementation
Use this file to see an example of a AuthorizationToken implementation. The following sample code does not extend an abstract class, but rather implements the com.ibm.wsspi.security.token.AuthorizationToken interface directly. You can implement the interface directly, but it might cause you to write duplicate code. However, you might choose to implement the interface directly if there are considerable differences between how you handle the various token implementations.Example: com.ibm.wsspi.security.token.PropagationToken implementation
Use this file to see an example of a propagation token implementation. The following sample code does not extend an abstract class, but implements the com.ibm.wsspi.security.token.PropagationToken interface directly. You can implement the interface directly, but it might cause you to write duplicate code. However, you might choose to implement the interface directly if considerable differences exist between how you handle the various token implementations.Exemplo, Configurando as Classes do Manipulador para os Descritores de Implementação de Serviços da Web
Este cenário explica como incluir uma classe de rotina de tratamento cliente e servidor em um aplicativo de amostra, WebServicesSamples.ear. As classes de rotina de tratamento exibem mensagens quando recebem um pedido ou resposta para manipular.Exemplo: Configurando o Serviço de Cache Dinâmico
Este exemplo reúne todas as etapas para configurar o serviço de cache dinâmico com o arquivo cachespec.xml, mostrando o uso das regras de geração de ID de cache, IDs de dependência e regras de invalidação.Exemplo: Configurando o Descritor de Implementação do Portlet Estendido para Desativar PortletServingServlet
O atendimento de URL suporta acesso direto a todas as funções e estados de um portlet, criando as URLs apropriadas. Em uma configuração de produção, em que o portlet é atendido por meio de um aplicativo de portal corporativo que aplica seu próprio controle de acesso, é considerado risco à segurança. Definindo a propriedade portletServingEnabled como false, um administrador pode assegurar-se de que um portlet sensível nunca seja acessado por atendimento de URL direta.Example: Creating a web service that uses the JAX-WS Web Services Addressing API to access a generic web service resource instance
Consider an IT organization that has a network of printers that it wants to manage using web services. The organization might represent each printer as a resource that is addressed through an endpoint reference. This example shows how to code such a service by using the JAX-WS Web Services Addressing (WS-Addressing) application programming interfaces (APIs) that are provided by WebSphere Application Server.Example: custom AuthorizationToken login module
This file shows how to determine if the login is an initial login or a propagation login.Example: Custom propagation token login module
This example shows how to determine if the login is an initial login or a propagation login.Example: Enabling logging and tracing for activeX client applications
The ActiveX to EJB bridge provides two logging and tracing formats: Windows Application Event Log and Java Trace Log.Example: Enabling logging and tracing for application clients
The ActiveX to EJB bridge provides two logging and tracing formats: Windows Application Event Log and Java Trace Log.Example: Enterprise bean application code
The following Enterprise JavaBeans (EJB) component example illustrates the use of the isCallerInRole and the getCallerPrincipal methods in an EJB module.Exemplo: Obtendo um Contexto Inicial Definindo a Propriedade de Provedor de URL
Em geral, clientes JNDI (Java Naming and Directory Interface) devem assumir que o ambiente correto já está configurado, não sendo necessário então definir explicitamente os valores de propriedade e transmiti-los ao construtor InitialContext. Entretanto, um cliente JNDI talvez precise acessar um espaço de nomes diferente do identificado em seu ambiente. Neste caso, é necessário definir explicitamente a propriedade java.naming.provider.url (URL do provedor) utilizada pelo construtor InitialContext. Um URL do provedor contém informações do servidor de inicialização que a fábrica de contexto inicial pode utilizar para obter um contexto inicial. Os valores de propriedades passados diretamente para o construtor InitialContext têm prioridade sobre as definições dessas mesmas propriedades encontradas em outro lugar no ambiente.Exemplo: Obtendo um Contexto Inicial com CosNaming
No WebSphere Application Server um contexto inicial é obtido de um servidor de auto-inicialização. O endereço para o servidor de bootstrap consiste em um host e porta. Para obter um contexto inicial, é preciso conhecer o host e a porta para o servidor que é utilizado como o servidor de bootstrap.Exemplo: Obtendo o Contexto Inicial Padrão
Existem várias formas de um programa obter o contexto inicial padrão.Example: Looking up an EJB home or business interface with JNDI
Most applications that use Java Naming and Directory Interface (JNDI) run in a container. Some do not. The name used to look up an object depends on whether or not the application is running in a container. Sometimes it is more convenient for an application to use a corbaname URL as the lookup name. Container-based JNDI clients and thin Java clients can use a corbaname URL.Example: Looking up an EJB home with CosNaming
You can look up an EJB home or other CORBA object from a WebSphere Application Server name server through the CORBA CosNaming interface.Example: Passing SOAP messages with attachments by using WSIF
Information and example code for using the Web Services Invocation Framework (WSIF) SOAP provider to pass attachments within a MIME multipart/related message in such a way that the SOAP processing rules for a standard SOAP message are not changed. This includes how to write the Web Services Description Language (WSDL) extensions for SOAP attachments, and how to work with types and type mappings.Exemplo: Verificação de Consistência Leitura-Leitura
A verificação de consistência Leitura-Leitura aplica-se somente aos beans LifeTimeInCache cujos dados são lidos de outra transação.Example: Sample configuration for Web Services Security for a version 5.x application
To secure a version 5.x application with Web Services Security, you must define the security constraints in the IBM extension deployment descriptors and in IBM extension bindings. Sample keystore files and default binding information are provided for a sample configuration to demonstrate what IBM deployment descriptor extensions and bindings can do.Exemplo: Configurando Informações do Cliente com a API setClientInformation(Properties)
É possível configurar as informações do cliente do WebSphere Application Server nas conexões para passar essas informações para o seu banco de dados com essa API.Example: Setting the provider URL property to select a different root context as the initial context
Each server contains its own server root context, and, when bootstrapping to a server, the server root is the default initial JNDI context. Most of the time, this default is the desired initial context, since system artifacts such as EJB homes are bound there. However, other root contexts exist, which can contain bindings of interest. It is possible to specify a provider URL to select other root contexts.Exemplo: Classe de Servlet Proxy do Servlet SIP
Exemplo: Proxy Simples de Servlet SIP
A classe SendOnServlet é um servlet SIP simples que executará a função básica de ser chamada em cada INVITE e enviar o pedido a partir disso.Exemplo: Proxy Simples de Servlet SIP
Este é um exemplo de servlet de um proxy simples.Example: Using an ActiveX client application to access a Java class or object
You can use Java proxy objects with the ActiveX to Enterprise JavaBeans (EJB) bridge.Exemplo: Utilizando um Bean de Entidade de Leitura
Um cenário de uso e exemplo de como escrever um aplicativo EJB (Enterprise JavaBeans) que utiliza um bean de entidade de leitura.Example: Using connections with concurrency
A Runnable or Callable can use the connections that its creating component obtained using java:comp resource references.Example: Using JAX-WS properties to manipulate SOAP headers in a JAX-WS handler
WebSphere Application Server provides extensions to the Java API for XML-Based Web Services (JAX-WS) and Web Services for Java Platform, Enterprise Edition (Java EE) client programming models, including the jaxws.binding.soap.headers.outbound and jaxws.binding.soap.headers.inbound properties. This example shows how to use these two properties to manipulate SOAP headers in a JAX-WS handler.Example: Using the local interface for Dynamic query
When you run a dynamic Enterprise JavaBeans (EJB) query using the local interface, you are calling the executeQuery method on the QueryLocal interface. This interface does not initiate a transaction for the method; therefore you must explicitly establish a transaction context for the query to run.Example: Using the portlet aggregation tag library
You can use the aggregation tag library to aggregate multiple portlets to have multiple and different content on one page. The library can be used by every JavaServer Pages (JSP) file that has been included by a servlet.Example: Using the remote interface for Dynamic query
When you run a dynamic Enterprise JavaBeans (EJB) query using the remote interface, you are calling the executeQuery method on the Query interface. The executeQuery method has a transaction attribute of REQUIRED for this interface; therefore you do not need to explicitly establish a transaction context for the query to run.Example: Using the work area partition manager
Example: Using tsx:repeat JavaServer Pages tag to iterate over a results set (deprecated)
The <tsx:repeat> tag iterates over a results set. The results set is contained within a bean. The bean can be a static bean, for example, a bean created by using the IBM WebSphere Studio database wizard, or a dynamically generated bean, for example, a bean generated by the <tsx:dbquery> syntax.Example: Viewing a System.out message
The ActiveX to Enterprise JavaBeans (EJB) bridge does not have a console available to view Java System.out messages. To view these messages when running a stand-alone client program (such as Visual Basic), redirect the output to a file.Exemplo de Código de Serviços da Web
Esse exemplo do Web Services Description Language (WSDL) e dos fragmentos de código mostram como acessar os campos em uma mensagem de serviços da Web para programar uma mediação.


http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=welc_ref_dev_xmp
Nome do arquivo: welc_ref_dev_xmp.html