I'm creating a simple XElement and sending it over the wire to a WCF service.
<root>
<settings />
</root>
However, when it reaches the service operation it looks like this:
<root xmlns="">
<settings />
</root>
Is there any way to prevent this empty namespace from being added?
Related
Based on my understanding of the XMAP specification relative to DB.TOXML, the following XMAP represents a simple object model containing two child tables with the same parent table.
The command DB.TOXML CUST_ACT.XML XMAP_CustomerActivity.XML produces an XML file containing the records and fields from the parent table and one of the child tables as expected. However, the fields for each record of the other child table are repeated once within the record node. If I switch the child TableMaps, in the parent TABLECLASSMAP, the problem switches to the other child table.
It appears that when more than one (child) TableMap is specified in the parent map, fields from the table in the child map referenced by the first (child) TableMap entry are repeated TableMap times in record nodes of that table. This behavior was noticed during development of a process in a real-world UniVerse database environment with a more involved object model.
In order to confirm, I created simple CUSTOMER / CONTACT, CUSTOMER / ORDER files with a few test records for demonstration purposes. If this is a bug versus an XMAP configuration error on my part, then it appears either the XMAPCreate() API function or the XMAPAppendRec() API function may not correctly support this structure.
XMAP:
?xml version="1.0" encoding="UTF-8"?>
<!-- DOCTYPE U2XMAP SYSTEM "U2XMAP.DTD" -->
<U2XMAP version="1.0" Name="XMAP1" >
<!-- Table/Class map XCLASS_CLASS -->
<TABLECLASSMAP MapName="M1" StartNode="/Customers/Customer" TableName="CUSTOMERTBL">
<ColumnMap Node="CustKey" Column="CKEY"/>
<ColumnMap Node="Name" Column="CNAME" />
<TableMap Node="Orders/Order" MapName="M2" />
<TableMap Node="Contact/Methods" MapName="M3" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M2" StartNode="Orders/Order" TableName="ORDERTBL">
<ColumnMap Node="CustKey" Column="C.KEY" />
<ColumnMap Node="OrderKey" Column="#ID" />
<ColumnMap Node="OrderDate" Column="ORDERDATE" />
<ColumnMap Node="ProductId" Column="PRODUCTID" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M3" StartNode="Contact/Methods" TableName="CONTACTMETHTBL">
<ColumnMap Node="CustKey" Column="C.KEY" />
<ColumnMap Node="ContactKey" Column="#ID" />
<ColumnMap Node="Type" Column="TYPE" />
<ColumnMap Node="Address" Column="ADDRESS" />
</TABLECLASSMAP>
<RelatedTable>
<MapParentKey TableName="CUSTOMERTBL" Column="CKEY" KeyGenerate="No" />
<MapChildKey TableName="ORDERTBL" Column="CKEY" />
</RelatedTable>
<RelatedTable>
<MapParentKey TableName="CUSTOMERTBL" Column="CKEY" KeyGenerate="No" />
<MapChildKey TableName="CONTACTMETHTBL" Column="CKEY" />
</RelatedTable>
</U2XMAP>
RESULT:
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<Customers>
<Customer>
<CustKey>1</CustKey>
<Name>MOUSE, MICKEY</Name>
<Orders>
<Order>
<CustKey>1</CustKey>
<OrderKey>10</OrderKey>
<OrderDate>01-04-2022</OrderDate>
<ProductId>555R3232</ProductId>
<CustKey>1</CustKey>
<OrderKey>10</OrderKey>
<OrderDate>01-04-2022</OrderDate>
<ProductId>555R3232</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>1</OrderKey>
<OrderDate>12-27-2021</OrderDate>
<ProductId>5323423</ProductId>
<CustKey>1</CustKey>
<OrderKey>1</OrderKey>
<OrderDate>12-27-2021</OrderDate>
<ProductId>5323423</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>2</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>9299399</ProductId>
<CustKey>1</CustKey>
<OrderKey>2</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>9299399</ProductId>
</Order>
<Order>
<CustKey>1</CustKey>
<OrderKey>3</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>23492349</ProductId>
<CustKey>1</CustKey>
<OrderKey>3</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>23492349</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>1</CustKey>
<ContactKey>1</ContactKey>
<Type>HOMEPH</Type>
<Address>444-555-6666</Address>
</Methods>
<Methods>
<CustKey>1</CustKey>
<ContactKey>2</ContactKey>
<Type>HOMEST</Type>
<Address>580 LIBERTY CIR</Address>
</Methods>
</Contact>
</Customer>
<Customer>
<CustKey>2</CustKey>
<Name>FROG, KERMIT</Name>
<Orders>
<Order>
<CustKey>2</CustKey>
<OrderKey>4</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>99338822</ProductId>
<CustKey>2</CustKey>
<OrderKey>4</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>99338822</ProductId>
</Order>
<Order>
<CustKey>2</CustKey>
<OrderKey>5</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>23874771</ProductId>
<CustKey>2</CustKey>
<OrderKey>5</OrderKey>
<OrderDate>12-28-2021</OrderDate>
<ProductId>23874771</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>2</CustKey>
<ContactKey>3</ContactKey>
<Type>HOMEPH</Type>
<Address>777-888-9999</Address>
</Methods>
<Methods>
<CustKey>2</CustKey>
<ContactKey>4</ContactKey>
<Type>WORKPH</Type>
<Address>909-090-0909</Address>
</Methods>
</Contact>
</Customer>
<Customer>
<CustKey>3</CustKey>
<Name>BIRD, BIG</Name>
<Orders>
<Order>
<CustKey>3</CustKey>
<OrderKey>6</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>83776632</ProductId>
<CustKey>3</CustKey>
<OrderKey>6</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>83776632</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>7</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>R29898W9</ProductId>
<CustKey>3</CustKey>
<OrderKey>7</OrderKey>
<OrderDate>12-30-2021</OrderDate>
<ProductId>R29898W9</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>8</OrderKey>
<OrderDate>12-31-2021</OrderDate>
<ProductId>23884888</ProductId>
<CustKey>3</CustKey>
<OrderKey>8</OrderKey>
<OrderDate>12-31-2021</OrderDate>
<ProductId>23884888</ProductId>
</Order>
<Order>
<CustKey>3</CustKey>
<OrderKey>9</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>29993999</ProductId>
<CustKey>3</CustKey>
<OrderKey>9</OrderKey>
<OrderDate>12-29-2021</OrderDate>
<ProductId>29993999</ProductId>
</Order>
</Orders>
<Contact>
<Methods>
<CustKey>3</CustKey>
<ContactKey>5</ContactKey>
<Type>HOMEPH</Type>
<Address>405-040-5040</Address>
</Methods>
</Contact>
</Customer>
</Customers>
Any ideas? Thanks in advance. UniVerse 11.3.1 on AIX.
I also posted this question here but haven't gotten much exposure. (where you can better see highlighted in red the repeated entries).
Looks like it might be a bug to me. I tested it under Linux with 11.3.2 and I noticed the same behavior. It may be a system limitation, but if that were the case I would expect a failure on the mapping call as it seems to be pretty particular.
I would open a ticket with Rocket. I used the HS.SALES demo data that comes with UniVerse to replicate. I will provide it here for you to use in your report. It will be much easier for support to either confirm the bug or tell you what we are collectively doing wrong if they are already working with the same data.
<?xml version="1.0" encoding="UTF-8"?>
<!-- DOCTYPE U2XMAP SYSTEM "U2XMAP.DTD" -->
<U2XMAP version="1.0" Name="XMAP1" >
<!-- Table/Class map XCLASS_CLASS -->
<TABLECLASSMAP MapName="M1" StartNode="/Customers/Customer" TableName="CUSTOMER">
<ColumnMap Node="CustID" Column="#ID"/>
<ColumnMap Node="FirstName" Column="FNAME"/>
<ColumnMap Node="LastName" Column="LNAME" />
<ColumnMap Node="State" Column="STATE" />
<ColumnMap Node="ProductID" Column="PRODID" />
<TableMap Node="States/State" MapName="M2" />
<TableMap Node="Products/Product" MapName="M3" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M2" StartNode="States/State" TableName="STATES">
<ColumnMap Node="StateName" Column="NAME" />
</TABLECLASSMAP>
<TABLECLASSMAP MapName="M3" StartNode="Products/Product" TableName="PRODUCTS">
<ColumnMap Node="Price" Column="LIST" />
<ColumnMap Node="Description" Column="DESCRIPTION" />
</TABLECLASSMAP>
<RelatedTable>
<MapParentKey TableName="CUSTOMER" Column="PRODID" KeyGenerate="No" />
<MapChildKey TableName="PRODUCTS" Column="PRODID" />
</RelatedTable>
<RelatedTable>
<MapParentKey TableName="CUSTOMER" Column="STATE" KeyGenerate="No" />
<MapChildKey TableName="STATES" Column="CODE" />
</RelatedTable>
</U2XMAP>
In the mean time if you are blocked and the mapping isn't overly complex you can probably just add I-Descriptors and TRANS (or XLATE) over to the other file to include it in parent dictionary and thus not require any additional table mapping.
Good Luck,
Trying to follow https://www.hibernatingrhinos.com/products/nhprof/learn#Usage
I have the following log4net.config file:
<?xml version="1.0" encoding="utf-8" ?>
<log4net>
<appender name="NHProfAppender"
type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender,
HibernatingRhinos.Profiler.Appender.NHibernateLog4Net">
<sink value="tcp://127.0.0.1:22897" />
</appender>
<logger name="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender.Setup">
<appender-ref ref="NHProfAppender"/>
<skipCapturingStackTraces value="true"/>
</logger>
</log4net>
I get the following Error:
log4net:ERROR XmlHierarchyConfigurator: Cannot find Property [skipCapturingStackTraces] to set object on [log4net.Repository.Hierarchy.DefaultLoggerFactory+LoggerImpl]
Can Someone explain why this error is received and how to fix it ?
SkipCapturingStackTraces is a property of the NHProfAppender, similar as the Sink property, so you have to configure it on the <appender> element.
<appender name="NHProfAppender"
type="HibernatingRhinos.Profiler.Appender.NHibernate.NHProfAppender,
HibernatingRhinos.Profiler.Appender.NHibernateLog4Net">
<sink value="tcp://127.0.0.1:22897" />
<skipCapturingStackTraces value="true" />
</appender>
Suppose there is such a document:
<?xml version="1.0" encoding="utf-8" ?>
<root>
<paths>
<item>
<name>username</name>
<path>user/name</path>
</item>
<item>
<name>useremail</name>
<path>concat(user/name,': ',user/email)</path>
</item>
</paths>
<user>
<name>John</name>
<email>john#gmail.com</email>
</user>
</root>
the output required to obtain such a document:
<?xml version="1.0" encoding="utf-8"?>
<results>
<item name="username" value="John"/>
<item name="useremail" value="John: john#gmail.com"/>
</results>
The point is that the number of path elements can vary, and their values can refer to different elements of the source document (including using functions).
Is there a way to use the values of some elements as an expression of the search for other?
Here is the situation, I need to create a XML file every time a specific field from the table gets updated to "C" or "L". The Xml file needs to be like this:
<?xml version="1.0" standalone="yes"?>
<DATAPACKET Version="2.0">
<METADATA>
<FIELDS>
<FIELD attrname="ID_COMAND" fieldtype="string" WIDTH="20" />
<FIELD attrname="EVENT" fieldtype="string" WIDTH="1" />
</FIELDS>
<PARAMS />
</METADATA>
<ROWDATA>
<ROW RowState="4" ID_COMAND="3721" EVENT="C" />
</ROWDATA>
</DATAPACKET>
It's been very hard to find a way to do this, help me please.
I installed the latest WebSphere liberty profile to the Mac:
wlp-developers-runtime-8.5.next.beta.jar
WebSphere version is shown as 8.5.next.beta in Intellij.
In Intellij 12 I try to add this WebSphere Application Server and I get:
Cannot Save Settings: Application server libraries not found
If I look on the filesystem it seems that the location of:
com.ibm.ws.javaee.jsp.2.2_1.0.0.0.jar
com.ibm.ws.javaee.servlet.3.0_1.0.0.jar
has changes from /dev/spec to /dev/api/spec
I am not sure if this is the root cause, but Intellij seems to add these to the classpath in the previous version. Is there a way to get intellij up and running e.g. can I change the location where it looks for the libs?
Had the same issue. There are two ways.
Either unpack wlp 8.5 into the folder where you want to have wlp 8.5.next. Once unpacked, point IntelliJ to that folder and it will detect it. Once detected, just remove the wlp folder and unpack the 8.5.next in the same. Once done, correct the library paths.
Or; Open IntelliJ's other.xml-file (it's usually in ~/.IntelliJIDEA12/config/options/other.xml) and modify as following:
<?xml version="1.0" encoding="UTF-8"?>
<application>
<!-- other stuff -->
<component name="AppserversManager">
<LibraryTable>
<library name="WebSphere 8.5.Next.Beta">
<CLASSES>
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.annotation.1.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.cdi.1.0_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.ejb.3.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.el.2.2_1.0.1.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.interceptor.1.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jaxb.2.2_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jaxrs.1.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jaxws.2.2_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jms.1.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jsf.2.0_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jsf.tld.2.0_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jsp.2.2_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jsp.tld.2.2_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.jstl.1.2_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.persistence.2.0_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.servlet.3.0_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.transaction.1.1_1.0.0.jar!/" />
<root url="jar:///opt/wlp/dev/api/spec/com.ibm.ws.javaee.validation.1.0_1.0.0.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</LibraryTable>
<ServerDK NAME="WebSphere 8.5.Next.Beta">
<option name="SOURCE_INTEGRATION_NAME" value="WebSphere Server" />
<DATA>
<state>
<option name="home" value="/opt/wlp" />
<option name="version" value="8.5.next.beta" />
</state>
</DATA>
</ServerDK>
</component>
<!-- rest -->
</application>
This has now been officially fixed in Intelli 12.1.2 and newer. The release notes and original ticket have further details.