Edward Frederick <epfrederick <at> gmail.com> writes:
>
> You're close--I think there's two pieces to the problem.
>
> On your dump of the soap header, the <cur> is the soap:Header and not
> your header <at> tmf854.v1. So I think the steps to get it working are:
>
> 1) get a hold of the header <at> tmf854.v1 node (does dumping
> getFirstChild() give you this as <cur>?)
>
> 2) parse it with the HeaderT document factory.
>
> HeaderTDocument encl = HeaderTDocument.Factory.parse(yourHeaderDomNode);
> HeaderT hdr = encl.getHeaderT();
>
> Good Luck,
>
> Ed
>
Ed,
First, what is it with this error of top-posting? I have never such stupid
thing!
Now the dump was with the original:
HeaderT hdrT = HeaderT.Factory.parse(soapHdr.getDomNode());
If I do down one level by adding .getFirstChild() I get an empty dump as
followed:
ROOT Value( "\n\t\t" ) (USER) *:R:<cur>[0] (DocumentXobj)
And if I do as you mention below
File msgFile = new File(reqMsgDocFilename);
EnvelopeDocument soapEnvDoc = EnvelopeDocument.Factory.parse(msgFile);
Envelope soapEnv = soapEnvDoc.getEnvelope();
Header soapHdr = soapEnv.getHeader();
HeaderT hdrT = HeaderT.Factory.parse(soapHdr.getDomNode().getFirstChild());
HeaderDocument hdrDoc = HeaderDocument.Factory.parse(soapHdr.getDomNode
().getFirstChild());
HeaderT hdr = hdrDoc.getHeader();
System.out.println("\nRequest header fragment as Xbean toStr:\n"+hdrDoc.toString
());
System.out.println("hdrT.activity="+hdr.getActivityName());
soapHdr.dump();
hdr.dump();
I get an exception:
org.apache.xmlbeans.XmlException: error: The document is not a
[EMAIL PROTECTED]: no document element
at org.apache.xmlbeans.impl.store.Locale.verifyDocumentType
(Locale.java:452)
at org.apache.xmlbeans.impl.store.Locale.autoTypeDocument
(Locale.java:357)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject
(Locale.java:1384)
at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject
(Locale.java:1363)
at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse
(SchemaTypeLoaderBase.java:370)
at org.tmforum.mtosi.HeaderDocument$Factory.parse(Unknown Source)
at Main.testXMLBeans(Main.java:65)
at Main.main(Main.java:32)
Thanks,
Jerome
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]