Got this error while trying to do "Create J2EE 1.4 Java Web Service from WSDL" using JDev 10.1.3.5. This was caused by incorrect definition of fault binding.
Error went away after changing
<fault name="MyFault">
<soap:body use="literal" parts="faultpart"/>
</fault>
</operation>
</binding>
to
<fault name="MyFault">
<soap:fault name="MyFault" use="literal"/>
</fault>
</operation>
</binding>
Filed under: ws | |Comments off
Configuration Properties
General Properties
input.encoding
output.encoding
parser.pool.size
runtime.interpolate.literals
runtime.introspector.uberspect
Logging Properties
# Log file location. Default to velocity.log in the execution path
runtime.log
# Which log system to use. Defaults to Avalon LogKit
runtime.log.logsystem.class=org.apache.velocity.runtime.log.SimpleLog4JLogSystem
# Output stack trace
runtime.log.xxx.stacktrace=true | false
# Long invalid references in template. Default to true. Should be turned off in prod.
runtime.log.invalid.references= true | false
Resource Loader Properties
resource.loader=file, class, jar
# File Resource Loader
file.resource.loader.class= org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path=./src/templates/ch2
file.resource.loader.cache=true
file.resource.loader.modificationCheckInterval=2
# Classpath Resource Loader
class.resource.loader.class = org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
# JAR Resource Loader
jar.resource.loader.class = org.apache.velocity.runtime.resource.loader.JarResourceLoader
jar.resource.loader.path = jar:file:/tmp/ResourceLoader2.jar
# DataSourceResourceLoader
Directive Properties
directive.include.out-put.errormsg.start
directive.include.output.errormsg.end
## Maximum depth of parse (default to 10)
directive.parse.maxdepth
## default to velocityCount
directive.foreach.counter.name
## default to 1
directive.foreach.counter.initial.value
Macro Properties
velocimacro.library=macroLibrary.vm
velocimacro.permissions.allow.inline=true | false
velocimacro.permissions.allow.inline .to.replace.global=true | false
## If true, changes to variables inside macro are visible only inside macro
## Default to false
velocimacro.context.localscope=true | false
## Default to false
velocimacro.library.autoreload=true | false
## Determines whether an inline macro is visible outside the defining template
velocimacro.permissions.allow.inline.local.scope=true | false
Velocity Template Language (VTL)
* Comments
## Single line comment
#* Multiple
line comments *#
* Escape char
## Escape character is \
\$myName = $myName
* Variables
## Variable is prefixed with a dollar sign
$myName
## Formal reference of variables
${myName}
## Quiet reference which will not be displayed if not set
$!undefinedVar
## Access object method
$myDate.getDate()
$myDate.getMonth()
## Access Java bean variables
$myDate.Date
$myDate.Month
## Access Map variables
$myMap.firstName
## Create variables in a template
#set($msg = "Hello world!")
I have a message: $msg
#set($str = "A string")
#set($num = 123)
#set($bool = true)
* Performing arithmetic
- Supports + - * / %
* Logical operators
AND: &&
OR: ||
NOT: !
Directives
* Include
## include template as is, no parsing
#include("footer.vm")
## included template needs to be parsed
#parse("footer.vm")
* If/else
Comparison operators: ==, !=, <, >, <=, >=
#set($myBool = true)
#if($myBool)
It is true
#else
It is false
#end
#if ($myName == "John")
Hello John!
#elseif ($myName == "Jane")
Hello Jane!
#else
Hello world!
#end
* Access collections with #foreach
## Define Velocity array
#set($myArray = ["one", "two", "three"])
#foreach($item in $myArray)
List Item: $item
#end
## Use range
#foreach($num in [1..9])
List number: $num
#end
* Macros
#macro(myMacro $param1 $param2)
\$param1: $param1
\$param2: $param2
#foreach($num in [1..9])
List number: $num
#end
#end
Call macro
#myMacro("John", "Jane")
References
* http://velocity.apache.org/engine/releases/velocity-1.5/user-guide.html
* VTL Reference Guide
* Pro Jakarta Velocity: From Professional to Expert by Rob Harrop Apress © 2004
Filed under: java | |Comments off
Properties
* Two kinds of properties:
- User exit properties
- Java application properties
* Set property file locations in user exit extract parameter file
SetEnv ( GGS_USEREXIT_CONF = "dirprm/cuserexit.properties" )
SetEnv ( GGS_JAVAUSEREXIT_CONF = "dirprm/javaue.properties" )
User Exit Properties
Logging Properties
# log file name prefix
goldengate.log.logname=cuserexit
# log level
goldengate.log.level=ERROR | WARN | INFO | DEBUG
# where to log
goldengate.log.tostdout=false
goldengate.log.tofile=true
# advanced logging
goldengate.log.modules=GENUSEREXIT,LOGMALLOC,JAVAWRITER
goldengate.log.level.LOGMALLOC=ERROR
Generic Properties
# do not change this
goldengate.userexit.writers=javawriter
# user exit checkpoint file prefix
goldengate.userexit.chkptprefix=javaue_
JVM Boot Options
javawriter.bootoptions=-Djava.class.path=javaue/ggue.jar -Dlog4j.configuration=log4j.properties -Xmx256m -Xms128m
Statistics and Reporting
javawriter.stats.display=TRUE
# output both Java and C statistics
javawriter.stats.full=TRUE
# report statistics every 10 min (default is 1 hr)
javawriter.stats.time=600
# report statistics every 600 records (default is 10000 records)
javawriter.stats.numrecs=100
Java Application Properties
Properties for All Handlers
# what handler(s) to use
gg.handlerlist=handler1, handler2
# handler type
gg.handler.handler1.type={jms | jms_map | singlefile | rolling | stdout | stderr | log | com.foo.MyHandler}
Properties for Formatting Output
# formatting (default to built-in XML formatter)
# use Velocity template for formatting
gg.handler.handler1.format=path/to/sample.vm
# use custom Java class for formatting
gg.handler.handler1.format=com.mycompany.MyFormat
# include tables
gg.handler.handler1.includeTables=foo.customer, bar.orders
# exclude tables
gg.handler.handler1.excludeTables=dt_modifydate
# output one operation (op) or one transactioni (tx) per message
gg.handler.handler1.mode=op | tx
# use with custom formatter
gg.handler .handler1.format.mode
Properties for CSV and Fixed-format Output
gg.handler.my_jms_handler1.type=jms_text
gg.handler.my_jms_handler1.format=csv | fixed
gg.handler.my_jms_handler1.properties=/dirprm/my.properties
##############
# in my.properties #
##############
delim=,
quote='
metacols=opcode, table, txind, position
missingColumnChar=M
presentColumnChar=P
nullColumnChar=N
beginTxChar=B
middleTxChar=M
endTxChar=E
wholeTxChar=W
insertChar=INS
updateChar=UPD
deleteChar=DEL
endOfLine=CR
justify=left
includeBefores=false
File Writer Properties
# name of the output file (default to output.xml)
gg.handler.filehandler.file=output.xml
# append upon restart
gg.handler.filehandler.append=true
# rollover when file size is reached (default to 10M)
gg.handler.filehandler.rollover.size=5M
Standard JMS Properties
# destination to use
gg.handler.jmshandler.destination=gg.myqueue
# jms user and password
gg.handler.jmshandler.user
gg.handler.jmshandler.password
# queue or topic
gg.handler.jmshandler.queueortopic=queue
# persistent destination or not
gg.handler.jmshandler.persistent=true | false
# JMS priority (default to 4)
gg.handler.jmshandler.priority=0 - 9
# timetolive (default to zero)
gg.handler.jmshandler.timetolive=0
# connection factory
gg.handler.jmshandler.connectionfactory
gg.handler.jmshandler.usejndi=true | false
# if usejndi=false
gg.handler.jmshandler.connectionUrl=tcp://host:61616?jms.useAsyncSend=true
gg.handler.jmshandler.connection.factoryclass
# for testing purpose, stop sending JMS messages
gg.handlerlist.nop=true
# include from a property file
gg.handler.jmshandler.properties=activemq-default.properties
General Properties
# set additional classpath
gg.classpath
# template for customizing the report format
gg.report.format
Filed under: oracle | |Comments off
Use elementFormDefault to Hide/Expose Namespaces
* 'elementFormDefault' is a binary switch attribute in the schema to control if the origin (i.e. namespace) of each element should be
- hidden (elementFormDefault="unqualified")
- or exposed ("elementFormDefault="qualified").
* elementFormDefault defaults to "unqualified"
* All schemas must have a consistent value for 'elementFormDefault' in order to hide/expose all elements.
Hide Namespaces
* Advantages:
- Simplicity
- Flexibility to change the schema without impact of instance documents.
* Howto:
- Set elementFormDefault="unqualified" in all schemas.
- The element must not be globally declared.
Best Practices
* Make two identical copies of a schema:
- One with elementFormDefault="qualified"
- One with elementFormDefault="unqualified"
* Minimize the use of global elements and attributes.
Notes
* Global elements and attribute must always be qualified.
* Use <include> to include schema with same namespace.
* Use <import> to include schema with different namespace.
References
* Hide (Localize) Namespaces Versus Expose Namespaces or PDF version
Filed under: xml | |Comments off