XMLBeans and xsi:type overrides
The issue is one of the split of responsibility for the XML meta-data and the XML info-set. The XMLBeans classes are allowed to choose XML namespace prefixes at will (following the usual rules about uniqueness) and drop unused namespace prefixes. However the XMLBeans are not allowed to change the values of any elements or attributes which would alter the info-set.
The XML schema type attribute is held in the XML info-set as an attribute and therefore cannot be changed by the XMLBeans, however it also contains details of the namespace prefix.
For example the following piece of XML shows the usage of a xsi:type qualifier :
<v11:createOrderByValueRequest
xmlns:v1="http://videonetworks.com/ServiceActivation/v1-0"
xmlns:v11="http://ossj.org/xml/ServiceActivation/v1-1">
<v11:orderValue xsi:type="v1:VNLCreateOrderValue"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<v11:description>IPTV Consumer Order for WO999</v11:description>
</v11:orderValue>
</v11:createOrderByValueRequest>
If we extract the order value from the createOrderByValueRequest object as the only use of the namespace v1 is within the info-set, under the xsi:type attribute the newly created xml-fragment may look like the following :
<xml-fragment xsi:type="v1:VNLCreateOrderValue"
xmlns="http://ossj.org/xml/ServiceActivation/v1-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" >
<description>IPTV Consumer Order for WO999</description> </orderValue>
This no longer validates as the v1 namespace prefix is not defined. As a workaround we have created a method which checks for xsi:type attributes and inserts the namespaces required based on a set of types and namespaces we are using. The output would then look like :
<xml-fragment xsi:type="v1:VNLCreateOrderValue"
xmlns="http://ossj.org/xml/ServiceActivation/v1-1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:v1="http://videonetworks.com/ServiceActivation/v1-0">
<description>IPTV Consumer Order for WO999</description> </orderValue>
Of course this is a namespace issue. But how can i solve it?
In jdeveloper a see all the variables and just use the graphical assign.
This writes
<to variable="inputVariable" part="payload" query="/payload/client:Reference/client:my_nte"/>
If i change from client: to anything else the workflow does not compile anymore...
Similar Messages
-
JAXB 1.6 and xsi:type attribute
Does JAXB version 1.6 suppurt xsi:type attribute? I have mapped schema to Java classes and when I marshall it to xml, xsi:type attribute is missing.
I found one workaround for the problem,
"<from variable="StopSeq"/>"
As of now , StopSeq was a variable created by me in BPEL file.
I was using this variable to do some calculations.
As a workaround of the problem, I created a schema with "StopSeqType" as a simple int type element.
Then inside the BPEL, I marked the the existing variable "StopSeq" as a type of "StopSeqType" of my new schema.
After this change I found the expected result.
Now my doubt is , Is it the case for all variables created in BPEL ?
If yes , how we can prevent this ? -
Xpath performance and xsi namespace
In my xpath, I need to use the "xsi" namespace to specify the xpath condition. It seems to be the performance of the xpath that uses the "xsi" namespace is extremly slow, compared with a similar xpath that does not use the name space, although the number of retrieved objects are the same in my test case.
What causes such a big difference in speed? Is that possible when I use the "xsi" namespace in the xpath, the xpath is not get rewritten? How can I improve the performance when using "xsi" namespace.
1)xpath not use the namespace
select extract(object_value, '/Test/Group/Object[uniqueName="a1"]') from Test where existsNode(object_value, '/Test/Group[uniqueName="N10001"])=1;
2)xpath use the "xsi" namespace
select extract(object_value, '/Test/Group/Object[uniqueName="a1" and @xsi:type="Architecture"]', 'xmlns="http://www.myspace.com/testXML" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"') from Test where existsNode(object_value, '/Test/Group[uniqueName="N10001"])=1;Yes, you'll need to workout where to split the document.. Good, and typical points to break up the entity are if you have a choice of one or more complex structures.
The following code may help with looking at this..
You'll need to register the XML Schema with gentables="false" so that all the types get generated.. You can then look at the types and see how many columns each type will generate if you build a table on it...
create or replace package XDB_ANALYZE_XMLSCHEMA_11100
authid CURRENT_USER
as
function analyzeStorageModel(COMPLEX_TYPE VARCHAR2) return XMLTYPE;
function analyzeStorageModel(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2) return XMLType;
function analyzeComplexType(COMPLEX_TYPE VARCHAR2) return XMLTYPE;
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2);
function printNestedTables(XML_TABLE varchar2) return XMLType;
function generateSchemaFromTable(P_TABLE_NAME varchar2, P_OWNER varchar2 default USER) return XMLTYPE;
function showSQLTypes(schemaFolder varchar2) return XMLType;
NAMESPACES varchar2(1024) := xdb_namespaces.XMLSCHEMA_PREFIX_XSD || ' ' || xdb_namespaces.XDBSCHEMA_PREFIX_XDB;
end XDB_ANALYZE_XMLSCHEMA_11100;
show errors
create or replace package body XDB_ANALYZE_XMLSCHEMA_11100
as
TYPE STORAGE_MODEL_T is RECORD
TYPE_NAME varchar2(128),
TYPE_OWNER varchar2(32),
STORAGE_MODEL XMLType
TYPE STORAGE_MODEL_LIST_T is TABLE OF STORAGE_MODEL_T;
TYPE BASETYPE_T is RECORD
SUBTYPE varchar2(128),
SUBTYPE_OWNER varchar2(32),
BASETYPE varchar2(128),
BASETYPE_OWNER varchar2(32)
TYPE BASETYPE_LIST_T IS TABLE OF BASETYPE_T;
DEPTH_COUNT NUMBER(2) := 0;
STORAGE_MODEL_LIST STORAGE_MODEL_LIST_T := STORAGE_MODEL_LIST_T();
BASETYPE_LIST BASETYPE_LIST_T := BASETYPE_LIST_T();
function getLocalAttributes(SQLTYPE varchar2, SQLTYPE_OWNER VARCHAR2) return XMLType;
function makeElement(ATTR_NAME varchar2)
return xmltype
as
VALID_NAME varchar2(4000) := ATTR_NAME;
begin
-- dbms_output.put_line('Processing : ' || ATTR_NAME);
if (ATTR_NAME LIKE '%$') THEN
VALID_NAME := SUBSTR(VALID_NAME,1,LENGTH(VALID_NAME) - 1);
end if;
return XMLTYPE( '<' || VALID_NAME || '/>');
end;
function getPathToRoot(SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return varchar2
as
TYPE_HIERARCHY varchar2(4000);
begin
SELECT sys_connect_by_path( OWNER || '.' || TYPE_NAME , '/')
INTO TYPE_HIERARCHY
FROM ALL_TYPES
WHERE TYPE_NAME = SUBTYPE
AND OWNER = SUBTYPE_OWNER
CONNECT BY SUPERTYPE_NAME = PRIOR TYPE_NAME
AND SUPERTYPE_OWNER = PRIOR OWNER
START WITH SUPERTYPE_NAME IS NULL
AND SUPERTYPE_OWNER IS NULL;
return TYPE_HIERARCHY;
end;
function expandSQLType(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return XMLType
as
STORAGE_MODEL XMLTYPE;
ATTRIBUTES XMLTYPE;
EXTENDED_TYPE XMLTYPE;
ATTR_COUNT NUMBER := 0;
CURSOR FIND_EXTENDED_TYPES
is
select TYPE_NAME, OWNER
from ALL_TYPES
where SUPERTYPE_NAME = SUBTYPE
and SUPERTYPE_OWNER = SUBTYPE_OWNER;
begin
dbms_output.put_line('Processing SQLType : "' || SUBTYPE_OWNER || '.' || SUBTYPE || '".' );
STORAGE_MODEL := makeElement(ATTR_NAME);
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@type',SUBTYPE)
into STORAGE_MODEL
from dual;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@typeOwner',SUBTYPE_OWNER)
into STORAGE_MODEL
from dual;
ATTRIBUTES := getLocalAttributes(SUBTYPE, SUBTYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + ATTRIBUTES.extract('/' || ATTRIBUTES.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),ATTRIBUTES)
into STORAGE_MODEL
from DUAL;
for t in FIND_EXTENDED_TYPES loop
EXTENDED_TYPE := expandSQLType('ExtendedType',T.TYPE_NAME,T.OWNER);
ATTR_COUNT := ATTR_COUNT + EXTENDED_TYPE.extract('/' || EXTENDED_TYPE.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),EXTENDED_TYPE)
into STORAGE_MODEL
from DUAL;
end loop;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@columns',ATTR_COUNT)
into STORAGE_MODEL
from dual;
return STORAGE_MODEL;
end;
function getTypeHierarchy(ELEMENT_NAME varchar2, TYPE_HIERARCHY varchar2)
return XMLType
as
SUBTYPE_HIERARCHY varchar2(4000);
ATTRIBUTES XMLTYPE;
SUBTYPE_STORAGE_MODEL XMLTYPE;
STORAGE_MODEL XMLTYPE;
ATTR_COUNT NUMBER := 0;
V_TYPE_OWNER varchar2(32);
V_TYPE_NAME varchar2(128);
CURSOR FIND_EXTENDED_TYPES
is
select TYPE_NAME, OWNER
from ALL_TYPES
where SUPERTYPE_NAME = V_TYPE_NAME
and SUPERTYPE_OWNER = V_TYPE_OWNER;
begin
dbms_output.put_line('Type Hierarchy : ' || TYPE_HIERARCHY );
if DEPTH_COUNT > 25 then
return null;
end if;
DEPTH_COUNT := DEPTH_COUNT + 1;
SUBTYPE_HIERARCHY := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'/',2));
V_TYPE_OWNER := substr(TYPE_HIERARCHY,2,instr(TYPE_HIERARCHY,'.',2) - 2);
if (instr(TYPE_HIERARCHY,'/',-1) > 1) then
V_TYPE_NAME := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'.',2) + 1,instr(TYPE_HIERARCHY,'/',2) - instr(TYPE_HIERARCHY,'.',2) -1);
else
V_TYPE_NAME := substr(TYPE_HIERARCHY,instr(TYPE_HIERARCHY,'.') + 1);
SUBTYPE_HIERARCHY := null;
end if;
dbms_output.put_line('Processing : "' || V_TYPE_OWNER || '"."' || V_TYPE_NAME || '"');
STORAGE_MODEL := makeElement(ELEMENT_NAME);
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@type',V_TYPE_NAME)
into STORAGE_MODEL
from dual;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@typeOwner',V_TYPE_OWNER)
into STORAGE_MODEL
from dual;
ATTRIBUTES := getLocalAttributes(V_TYPE_NAME, V_TYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + ATTRIBUTES.extract('/' || ATTRIBUTES.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),ATTRIBUTES)
into STORAGE_MODEL
from DUAL;
if (SUBTYPE_HIERARCHY is not null) then
SUBTYPE_STORAGE_MODEL := getTypeHierarchy('subType',SUBTYPE_HIERARCHY);
ATTR_COUNT := ATTR_COUNT + SUBTYPE_STORAGE_MODEL.extract('/' || SUBTYPE_STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),SUBTYPE_STORAGE_MODEL)
into STORAGE_MODEL
from DUAL;
else
dbms_output.put_line('Processing All known SubTypes of : "' || V_TYPE_OWNER || '"."' || V_TYPE_NAME || '"');
for t in FIND_EXTENDED_TYPES loop
SUBTYPE_STORAGE_MODEL := expandSQLType('ExtendedType',T.TYPE_NAME,T.OWNER);
ATTR_COUNT := ATTR_COUNT + SUBTYPE_STORAGE_MODEL.extract('/' || SUBTYPE_STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select appendChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),SUBTYPE_STORAGE_MODEL)
into STORAGE_MODEL
from DUAL;
end loop;
end if;
select insertChildXML(STORAGE_MODEL,'/' || STORAGE_MODEL.getRootElement(),'@columns',ATTR_COUNT)
into STORAGE_MODEL
from dual;
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL;
end;
function getStorageModel(TYPE_NAME VARCHAR2, TYPE_OWNER VARCHAR2)
return XMLType
as
BASETYPE varchar2(128);
BASETYPE_OWNER varchar2(32);
STORAGE_MODEL STORAGE_MODEL_T;
begin
dbms_output.put_line('Depth : ' || DEPTH_COUNT || '. Getting Storage Model for "' || TYPE_OWNER || '.' || TYPE_NAME || '".' );
if DEPTH_COUNT > 25 then
return null;
end if;
DEPTH_COUNT := DEPTH_COUNT + 1;
for i in 1..STORAGE_MODEL_LIST.count loop
STORAGE_MODEL := STORAGE_MODEL_LIST(i);
if (STORAGE_MODEL.TYPE_NAME = TYPE_NAME and STORAGE_MODEL.TYPE_OWNER = TYPE_OWNER) then
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL.STORAGE_MODEL;
end if;
end loop;
STORAGE_MODEL.TYPE_NAME := TYPE_NAME;
STORAGE_MODEL.TYPE_OWNER := TYPE_OWNER;
STORAGE_MODEL.STORAGE_MODEL := getTypeHierarchy('RootType',getPathToRoot(TYPE_NAME,TYPE_OWNER));
STORAGE_MODEL_LIST.extend(1);
STORAGE_MODEL_LIST(STORAGE_MODEL_LIST.count) := STORAGE_MODEL;
DEPTH_COUNT := DEPTH_COUNT - 1;
return STORAGE_MODEL.STORAGE_MODEL;
end;
function getLocalAttributes(SQLTYPE varchar2, SQLTYPE_OWNER VARCHAR2)
return XMLType
as
CHILD_ATTR XMLTYPE;
ATTR_COUNT NUMBER := 0;
COLLECTION_TYPE varchar2(128);
COLLECTION_OWNER varchar2(32);
SUPERTYPE varchar2(128);
STORAGE_MODEL xmlType;
SQL_ATTRIBUTES XMLTYPE := xmlType('<SQLAttributes/>');
CURSOR FIND_CHILD_ATTRS
is
select ATTR_NAME, ATTR_TYPE_OWNER, ATTR_TYPE_NAME, INHERITED
from ALL_TYPE_ATTRS
where TYPE_NAME = SQLTYPE
and OWNER = SQLTYPE_OWNER
and INHERITED = 'NO'
order by ATTR_NO;
begin
for ATTR in FIND_CHILD_ATTRS loop
CHILD_ATTR := makeElement(ATTR.ATTR_NAME);
begin
-- Check for Attributes based on collection types, With Nested Table storage each Collection will cost 2 columns.
select ELEM_TYPE_NAME, ELEM_TYPE_OWNER
into COLLECTION_TYPE, COLLECTION_OWNER
from ALL_COLL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
-- Attribute is a Collection Type. Each Collection requires 2 columns.
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@collectionType',COLLECTION_TYPE)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@collectionOwner',COLLECTION_OWNER)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@columns',2)
into CHILD_ATTR
from dual;
exception
when no_data_found then
-- Attribute is not a collection type.
begin
-- Check for Attributes based on non-scalar types.
select SUPERTYPE_NAME
into SUPERTYPE
from ALL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
-- Attribute is based on a non-scalar type. Find the Storage Model for this type.
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@type',ATTR.ATTR_TYPE_NAME)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@owner',ATTR.ATTR_TYPE_OWNER)
into CHILD_ATTR
from dual;
STORAGE_MODEL := getStorageModel(ATTR.ATTR_TYPE_NAME, ATTR.ATTR_TYPE_OWNER);
select appendChildXML(CHILD_ATTR,'/' || ATTR.ATTR_NAME,STORAGE_MODEL)
into CHILD_ATTR
from DUAL;
-- The cost of a non scalar Type is the number of attributes plus one for Type and one for the TYPEID.
select insertChildXML(CHILD_ATTR,'/' || ATTR.ATTR_NAME,'@columns',STORAGE_MODEL.extract(STORAGE_MODEL.GETROOTELEMENT() || '/@columns').getNumberVal() + 2)
into CHILD_ATTR
from dual;
exception
when no_data_found then
-- Attribute is based on a scalar type
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@type',ATTR.ATTR_TYPE_NAME)
into CHILD_ATTR
from dual;
select insertChildXML(CHILD_ATTR,'/' || CHILD_ATTR.getRootElement(),'@columns',1)
into CHILD_ATTR
from dual;
end;
end;
select appendChildXML(SQL_ATTRIBUTES,'/' || SQL_ATTRIBUTES.getRootElement(),CHILD_ATTR)
into SQL_ATTRIBUTES
from DUAL;
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.getRootElement() || '/@columns').getNumberVal();
end loop;
select insertChildXML(SQL_ATTRIBUTES,'/' || SQL_ATTRIBUTES.getRootElement(),'@columns',ATTR_COUNT)
into SQL_ATTRIBUTES
from dual;
return SQL_ATTRIBUTES;
end;
function analyzeStorageModel(ATTR_NAME VARCHAR2, SUBTYPE VARCHAR2, SUBTYPE_OWNER VARCHAR2)
return XMLType
as
ROOT_NODE_NAME VARCHAR2(128);
TYPE_DEFINITION XMLTYPE;
STORAGE_MODEL XMLTYPE;
ATTR_COUNT NUMBER := 0;
begin
dbms_output.put_line('Processing Attribute : "' || ATTR_NAME || '". SQLType="' || SUBTYPE_OWNER || '.' || SUBTYPE || '".' );
TYPE_DEFINITION := makeElement(ATTR_NAME);
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@type',SUBTYPE)
into TYPE_DEFINITION
from dual;
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@owner',SUBTYPE_OWNER)
into TYPE_DEFINITION
from dual;
STORAGE_MODEL := getStorageModel(SUBTYPE, SUBTYPE_OWNER);
ATTR_COUNT := ATTR_COUNT + STORAGE_MODEL.extract('/' || STORAGE_MODEL.getRootElement() || '/@columns').getNumberVal();
select insertChildXML(TYPE_DEFINITION,'/' || TYPE_DEFINITION.getRootElement(),'@columns',ATTR_COUNT)
into TYPE_DEFINITION
from dual;
select appendChildXML
TYPE_DEFINITION,
'/' || TYPE_DEFINITION.getRootElement(),
STORAGE_MODEL
into TYPE_DEFINITION
from DUAL;
return TYPE_DEFINITION;
end;
function analyzeStorageModel(COMPLEX_TYPE VARCHAR2)
return XMLTYPE
as
SQLTYPE VARCHAR2(128);
SQLTYPE_OWNER VARCHAR2(32);
RESULT XMLTYPE;
begin
STORAGE_MODEL_LIST := STORAGE_MODEL_LIST_T();
select SQLTYPE, SQLTYPE_OWNER
into SQLTYPE, SQLTYPE_OWNER
from USER_XML_SCHEMAS,
xmlTable
xmlnamespaces
'http://www.w3.org/2001/XMLSchema' as "xsd",
'http://xmlns.oracle.com/xdb' as "xdb"
'/xsd:schema/xsd:complexType'
passing Schema
columns
COMPLEX_TYPE_NAME varchar2(4000) path '@name',
SQLTYPE varchar2(128) path '@xdb:SQLType',
SQLTYPE_OWNER varchar2(32) path '@xdb:SQLSchema'
where COMPLEX_TYPE_NAME = COMPLEX_TYPE;
-- dbms_output.put_line('Processing SQLType : "' || SQLTYPE_OWNER || '.' || SQLTYPE || '".' );
return analyzeStorageModel(COMPLEX_TYPE,SQLTYPE,SQLTYPE_OWNER);
exception
when no_data_found then
dbms_output.put_line('Unable to find SQLType mapping for complexType : "' || COMPLEX_TYPE || '".' );
return null;
end;
function analyzeSQLType(ATTR_NAME VARCHAR2, TARGET_TYPE_NAME VARCHAR2, TARGET_TYPE_OWNER VARCHAR2)
return XMLType
as
ROOT_NODE_NAME VARCHAR2(128);
ATTR_DETAIL XMLTYPE;
XPATH_EXPRESSION VARCHAR2(129);
CURSOR FIND_CHILD_ATTRS is
select ATTR_NAME, ATTR_TYPE_OWNER, ATTR_TYPE_NAME, INHERITED
from ALL_TYPE_ATTRS
where OWNER = TARGET_TYPE_OWNER
and TYPE_NAME = TARGET_TYPE_NAME
order by ATTR_NO;
CHILD_ATTR XMLTYPE;
ATTR_COUNT NUMBER := 0;
TEMP number;
COLLECTION_TYPE_NAME varchar2(256);
COLLECTION_TYPE_OWNER varchar2(256);
begin
-- dbms_output.put_line('Processing Attribute ' || ATTR_NAME || ' of ' || TARGET_TYPE_OWNER || '.' || TARGET_TYPE_NAME );
ATTR_DETAIL := makeElement(ATTR_NAME);
XPATH_EXPRESSION := '/' || ATTR_DETAIL.GETROOTELEMENT();
for ATTR in FIND_CHILD_ATTRS loop
begin
select ELEM_TYPE_NAME, ELEM_TYPE_OWNER
into COLLECTION_TYPE_NAME, COLLECTION_TYPE_OWNER
from ALL_COLL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
CHILD_ATTR := analyzeSQLType(ATTR.ATTR_NAME, COLLECTION_TYPE_NAME, COLLECTION_TYPE_OWNER );
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.GETROOTELEMENT() || '/@columns').getNumberVal();
select appendChildXML(ATTR_DETAIL,XPATH_EXPRESSION,CHILD_ATTR)
into ATTR_DETAIL
from DUAL;
exception
when no_data_found then
begin
select 1
into TEMP
from ALL_TYPES
where TYPE_NAME = ATTR.ATTR_TYPE_NAME
and OWNER = ATTR.ATTR_TYPE_OWNER;
CHILD_ATTR := analyzeSQLType(ATTR.ATTR_NAME, ATTR.ATTR_TYPE_NAME, ATTR.ATTR_TYPE_OWNER );
ATTR_COUNT := ATTR_COUNT + CHILD_ATTR.extract('/' || CHILD_ATTR.GETROOTELEMENT() || '/@columns').getNumberVal();
select appendChildXML(ATTR_DETAIL,XPATH_EXPRESSION,CHILD_ATTR)
into ATTR_DETAIL
from DUAL;
exception
when no_data_found then
ATTR_COUNT := ATTR_COUNT + 1;
end;
end;
end loop;
select insertChildXML(ATTR_DETAIL,XPATH_EXPRESSION,'@columns',ATTR_COUNT)
into ATTR_DETAIL
from dual;
return ATTR_DETAIL;
end;
function analyzeComplexType(COMPLEX_TYPE VARCHAR2)
return XMLType
as
RESULT xmltype;
SQLTYPE varchar2(128);
SQLTYPE_OWNER varchar2(32);
begin
select SQLTYPE, SQLTYPE_OWNER
into SQLTYPE, SQLTYPE_OWNER
from USER_XML_SCHEMAS,
xmlTable
xmlnamespaces
'http://www.w3.org/2001/XMLSchema' as "xsd",
'http://xmlns.oracle.com/xdb' as "xdb"
'/xsd:schema/xsd:complexType'
passing Schema
columns
COMPLEX_TYPE_NAME varchar2(4000) path '@name',
SQLTYPE varchar2(128) path '@xdb:SQLType',
SQLTYPE_OWNER varchar2(32) path '@xdb:SQLSchema'
where COMPLEX_TYPE_NAME = COMPLEX_TYPE;
result := analyzeSQLType(COMPLEX_TYPE,SQLTYPE,SQLTYPE_OWNER);
select insertChildXML(RESULT,'/' || COMPLEX_TYPE,'@SQLType',SQLTYPE)
into result
from dual;
return result;
end;
function showSQLTypes(schemaFolder varchar2) return XMLType
is
xmlSchema XMLTYPE;
begin
select xmlElement
"TypeList",
xmlAgg
xmlElement
"Schema",
xmlElement
"ResourceName",
extractValue(res,'/Resource/DisplayName')
xmlElement
"complexTypes",
select xmlAgg
xmlElement
"complexType",
xmlElement
"name",
extractValue(value(XML),'/xsd:complexType/@name',NAMESPACES)
xmlElement
"SQLType",
extractValue(value(XML),'/xsd:complexType/@xdb:SQLType',NAMESPACES)
from table
xmlsequence
extract
xdburitype(p.path).getXML(),
'/xsd:schema/xsd:complexType',
NAMESPACES
) xml
-- order by extractValue(value(XML),'/xsd:complexType/@name',NAMESPACES)
).extract('/*')
into xmlSchema
from path_view p
where under_path(res,schemaFolder) = 1
order by extractValue(res,'/Resource/DisplayName');
return xmlSchema;
end;
procedure renameCollectionTable (XMLTABLE varchar2, XPATH varchar2, COLLECTION_TABLE_PREFIX varchar2)
as
SYSTEM_GENERATED_NAME varchar2(256);
COLLECTION_TABLE_NAME varchar2(256);
CLUSTERED_INDEX_NAME varchar2(256);
PARENT_INDEX_NAME varchar2(256);
RENAME_STATEMENT varchar2(4000);
begin
COLLECTION_TABLE_NAME := COLLECTION_TABLE_PREFIX || '_TABLE';
CLUSTERED_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_DATA';
PARENT_INDEX_NAME := COLLECTION_TABLE_PREFIX || '_LIST';
select TABLE_NAME
into SYSTEM_GENERATED_NAME
from ALL_NESTED_TABLES
where PARENT_TABLE_NAME = XMLTABLE
and PARENT_TABLE_COLUMN = XPATH
and OWNER = USER;
RENAME_STATEMENT := 'alter table ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' ||COLLECTION_TABLE_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_INDEXES
where TABLE_NAME = COLLECTION_TABLE_NAME
and INDEX_TYPE = 'IOT - TOP'
and OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || CLUSTERED_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
begin
select INDEX_NAME
into SYSTEM_GENERATED_NAME
from ALL_IND_COLUMNS
where COLUMN_NAME = XPATH
and TABLE_NAME = XMLTABLE
and TABLE_OWNER = USER;
RENAME_STATEMENT := 'alter index ' || USER || '."' || SYSTEM_GENERATED_NAME || '" rename to "' || PARENT_INDEX_NAME || '"';
-- dbms_output.put_line(RENAME_STATEMENT);
execute immediate RENAME_STATEMENT;
exception
when NO_DATA_FOUND then
null;
end;
end;
function processNestedTable(currentLevel in out number, currentNode in out XMLType, query SYS_REFCURSOR)
return XMLType
is
thisLevel number;
thisNode xmlType;
result xmlType;
begin
thisLevel := currentLevel;
thisNode := currentNode;
fetch query into currentLevel, currentNode;
if (query%NOTFOUND) then
currentLevel := -1;
end if;
while (currentLevel >= thisLevel) loop
-- Next Node is a decendant of sibling of this Node.
if (currentLevel > thisLevel) then
-- Next Node is a decendant of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlElement
"Collection",
extract(thisNode,'/Collection/*'),
xmlElement
"NestedCollections",
result
into thisNode
from dual;
else
-- Next node is a sibling of this Node.
result := processNestedTable(currentLevel, currentNode, query);
select xmlconcat(thisNode,result) into thisNode from dual;
end if;
end loop;
-- Next Node is a sibling of some ancestor of this node.
return thisNode;
end;
function printNestedTables(XML_TABLE varchar2)
return XMLType
is
query SYS_REFCURSOR;
result XMLType;
rootLevel number := 0;
rootNode xmlType;
begin
open query for
select level, xmlElement
"Collection",
xmlElement
"CollectionId",
PARENT_TABLE_COLUMN
) as XML
from USER_NESTED_TABLES
connect by PRIOR TABLE_NAME = PARENT_TABLE_NAME
start with PARENT_TABLE_NAME = XML_TABLE;
fetch query into rootLevel, rootNode;
result := processNestedTable(rootLevel, rootNode, query);
select xmlElement
"NestedTableStructure",
result
into result
from dual;
return result;
end;
function generateSchemaFromTable(P_TABLE_NAME varchar2, P_OWNER varchar2 default USER)
return XMLTYPE
as
xmlSchema XMLTYPE;
begin
select xmlElement
"xsd:schema",
xmlAttributes
'http://www.w3.org/2001/XMLSchema' as "xmlns:xsd",
'http://xmlns.oracle.com/xdb' as "xmlns:xdb"
xmlElement
"xsd:element",
xmlAttributes
'ROWSET' as "name",
'rowset' as "type"
xmlElement
"xsd:complexType",
xmlAttributes
'rowset' as "name"
xmlElement
"xsd:sequence",
xmlElement
"xsd:element",
xmlAttributes
'ROW' as "name",
table_name || '_T' as "type",
'unbounded' as "maxOccurs"
xmlElement
"xsd:complexType",
xmlAttributes
table_name || '_T' as "name"
xmlElement
"xsd:sequence",
xmlAgg(ELEMENT order by INTERNAL_COLUMN_ID)
into xmlSchema
from (select TABLE_NAME, INTERNAL_COLUMN_ID,
case
when DATA_TYPE = 'VARCHAR2' then
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
xmlElement
"xsd:simpleType",
xmlElement
"xsd:restriction",
xmlAttributes
'xsd:string' as "base"
xmlElement
"xsd:maxLength",
xmlAttributes
DATA_LENGTH as "value"
when DATA_TYPE = 'DATE' then
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
'xsd:dateTime' as "type",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
else
xmlElement
"xsd:element",
xmlattributes
column_name as "name",
'xsd:anySimpleType' as "type",
column_name as "xdb:SQLName",
DATA_TYPE as "xdb:SQLTYPE"
end ELEMENT
from all_tab_cols c
where c.TABLE_NAME = P_TABLE_NAME
and c.OWNER = P_OWNER
group by TABLE_NAME;
return xmlSchema;
end;
end XDB_ANALYZE_XMLSCHEMA_11100;
show errors
--You can use this as follows...
SQL> set long 100000
SQL> select xdb_analyze_xmlschema.analyzeStorageModel('ComponentA') from dual;
<ComponentA type="COMPONENTA_T" owner="XDBTEST" columns="50">
<RootType type="COMPONENTA_T" typeOwner="XDBTEST" columns="50">
<SQLAttributes columns="14">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<COMPONENTA_UNIQUENAME type="COMPONENTA_UNIQUENAME_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTA_UNIQUENAME_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTA_UNIQUENAME>
<COMPONENTA_DESCRIPTION type="COMPONENTA_DESCRIPTION_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTA_DESCRIPTION_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTA_DESCRIPTION>
</SQLAttributes>
<ExtendedType type="COMPONENTB_T" typeOwner="XDBTEST" columns="30">
<SQLAttributes columns="12">
<COMPONENTB_CONTROLNUMBER type="COMPONENTB_CONTROLNUMBER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTB_CONTROLNUMBER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTB_CONTROLNUMBER>
<COMPONENTB_COREFOLDER type="COMPONENTB_COREFOLDER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTB_COREFOLDER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTB_COREFOLDER>
</SQLAttributes>
<ExtendedType type="COMPONENTD_T" typeOwner="XDBTEST" columns="18">
<SQLAttributes columns="18">
<COMPONENTD_FINDINGTYPE type="COMPONENTD_FINDINGTYPE_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_FINDINGTYPE_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_FINDINGTYPE>
<COMPONENTD_PRIORITY type="COMPONENTD_PRIORITY_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_PRIORITY_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_PRIORITY>
<COMPONENTD_SUMMARY type="COMPONENTD_SUMMARY_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTD_SUMMARY_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTD_SUMMARY>
</SQLAttributes>
</ExtendedType>
</ExtendedType>
<ExtendedType type="COMPONENTC_T" typeOwner="XDBTEST" columns="6">
<SQLAttributes columns="6">
<COMPONENTC_CONTROLNUMBER type="COMPONENTC_CONTROLNUMBER_T" owner="XDBTEST" columns="6">
<RootType type="COMPONENTC_CONTROLNUMBER_T" typeOwner="XDBTEST" columns="4">
<SQLAttributes columns="4">
<SYS_XDBPD collectionType="RAW" collectionOwner="" columns="2"/>
<SYS_XDBBODY type="VARCHAR2" columns="1"/>
<DISPLAYNAME type="VARCHAR2" columns="1"/>
</SQLAttributes>
</RootType>
</COMPONENTC_CONTROLNUMBER>
</SQLAttributes>
</ExtendedType>
</RootType>
</ComponentA>THis will tell you that a table based xml element of the complexType 'componentA' will have approx 50 columns.. -
Web Services, Schemas, and the xsi:type attribute
Hi List,
I have several questions reqarding web services, schemas, and the use of the xsi:type
attribute in messages.
Schemas:
Q1: How complex can a web service schema be?
Q2: Is it reasonable for a schema to contain derived types by extension [1]?
Q3: Could you use the International Purchase Order Schema [2] with a web service?
xsi:type
Q1: Is it reasonable for a web service to use the xsi:type attribute in the message(s)?
If I am interpreting Section 4.1.15 of the BasicProfile-1.0a [3] correctly, this
appears to be appropriate in certain circumstances.
Q2: When is it appropriate to use the xsi:type attribute? If a schema contains
derived types by extension [1]? If a schema contains xsd:anyType?
Q3: How does using the xsi:type attribute affect interoperability?
And finally,
Q4: Are there any examples available demonstrating the use of the xsi:type attribute
in messages?
Whew !!!
TIA,
Kent
[1] http://www.w3.org/TR/xmlschema-0/#DerivExt
[2] http://www.w3.org/TR/xmlschema-0/#ipo.xsd
[3] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.htmlHi Kent,
A few answers inline...
HTH,
Bruce
Kent Kvarfordt wrote:
>
Hi List,
I have several questions reqarding web services, schemas, and the use of the xsi:type
attribute in messages.
Schemas:
Q1: How complex can a web service schema be?There are limits in converting the schema between language
representations, see this section [a] in the docs on roundtripping
generated data types.
[a]
http://edocs.bea.com/wls/docs81/webserv/assemble.html#1074725
Q2: Is it reasonable for a schema to contain derived types by extension [1]?
Q3: Could you use the International Purchase Order Schema [2] with a web service?
xsi:type
Q1: Is it reasonable for a web service to use the xsi:type attribute in the message(s)?
If I am interpreting Section 4.1.15 of the BasicProfile-1.0a [3] correctly, this
appears to be appropriate in certain circumstances.I've not seen this used.
http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html#refinement34259632
>
Q2: When is it appropriate to use the xsi:type attribute? If a schema contains
derived types by extension [1]? If a schema contains xsd:anyType?
Q3: How does using the xsi:type attribute affect interoperability?My thought is that since this is not commonly used, then your risk of
interop failure is high.
>
And finally,
Q4: Are there any examples available demonstrating the use of the xsi:type attribute
in messages?Sorry, I looked and could not find any examples.
>
Whew !!!
TIA,
Kent
[1] http://www.w3.org/TR/xmlschema-0/#DerivExt
[2] http://www.w3.org/TR/xmlschema-0/#ipo.xsd
[3] http://www.ws-i.org/Profiles/Basic/2003-08/BasicProfile-1.0a.html -
Setting xsi:type in XMLBeans
I'm trying to create a schema with an abstract class and two subclasses. (see
below)
The xml saves fine, but when I try to load it the parser doesn't resolve the classes
to the subclass. Is there a way of setting the xsi:type as an attribute so that
when the file is loaded the classes are resolved to their correct type. Is there
a better way of doing this?
Thanks in advance,
Andrew
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.books.org"
xmlns="http://www.books.org"
elementFormDefault="unqualified">
<xsd:complexType name="PublicationType" abstract="true">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Author" type="xsd:string" maxOccurs="unbounded"/>
<xsd:element name="Date" type="xsd:year"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BookType">
<xsd:complexContent>
<xsd:extension base="PublicationType">
<xsd:sequence>
<xsd:element name="ISBN" type="xsd:string"/>
<xsd:element name="Publisher" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="MagazineType">
<xsd:complexContent>
<xsd:extension base="PublicationType">
<xsd:sequence>
<xsd:element name="A" type="xsd:string"/>
<xsd:element name="B" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="BookStore">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Publication" maxOccurs="unbounded" type="PublicationType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>Andrew,
I'm not clear on what you mean when you ask "try to load it ... doesn't
resove the classes to the subclass."
Can you post a code snip here and what you would expect to see?
Roger
"Andrew" <[email protected]> wrote in message news:3f4494e2$[email protected]..
>
I'm trying to create a schema with an abstract class and two subclasses.(see
below)
The xml saves fine, but when I try to load it the parser doesn't resolvethe classes
to the subclass. Is there a way of setting the xsi:type as an attribute sothat
when the file is loaded the classes are resolved to their correct type. Isthere
a better way of doing this?
Thanks in advance,
Andrew
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="http://www.books.org"
xmlns="http://www.books.org"
elementFormDefault="unqualified">
<xsd:complexType name="PublicationType" abstract="true">
<xsd:sequence>
<xsd:element name="Title" type="xsd:string"/>
<xsd:element name="Author" type="xsd:string"maxOccurs="unbounded"/>
<xsd:element name="Date" type="xsd:year"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="BookType">
<xsd:complexContent>
<xsd:extension base="PublicationType">
<xsd:sequence>
<xsd:element name="ISBN" type="xsd:string"/>
<xsd:element name="Publisher" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:complexType name="MagazineType">
<xsd:complexContent>
<xsd:extension base="PublicationType">
<xsd:sequence>
<xsd:element name="A" type="xsd:string"/>
<xsd:element name="B" type="xsd:string"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="BookStore">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Publication" maxOccurs="unbounded"type="PublicationType"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema> -
DSP Web Service Data Source runtime error "Invalid xsi:type qname"
I have created a DSP data service that uses a web service as a data source.
The web service wraps an Oracle PL/SQL package and works when tested independantly of the DSP data service.
When I test the DSP data service using the weblogic workshop test view I get the error below:
weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-elt.4.2: Invalid xsi:type qname: 'ns0:EmpRecUser' in element getEmpResponseElement@http://hr/EmpWebService.wsdl/types/
(The full stack trace and the WSDL imported into DSP are at the bottom of this posting)
I am new to DSP but I have created data services from the DSP tutorials succesfully before.
This is the first data service I have tried to create which is not from a DSP tutorial.
I dont really understand the error message.
It appears to me that type EmpRecUser is being prefixed by the wrong name space. In the WSDL the namespace is 'tns:' in the error message the namespace is: 'ns0'.
<element name="getEmpResponseElement">
<complexType>
<sequence>
<element name="result" type="tns:EmpRecUser" nillable="true"/>
</sequence>
</complexType>
</element>
I created the web service in Oracle J Developer from the tutorial URL below.
http://www.oracle.com/technology/obe/obe1013jdev/10131/wsfromplsqlpackage/devwsfrom%20plsql.htm#p
weblogic.xml.query.exceptions.XQueryDynamicException: {err}XQ0027: Validation failed: error: cvc-elt.4.2: Invalid xsi:type qname: 'ns0:EmpRecUser' in element getEmpResponseElement@http://hr/EmpWebService.wsdl/types/
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.giveToken(XMLValidatorForXMLBeans.java:169)
at weblogic.xml.query.schema.ValidatingIterator.fetchNext(ValidatingIterator.java:148)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at com.bea.ld.wrappers.ws.JAXRPCWebserviceIterator.fetchNext(JAXRPCWebserviceIterator.java:104)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:238)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
at weblogic.xml.query.xdbc.util.Serializer.processNamespaces(Serializer.java:340)
at weblogic.xml.query.xdbc.util.Serializer.processElement(Serializer.java:262)
at weblogic.xml.query.xdbc.util.Serializer.process(Serializer.java:206)
at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:152)
Caused by: weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans$ValidationException: null
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans$ExceptionCollection.add(XMLValidatorForXMLBeans.java:340)
at org.apache.xmlbeans.impl.validator.Validator.emitError(Validator.java:175)
at org.apache.xmlbeans.impl.validator.Validator.emitFieldError(Validator.java:207)
at org.apache.xmlbeans.impl.validator.Validator.emitFieldError(Validator.java:193)
at org.apache.xmlbeans.impl.validator.Validator.beginEvent(Validator.java:458)
at org.apache.xmlbeans.impl.validator.Validator.nextEvent(Validator.java:246)
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processBeginElementToken(XMLValidatorForXMLBeans.java:1205)
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processToken(XMLValidatorForXMLBeans.java:1322)
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.processTokensOnHold(XMLValidatorForXMLBeans.java:1349)
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.gotBeginElementToken(XMLValidatorForXMLBeans.java:772)
at weblogic.xml.query.schema.xmlbeans.XMLValidatorForXMLBeans.giveToken(XMLValidatorForXMLBeans.java:100)
at weblogic.xml.query.schema.ValidatingIterator.fetchNext(ValidatingIterator.java:148)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at com.bea.ld.wrappers.ws.JAXRPCWebserviceIterator.fetchNext(JAXRPCWebserviceIterator.java:104)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
at weblogic.xml.query.iterators.GenericIterator.hasNext(GenericIterator.java:134)
at weblogic.xml.query.runtime.sequences.Subsequence.fetchNext(Subsequence.java:101)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.querycide.QueryAssassin.fetchNext(QueryAssassin.java:54)
at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
at weblogic.xml.query.runtime.qname.InsertNamespaces.fetchNext(InsertNamespaces.java:238)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.runtime.core.QueryIterator.fetchNext(QueryIterator.java:127)
at weblogic.xml.query.iterators.GenericIterator.next(GenericIterator.java:113)
at weblogic.xml.query.xdbc.iterators.ItemIterator.fetchNext(ItemIterator.java:86)
at weblogic.xml.query.iterators.GenericIterator.peekNext(GenericIterator.java:151)
at weblogic.xml.query.xdbc.util.Serializer.processNamespaces(Serializer.java:340)
at weblogic.xml.query.xdbc.util.Serializer.processElement(Serializer.java:262)
at weblogic.xml.query.xdbc.util.Serializer.process(Serializer.java:206)
at weblogic.xml.query.xdbc.util.Serializer.serializeItems(Serializer.java:152)
at com.bea.ld.server.QueryInvocation.getResult(QueryInvocation.java:461)
<definitions
name="EmpWebService"
targetNamespace="http://hr/EmpWebService.wsdl"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://hr/EmpWebService.wsdl"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:tns0="http://hr/EmpWebService.wsdl/types/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
>
<types>
<schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://hr/EmpWebService.wsdl/types/"
elementFormDefault="qualified" xmlns:tns="http://hr/EmpWebService.wsdl/types/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/">
<element name="getEmpElement">
<complexType>
<sequence>
<element name="empNo" type="decimal" nillable="true"/>
</sequence>
</complexType>
</element>
<element name="getEmpResponseElement">
<complexType>
<sequence>
<element name="result" type="tns:EmpRecUser" nillable="true"/>
</sequence>
</complexType>
</element>
<complexType name="EmpRecUser">
<complexContent>
<extension base="tns:EmpRecBase">
<sequence>
<element name="departmentId" type="decimal" nillable="true"/>
<element name="managerId" type="decimal" nillable="true"/>
<element name="hireDate" type="dateTime" nillable="true"/>
<element name="jobId" type="string" nillable="true"/>
<element name="employeeId" type="decimal" nillable="true"/>
<element name="commissionPct" type="decimal" nillable="true"/>
<element name="salary" type="decimal" nillable="true"/>
<element name="lastName" type="string" nillable="true"/>
</sequence>
</extension>
</complexContent>
</complexType>
<complexType name="EmpRecBase">
<sequence/>
</complexType>
</schema>
</types>
<message name="EmpWebService_getEmp">
<part name="parameters" element="tns0:getEmpElement"/>
</message>
<message name="EmpWebService_getEmpResponse">
<part name="parameters" element="tns0:getEmpResponseElement"/>
</message>
<portType name="EmpWebService">
<operation name="getEmp">
<input message="tns:EmpWebService_getEmp"/>
<output message="tns:EmpWebService_getEmpResponse"/>
</operation>
</portType>
<binding name="EmpWebServiceSoapHttp" type="tns:EmpWebService">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="getEmp">
<soap:operation soapAction="http://hr/EmpWebService.wsdl/getEmp"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
</operation>
</binding>
<service name="EmpWebService">
<port name="EmpWebServiceSoapHttpPort" binding="tns:EmpWebServiceSoapHttp">
<soap:address location="http://localhost:8888/PL_SQL_WS-GetEmployee-context-root/EmpWebServiceSoapHttpPort"/>
</port>
</service>
</definitions>DSP validates the results from webservices. Whatever you tested the webservice with outside of DSP, probably does not.
Can you capture the output of the webservice and attach it as well? You can capture the webservice response by running the wls server with the command-line property -Dweblogic.webservice.verbose=true
Can you also open a case with customer support for this? I will not likely have much time to look at it.
- Mike
btw - the namespace prefixes are just place-holders that are defined with xmlns:prefix="some-uri". It is the namespace uri's that must be equivalent. If, in one case you have the definition xmlns:tns="myUri" and in another case xmlns:ns0="myUri" - then tns:EmpRecUser is equivalent to ns0:EmpRecUser.
Perhaps in the webservice result there is no definition, or an incorrect definition for the namespace prefix ns0 - that would explain the complaint about the QName ns0:EmpRecUser. According to the wsdl, there should be a definition for ns0 as :
xmlns:ns0="http://hr/EmpWebService.wsdl"
in the webservice response. -
Is not abstract and does not override abstract method ERROR
Hello. I'm new at all this, and am attempting to recreate a sample code out of my book (Teach Yourself XML in 24 Hours), and I keep getting an error. I appriciate any help.
This is the Error that I get:
DocumentPrinter is not abstract and does not override abstract method skippedEntity(java.lang.String) in org.xml.sax.ContentHandler
public class DocumentPrinter implements ContentHandler, ErrorHandler
^This is the sourcecode:
import org.xml.sax.Attributes;
import org.xml.sax.ContentHandler;
import org.xml.sax.ErrorHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
import org.xml.sax.XMLReader;
public class DocumentPrinter implements ContentHandler, ErrorHandler
// A Constant containing the name of the SAX parser to use.
private static final String PARSER_NAME = "org.apache.xerces.parsers.SAXParser";
public static void main(String[] args)
// Check to see whether the user supplied any command line arguments. If not, print an error and exit.
if (args.length == 0)
System.out.println("No XML document path specified.");
System.exit(1);
// Create a new instance of the DocumentPrinter class.
DocumentPrinter dp = new DocumentPrinter();
try
// Create a new instance of the XML Parser.
XMLReader parser = (XMLReader)Class.forName(PARSER_NAME).newInstance();
// Set the parser's content handler
// parser.setContentHandler(dp);
// Set the parsers error handler
parser.setErrorHandler(dp);
// Parse the file named in the argument
parser.parse(args[0]);
catch (Exception ex)
System.out.println(ex.getMessage());
ex.printStackTrace();
public void characters(char[] ch, int start, int length)
String chars ="";
for (int i = start; i < start + length; i++)
chars = chars + ch;
System.out.println("Recieved characters: " + chars);
public void startDocument()
System.out.println("Start Document.");
public void endDocument()
System.out.println("End of Document.");
public void startElement(String namespaceURI, String localName, String qName, Attributes atts)
System.out.println("Start element: " + localName);
for (int i = 0; i < atts.getLength(); i++)
System.out.println(" Attribute: " + atts.getLocalName(i));
System.out.println(" Value: " + atts.getValue(i));
public void endElement(String namespaceURI, String localName, String qName)
System.out.println("End of element: " + localName);
public void startPrefixMapping(String prefix, String uri)
System.out.println("Prefix mapping: " + prefix);
System.out.println("URI: " + uri);
public void endPrefixMapping(String prefix)
System.out.println("End of prefix mapping: " + prefix);
public void ignorableWhitespace(char[] ch, int start, int length)
System.out.println("Recieved whitespace.");
public void processingInstruction(String target, String data)
System.out.println("Recieved processing instruction:");
System.out.println("Target: " + target);
System.out.println("Data: " + data);
public void setDocumentLocation(Locator locator)
// Nada
public void error(SAXParseException exception)
System.out.println("Parsing error on line " + exception.getLineNumber());
public void fatalError(SAXParseException exception)
System.out.println("Fatal parsing error on line " + exception.getLineNumber());
public void warning(SAXParseException exception)
System.out.println("Warning on line " + exception.getLineNumber());Check to make sure that the arguments are consistent with your ContentHandler class. Probably the wrong type.
I think you forgot to include the skippedEntity method, it seems to be missing. Even if an implemented class has a method that you are not using, you still have to include the method in your code even if it doesn't do anything.
Message was edited by:
ChargersTule1 -
...is not abstract and does not override abstract method compare
Why am I getting the above compile error when I am very clearly overriding abstract method compare (ditto abstract method compareTo)? Here is my code -- which was presented 1.5 code and I'm trying to retrofit to 1.4 -- followed by the complete compile time error. Thanks in advance for your help (even though I'm sure this is an easy question for you experts):
import java.util.*;
This program sorts a set of item by comparing
their descriptions.
public class TreeSetTest
public static void main(String[] args)
SortedSet parts = new TreeSet();
parts.add(new Item("Toaster", 1234));
parts.add(new Item("Widget", 4562));
parts.add(new Item("Modem", 9912));
System.out.println(parts);
SortedSet sortByDescription = new TreeSet(new
Comparator()
public int compare(Item a, Item b) // LINE CAUSING THE ERROR
String descrA = a.getDescription();
String descrB = b.getDescription();
return descrA.compareTo(descrB);
sortByDescription.addAll(parts);
System.out.println(sortByDescription);
An item with a description and a part number.
class Item implements Comparable
Constructs an item.
@param aDescription the item's description
@param aPartNumber the item's part number
public Item(String aDescription, int aPartNumber)
description = aDescription;
partNumber = aPartNumber;
Gets the description of this item.
@return the description
public String getDescription()
return description;
public String toString()
return "[descripion=" + description
+ ", partNumber=" + partNumber + "]";
public boolean equals(Object otherObject)
if (this == otherObject) return true;
if (otherObject == null) return false;
if (getClass() != otherObject.getClass()) return false;
Item other = (Item) otherObject;
return description.equals(other.description)
&& partNumber == other.partNumber;
public int hashCode()
return 13 * description.hashCode() + 17 * partNumber;
public int compareTo(Item other) // OTHER LINE CAUSING THE ERROR
return partNumber - other.partNumber;
private String description;
private int partNumber;
}Compiler error:
TreeSetTest.java:25: <anonymous TreeSetTest$1> is not abstract and does not over
ride abstract method compare(java.lang.Object,java.lang.Object) in java.util.Com
parator
public int compare(Item a, Item b)
^
TreeSetTest.java:41: Item is not abstract and does not override abstract method
compareTo(java.lang.Object) in java.lang.Comparable
class Item implements Comparable
^
2 errorsAccording to the book I'm reading, if you merely take
out the generic from the code, it should compile and
run in v1.4 (assuming, of course, that the class
exists in 1.4). I don't know what book you are reading but that's certainly incorrect or incomplete at least. I've manually retrofitted code to 1.4, and you'll be inserting casts as well as replacing type references with Object (or the erased type, to be more precise).
These interfaces do exist in 1.4, and
without the generics.Exactly. Which means compareTo takes an Object, and you should change your overriding method accordingly.
But this raises a new question: how does my 1.4
compiler know anything about generics? It doesn't and it can't. As the compiler is telling you, those interfaces expect Object. Think about it, you want to implement one interface which declares a method argument type of Object, in several classes, each with a different type. Obviously all of those are not valid overrides. -
Product is not abstract and does not override abstract method
Received the following errors.
Product.java:3: Product is not abstract and does not override abstract method ge
tDisplayText() in Displayable
public class Product implements Displayable
^
Product.java:16: getDisplayText() in Product cannot implement getDisplayText() i
n Displayable; attempting to use incompatible return type
found : void
required: java.lang.String
public void getDisplayText()
^
2 errors
Code reads as follows
import java.text.NumberFormat;
public class Product implements Displayable
private String code;
private String description;
private double price;
public Product()
this.code = "";
this.description = "";
this.price = 0;
public void getDisplayText()
String message =
"Code: " + code + "\n" +
"Description: " + description + "\n" +
"Price: " + this.getFormattedPrice() + "\n";
public Product(String code, String description, double price)
this.code = code;
this.description = description;
this.price = price;
public void setCode(String code)
this.code = code;
public String getCode(){
return code;
public void setDescription(String description)
this.description = description;
public String getDescription()
return description;
public void setPrice(double price)
this.price = price;
public double getPrice()
return price;
public String getFormattedPrice()
NumberFormat currency = NumberFormat.getCurrencyInstance();
return currency.format(price);
Please help!Received the following errors.
Product.java:3: Product is not abstract and does not
override abstract method ge
tDisplayText() in Displayable
public class Product implements Displayable
^
Product.java:16: getDisplayText() in Product cannot
implement getDisplayText() i
n Displayable; attempting to use incompatible return
type
found : void
required: java.lang.String
public void getDisplayText()
^
2 errors
Code reads as follows
Please use the code tags when posting code. There is a code button right above the text box where you enter your post. Click on it and put the code between the code tags.
These error messages are quite clear in telling what is wrong. You have an Interface called Displayable that specifies a method something like thispublic String getDisplayText() {But in your Product source code, you created thismethodpublic void getDisplayText() {The compiler is complaining because the methods are not the same.
You also need to return a String in the method probalby like thisreturn message; -
i am using toplink 10.1.3.0.0 with oracle app server 10.1.2.2, i am using change field optimistic locking and generating the project xml,
application runs great locally in the jdeveloper, but when it is deployed on app server getting following error
here are the headers from both my project.xml as well as session xml..
<?xml version="1.0" encoding="UTF-8"?>
<toplink:object-persistence version="Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)" xmlns:opm="http://xmlns.oracle.com/ias/xsds/opm" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:toplink="http://xmlns.oracle.com/ias/xsds/toplink" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<opm:name>PROJ</opm:name>
<opm:class-mapping-descriptors>
<opm:class-mapping-descriptor xsi:type="toplink:relational-class-mapping-descriptor">
<?xml version="1.0" encoding="UTF-8"?>
<toplink-sessions version="4.5" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<session xsi:type="server-session">
<name>PROJSession</name>
<event-listener-classes/>
<logging xsi:type="toplink-log">
<log-level>finer</log-level>
</logging>
<primary-project xsi:type="xml">PROJ.xml</primary-project>
<login xsi:type="database-login">
<platform-class>oracle.toplink.platform.database.oracle.OraclePlatform</platform-class>
<user-name></user-name>
any help/idea appreciated...
Exception [TOPLINK-9005] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.SessionLoaderException
Exception Description: An exception was thrown while loading the <project-xml> file [PROJ.xml].
Internal Exception: Exception [TOPLINK-25004] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.exceptions.XMLMarshalException
Exception Description: An error occurred unmarshalling the document
Internal Exception: Exception [TOPLINK-27101] (Oracle TopLink - 10g Release 3 (10.1.3.0.0) (Build 060118)): oracle.toplink.platform.xml.XMLPlatformException
Exception Description: An error occurred while parsing the document.
Internal Exception: oracle.xml.parser.v2.XMLParseException: xsi:type "toplink:changed-field-locking-policy" not resolved to a type definition
at oracle.toplink.exceptions.SessionLoaderException.failedToLoadProjectXml(SessionLoaderException.java:74)
at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.loadProjectConfig(TopLinkSessionsFactory.java:316)
at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.createSession(TopLinkSessionsFactory.java:241)
at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildServerSessionConfig(TopLinkSessionsFactory.java:215)
at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildSession(TopLinkSessionsFactory.java:168)
at oracle.toplink.tools.sessionconfiguration.TopLinkSessionsFactory.buildTopLinkSessions(TopLinkSessionsFactory.java:124)
at oracle.toplink.tools.sessionconfiguration.XMLSessionConfigLoader.load(XMLSessionConfigLoader.java:103)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:367)
at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(SessionManager.java:334)
at myProjectPackage.common.data.toplink.ToplinkDataManagerPeer.<init>(ToplinkDataManagerPeer.java:41)
at myProjectPackage.common.data.DataManagerFactory.getDataManagerInstance(DataManagerFactory.java:40)
at myProjectPackage.common.servlet.NYSDOTFilter.getDataManager(NYSDOTFilter.java:964)
at myProjectPackage.common.servlet.NYSDOTFilter.doFilter(NYSDOTFilter.java:144)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:16)
at myProjectPackage.caf.servlet.NYSDOTCAFFilter.doFilter(NYSDOTCAFFilter.java:90)
at com.evermind.server.http.EvermindFilterChain.doFilter(EvermindFilterChain.java:20)
at myProjectPackage.common.servlet.NYSDOTLoginFilter.doFilter(NYSDOTLoginFilter.java:95)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:669)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:340)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:228)
at com.evermind.server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:570)first thanks for your reply,
i already figured that out and deployed it using 10.1.3.1 jars
my question
1) if it is a bug , how come it works fine with jdeveloper (
i would appreciate if you could provide any info about it.
2) i dont want to sound sarcastic , but 10.1.3.1 has of optimistic locking and the recommended solution i found was to use descriptor.getQueryManager().setUpdateCallCacheSize(0);
looks like 10.1.3.1 fixed one bug and introduced other one which was working fine earlier...
is there any other way of fixing optimistic locking issue other than using the
descriptor.getQueryManager().setUpdateCallCacheSize(0);
where i can find the latest/greatest (up to date patched version of toplink)
thanks again for your help -
Xsi:type information is missing after Marshalling in JAXB
Hi,
I'm trying to mock the webservice, i have created classes for schema using JAXB (without any customization) and it's working. But when i try to marhsall my objects , it doesn't generate the xsi:type information of any element and attribute. I want this information since my webservice client needs this information.
I have tried to use mapSimpleTypeDef ="true" generateElementProperty="false" but it doesn�t help.
Following is output of marshal process
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageRetrieveResponseReturn xmlns:java="java:types.api.brokerapi.soap.mms"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<return>
<APIVersion>1.0</APIVersion>
<ErrorCode>1000</ErrorCode>
<ErrorInfo> Success</ErrorInfo>
<BillingInfo xsi:type="java:BillingInfoObject" xsi:nil="true"/>
<HeaderInfo xsi:type="java:HeaderInfoType" xsi:nil="true"/>
<Content xsi:type="java:MessageContentType" xsi:nil="true"/>
</return>
</MessageRetrieveResponseReturn>
I want output to be look like following
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<MessageRetrieveResponseReturn xmlns:java="java:types.api.brokerapi.soap.mms" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<return xsi:type="java:MessageRetrieveResponse" >
<APIVersion xsi:type="java:apiVersionType">1.0</APIVersion>
<ErrorCode xsi:type="xsd:string">1000</ErrorCode>
<ErrorInfo xsi:type="xsd:string">Success</ErrorInfo>
<BillingInfo xsi:type="java:BillingInfoObject" xsi:nil="true"/>
<HeaderInfo xsi:type="java:HeaderInfoType" xsi:nil="true"/>
<Content xsi:type="java:MessageContentType" xsi:nil="true"/>
</return>
</MessageRetrieveResponseReturn>
I'm new to JAXB. Please let me know what I�m missing here
RegardsNot got a single answer , surprise whether the question is too dumb to ask or JAXB doesn't support feature or my requirement is weird :-) ... in any case let me know please
regards -
XSLT Mapper doesn't support xsi:type
I'm starting to think that XSLT Mapper supports only the basic features of XML Schema ...
It (XSLT Mapper in JDeveloper) does not seem to support mapping to generate this kind of element (cannot do it in Design view, when added to the Source view, cannot go back to Design view):
<HighLevel:ParentEntity xsi:type="HighLevel:AChildEntity" xmlns:HighLevel="someNamespace">
<A>ABC</A>
<B>1</B>
<FromAChildEntity>ABCDE</FromAChildEntity>
</HighLevel:ParentEntity>
If we leave this in Source view and run the xsl, the resulting XML has a validation error, the last element (FromAChildEntity is not known). The XML is valid in XML Spy.
This problem combines with not being able to map two source elements to one target element, makes XSLT Mapper not able to deal with XML Schema inheritance at all.... ?I just want to reformat the XML from the original message (didn't realize I had to escape some of the characters). This is the XML that cannot be validated by JDeveloper):
<HighLevel:ParentEntity xsi:type="HighLevel:AChildEntity" xmlns:HighLevel="someNamespace">
<A>ABC</A>
<B>1</B>
<FromAChildEntity>ABCDE</FromAChildEntity>
</HighLevel:ParentEntity> -
How to include atribute xsi:type in the xml generated through java
Hi,
i am generating an xml using java and castor.
I want to include this attribute in my xml:
xsi:type="abc"
for example:
My snippet is:
Underwriting_detail[] underwritingDetail = new Underwriting_detail[1];
underwritingDetail[0] = new Underwriting_detail();
underwritingDetail[0].setContent(fulfillmentPreResponseTO.getUnderwritingDetailsMainAnswer1());
underwritingDetail[0].setQuestion_code(fulfillmentPreResponseTO.getUnderwritingDetailsMainQuestionCode1());
underwritingDetail[0].setAnswer_format(AnswerFormatType.YESNO);
underwritingDetail[0].setSequence_number(fulfillmentPreResponseTO.getUnderwritingDetailsSequenceNumber());
Result is:
<underwriting_detail answer_format="YesNo" sequence_number="1" question_code="JVL1Q1">NO</underwriting_detail>
The requirement is:
<underwriting_detail xsi:type="NonStdUWQuestion" answer_format="YesNo" sequence_number="1" question_code="JVL1Q1">No</underwriting_detail>
There is no method defined in the underwriting_detail class to add this attribute. Is there any way to add this xsi:type="NonStdUWQuestion" in this tag?yes, is a question of JSF
Component dataTable -
Dynamic class loading issue with XmlBeans and Axis2
Hi,
Since support to web services is not enough in JDeveloper I am using apache axis2 to consume web services from an ADF web application.
Everything works fine if I use jdk 1.5 but our app servers require jdk 1.4.2_08-b03 so I switched jre settings to jdk 1.4.2_08-b03 in the JDeveloper and I started to get these issues.
I debugged the application and this line is the cause of the exception. It is in request document class.
return (org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument)org.apache.xmlbeans.XmlBeans.getContextTypeLoader().newInstance(type,
null);
I did some further testing and found that it is happening when I call org.apache.xmlbeans.XmlBeans.getContextTypeLoader()
The error messages that I am getting are
1. J*BO-29000: Unexpected exception caught: java.lang.IllegalAccessError, msg=tried to access field* org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument$1.class$org$htng$pws$_2008a$guestselfservice$name$types$FetchProfileRequestDocument from class org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument
2. tried to access field org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument$1.class$org$htng$pws$_2008a$guestselfservice$name$types$FetchProfileRequestDocument from class org.htng.pws._2008a.guestselfservice.name.types.FetchProfileRequestDocument
As I understand somehow the application server is not allowing the XMLBeans APIs to dynamically load the classes ..But I couldn’t find a way to convince it..
Does anybody have any idea by any chance?
Thanks a lotSome more details ..
I could make it work if I change the below getClassLoader with Thread.currentThread().getContextClassLoader()
org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(FetchProfileResponseDocument.class.getClassLoader()This is a generated code and normally works fine with jdk 1.5 .. I guess there should be some setting to make it work in 1.4 as well..
Any Idea ? -
Missing xsi:type, invalid xml generated, jaxb 1.6
Hi,
i've this XML Schema defined for my doc/lit web service:
<complexType name="CasDataType">
<sequence>
<element name="key" type="long" nillable="false minOccurs="1" maxOccurs="1"/>
</sequence>
</complexType>
<complexType name="AddressDataType">
<complexContent>
<extension base="tns:CasDataType">
<sequence>
<element name="FirstName" nillable="true" minOccurs="0" type="string"/>
<element name="LastName" nillable="true" minOccurs="0" type="string"/>
</sequence>
</extension>
</complexContent>
</complexType>If i create a AddressDataType and return it with my web service, the jaxb-marshaller generates this xml code:
<casDataTypes>
<key>123</key>
<FirstName>Ingo</FirstName>
<LastName>Siebert</LastName>
</casDataTypes>But correct would be this:
<casDataTypes xsi:type="AddressDataType" >
<key>123</key>
<FirstName>Ingo</FirstName>
<LastName>Siebert</LastName>
</casDataTypes>Is this error already known?
Is it fixed with jaxb 2.0?
I doesn't like annotations, is it possible with jaxb 2.0 (XJC task) to geneate files without annotations?
Cheers,
IngoNot got a single answer , surprise whether the question is too dumb to ask or JAXB doesn't support feature or my requirement is weird :-) ... in any case let me know please
regards
Maybe you are looking for
-
Virtualbox no longer works after kernel update solved
and before you say.. read the wiki, use google, check the forums.. I DID.. here's the message i got The VirtualBox Linux kernel driver (vboxdrv) is either not loaded or there is a permission problem with /dev/vboxdrv. Please reinstall the kernel modu
-
Can open cr2 files but no thumbnails in Bridge
I got no response in Bridge forum so I am trying here. I am trying to help a friend with Mac Snow Leopard OS but i am a Windows person so maybe I did something wrong. I downloaded and installed ACR 8.3. His 6D RAW files open fine in Photoshop CS6 but
-
Editing doesn't bring up PSE13 when requesting it through iPhoto
I have an iMac version 1010.1. I just installed PSE 13. I would like to store my photos in iPhoto but edit my photos with PSE 13. I set up a link, i.e. in preferences, I asked that when I hit "edit" at the bottom of the page in iPhoto, it would tak
-
I got Software update for iOS 6.1 .. After installation - Phone shows message to connect to iTune, I connect to iTune - I got message - iTune has detected iPhone in recovery mode. you must restore this iPhone before it can be used with iTune. I click
-
Does Elements 6 (Mac) support Raw?
I have just started shooting in Raw and very new to Raw and Elements. Thanks for your help...