Search This Blog

Friday, November 25, 2011

Find out whether a Schema is Valid or Not


Some times in SOA you need to find out whether the schema you have designed/developed is valid and conforms to XML schema standards etc.

For this you can use the JDK 1.6 tool xjc.exe to check ,

%JDK_HOME%\bin\xjc.exe <your-schema-file> and check whether you are getting errors or not.
When I ran the xjc command with the original schmea , I got the errors
parsing a schema...
[ERROR] sch-props-correct.2: A schema cannot contain two global components with the same name; this schema contains two occurrences of 'party,IdentificationType'.
  line 45 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/party/party.xsd
[ERROR] rcase-Recurse.2: There is not a complete functional mapping between the particles.
  line 7 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/local-party.xsd
[ERROR] derivation-ok-restriction.5.4.2: Error for type 'LocalPartyType7'.  The particle of the type is not a valid restriction of the particle of the base.
  line 7 of file:/D:/bugs-download/Bug12965191/restriction_example/restriction/schema-restriction/xsd/local-party.xsd
Failed to parse a schema.

The above error indicates that schema is not a valid schema.

Wednesday, November 23, 2011

How to set the SOA composite name


By default no composite name is set when a SOA componenet gets executed.

XPath for Mediator components:
Use the the following XPath expression in an Assign value dialog when you define a routing rule.

med:setCompositeInstanceTitle(title string)

and use the following target tracking.compositeInstanceTitle.
Note: this property will not appear in the property selection dialog, but can be used though.

Java for BPEL components
Add an Embedded Java activity inside your process flow and add the following function to it:

setCompositeInstanceTitle(title string);
for example ,

In the java embeding add the following code ,

System.out.println("Hello, World 11 "+ new java.util.Date());
setCompositeInstanceTitle("Hello, World 11 "+ new java.util.Date());



For 10g use

System.out.println("Hello, World 11 "+ new java.util.Date());
setTitle("Hello, World 11 "+ new java.util.Date());