Re: [jibx-users] Wrapping XML with a different element
value style="attribute" name="href" field="href"/ /structure structure name="tradeId" value-style="attribute" value style="attribute" name="tradeId" field="tradeIdScheme"/ value style="text" field="tradeId"/ /structure /structure !-- end of partyTradeIdentifier -- structure name="tradeDate" value-style="attribute" value name="id" style="attribute" field="tradeDateId"/ value style="text" field="tradeDate"/ /structure /structure !-- tradeHeader structure ends here -- structure field="equityContract"/ /structure /mapping !-- Have removed a block from here -- /binding The output xml file achieved with the above bindings ?xml version="1.0" encoding="UTF-8"? FpML xmlns="http://www.fpml.org/2005/FpML-4-2" xmlns:ibml="http://ibml/2005" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ibml/2005 ../../xsd/IBML-1-2-2.xsd" xsi:type="ibml:CreateTradeRequest" version="4-2" ibmlVersion="1-1" header conversationId conversationIdScheme="http://www.jpmorgan.com/coding-scheme/conversationId"EquityShare987/conversationId messageId messageIdScheme="http://www.jpmorgan.com/coding-scheme/messageId"EquityShare456a789b/messageId sentBy partyIdScheme="http://www.jpmorgan.com/coding-scheme/partyId"msdw/sentBy creationTimestamp2000-08-01T08:57:00-00:00/creationTimestamp /header trade tradeHeader partyTradeIdentifier partyReference href=""/ tradeId tradeIdScheme="http://www.PartyA.com/coding-scheme/tradeId"1234/tradeId /partyTradeIdentifier tradeDate id="TradeDate"2005-07-13/tradeDate /tradeHeader ibml:equityContract productType productTypeScheme="http://ibml.jpmorgan.com/coding-scheme/product-type"Equity/productType buyerPartyReference href=""/ sellerPartyReference href=""/ ibml:numberOfUnits1/ibml:numberOfUnits ibml:unitPrice currencyUSD/currency amount78.20/amount /ibml:unitPrice ibml:settlementDate relativeDate periodMultiplier3/periodMultiplier periodD/period dayTypeBusiness/dayType businessDayConventionNONE/businessDayConvention businessCenters businessCenterEUTA/businessCenter /businessCenters dateRelativeTo href=""/ /relativeDate /ibml:settlementDate ibml:settlementCurrencyUSD/ibml:settlementCurrency ibml:equity instrumentId instrumentIdScheme="http://www.reuters.com/coding-scheme/instrumentid"STM-FP/instrumentId descriptionSTMicroelectronics N.V. ordinary shares/description exchangeId exchangeIdScheme="http://www.fpml.org/schemes/4.1/exchangeId"NSE/exchangeId /ibml:equity /ibml:equityContract /trade ibml:party id="PartyA" partyIdParty A/partyId /ibml:party ibml:party id="PartyB" partyIdParty B/partyId /ibml:party /FpML ---
[jibx-users] Wrapping XML with a different element
Sorry if this got posted twice, the first one bounced back to me. Anyone know how to do this? I want to wrap the output XML in another element that doesn't map to any class. My mapping looks like this: binding forwards=false value-style=attribute mapping class=com.abc.Shipment name=shipment value .../ ... /mapping But I want to do something like binding forwards=false value-style=attribute mapping name=form value style=attribute name=id constant=shipmentFormId123/ /mapping mapping class=com.abc.Shipment name=shipment value ... / ... /mapping So the output XML goes from this: shipment ... /shipment to this: form id=shipmentFormId123 shipment ... /shipment /form Any thoughts on how I would do this? Thanks! Morgan -- View this message in context: http://www.nabble.com/Wrapping-XML-with-a-different-element-tf2274427.html#a6315703 Sent from the jibx-users forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users
Re: [jibx-users] collection Set JDK 1.4.2
Dennis Sosnoski dms at sosnoski.com writes: Hi Sandeep, Is the exception occurring during marshalling or unmarshalling? Also, I don't understand how you can get a ClassCastException with no further stack trace information - can you show exactly what you're getting? Thanks, - Dennis Sandeep Khanna wrote: Hi All, Jibx binding compiler compiles fine with the following binding class declaration: mapping name=AsClient class=com.adminserver.dcl.ClientDcl ordered=false collection field=roles type=java.util.HashSet item-type=com.adminserver.dcl.RoleDcl name=PolicyRoles usage=optional/ /mapping mapping name=AsRole class=com.adminserver.dcl.RoleDcl ordered=false value get-method=getRoleGuid set-method=setRoleGuid name=RoleGUID style=element usage=optional/ /mapping public class ClientDcl { ... private java.util.Set roles; ... } I am getting a java.lang.ClassCastException without any more stack trace information from Jibx. Would I need to use the 'factory' attribute instead of the 'type' attribute? Something on the lines of org.jibx.runtime.Utility.arrayListFactory? Any idea what's going on here? --Sandeep Khanna --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click ___ jibx-users mailing list jibx-users at lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users --- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637alloc_id=16865op=click Hi Dennis, I know this topic has been idle for a while, but I am seeing the same thing when I marshal a hibernate object. My FlockTest object marshalled just fine the first time, without any collection bindings. Then I added the collection and got a ClassCastException with no detailMessage, stackTrace, or any other information. My binding has this: binding forwards=false value-style=attribute mapping class=FlockTest name=flock-test value style=element name=flock-test-id field=flockTestId usage=optional/ [] collection field=flockTestDetails item-type=FlockTestDetail type=java.util.HashSet usage=optional/ /mapping mapping class=FlockTestDetail name=flock-test-detail [...] /mapping /binding My FlockTest class looks like this: public class FlockTest implements java.io.Serializable { [...] private Set flockTestDetails = new HashSet(0); public Set getFlockTestDetails() { return this.flockTestDetails; } public void setFlockTestDetails(Set flockTestDetails) { this.flockTestDetails = flockTestDetails; } } The marshalling code looks like this: public void saveFlockTest(FlockTest ft) throws DataAccessException { try{ IBindingFactory bfact = BindingDirectory.getFactory(FlockTest.class); IMarshallingContext mctx = bfact.createMarshallingContext(); mctx.setIndent(4); ByteArrayOutputStream baos = new ByteArrayOutputStream(); mctx.marshalDocument(ft, UTF-8, null, baos); log.debug(baos.toString()); }catch(JiBXException je){ ; }catch(Exception e){ log.debug(e.getStackTrace()); } } I even rebuilt the latest code (1.0 RC1?) with debug symbols and stepped through the marshalling code. It all works until it gets to the JiBX-generated FlockTest marshal code, which I cannot step through. In the marshal() call, it steps into MarshallingContext.getMarshaller(). That seems to return a marshaller correctly because the debugger opens the FlockTest source file and indicates that it's calling FlockTest.marshal(IMarshallingContext), as expected. I step/execute three times (helpful?) in the marshal call and then get a CCE. I'm just getting into JiBX and very happy that my first test succeeded, but that was a simple test. My objects may have many levels of children and grandchildren, all implemented as java.util.Set. Any pointers would be helpful. Thanks! - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
Re: [jibx-users] jibx 1.1 not on maven repository
I'm using Maven2 and just added the jibx maven repository to my pom.xml. This way, all developers in my project are automatically connected to the jibx repo without any intervention. Check out http://jibx.sourceforge.net/maven-jibx-plugin/usage.html. Rice Yeh wrote: Hi, Jibx 1.1 has been released for a while. But I find it is still NOT on the repositories of maven like http://www.ibiblio.org/maven2/. What I find there is the version 1.0.1. How do not know the procedure to put jar there. Can anyone do this? Regards, Rice - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users -- View this message in context: http://www.nabble.com/jibx-1.1-not-on-maven-repository-tf2119625.html#a5876960 Sent from the jibx-users forum at Nabble.com. - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnkkid=120709bid=263057dat=121642 ___ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users
[jibx-users] Wiki and 2.0
Does anyone have an update on the status of the wiki and version 2.0?