Hi Edward,

    My schema having this information

  <xs:schema xmlns="http://service.wellsfargo.com/provider/emf/";
xmlns:base="http://service.wellsfargo.com/base/2003/";
xmlns:xs="http://www.w3.org/2001/XMLSchema";
xmlns:cust="http://eai-schemas.wellsfargo.com/entity/customer/";
xmlns:bus="http://eai-schemas.wellsfargo.com/business/";
xmlns:mismo="CreditReporting1_0_1/"
targetNamespace="http://service.wellsfargo.com/provider/emf/";
elementFormDefault="unqualified" attributeFormDefault="unqualified"
version="2.0"> 

And I tried by adding the attribute to root element it works fine with
parsing ,but 
 the method returns null (getService())

 File xmlFile = new File("c:/ramesh/ResponseSample.xml");
                 
                WFHMEnvelopeDocument document =
WFHMEnvelopeDocument.Factory.parse(xmlFile);
            
            WFHMEnvelopeType envelope = document.getWFHMEnvelope();
                //System.out.println(envelope.xgetService());

             System.out.println(envelope.getService());


Thanks
Ramesh.

-----Original Message-----
From: Edward Frederick [mailto:[EMAIL PROTECTED] 
Sent: Thursday, February 02, 2006 2:23 PM
To: dev@xmlbeans.apache.org
Subject: Re: Hi Issue with Parsing....

Hi Ramesh,

Although I don't have a copy of your schema, it appears you're namespace
qualified.

Depending on if you have elementFormDefault="unqualified" (the
default) or "qualified", you may also have to qualify the elements
within your document element.

In short, one these should work:


<WFHMEnvelope xmlns="http://service.wellsfargo.com/provider/emf/";>
<eMFContext>
<sessionid>9bd99e77-8ddd-11da-9be1-b7656329eea5</sessionid>
... etc..
 </WFHMEnvelope>


or

<WFHMEnvelope xmlns="http://service.wellsfargo.com/provider/emf/";>
<eMFContext  xmlns="http://service.wellsfargo.com/provider/emf/";>
<sessionid
xmlns="http://service.wellsfargo.com/provider/emf/";>9bd99e77-8ddd-11da-9
be1-b7656329eea5</sessionid>
... etc..
 </WFHMEnvelope>

Let me know how it goes!

Ed


On 2/2/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> Hi Edward,
>
>   This is the string I am parsing...I am trying to print the service 
> element value...
>
> <WFHMEnvelope>
> <eMFContext>
> <sessionid>9bd99e77-8ddd-11da-9be1-b7656329eea5</sessionid>
> <requestId>0</requestId>
> <requestSequenceId>0</requestSequenceId>
> <creationTimeStamp>2006-01-25T12:03:18.774-08:00</creationTimeStamp>
> <hostName>mdid3114</hostName>
> <originatorId>Middleware</originatorId>
> </eMFContext>
> <service>OCP</service>
> <function>getCreditProduct</function>
> <modality>SYNC</modality>
> <contextType>ServiceRequest</contextType>
> </WFHMEnvelope>
>
> Thanks
> Ramesh.
>
> -----Original Message-----
> From: Edward Frederick [mailto:[EMAIL PROTECTED]
> Sent: Thursday, February 02, 2006 2:09 PM
> To: dev@xmlbeans.apache.org
> Subject: Re: Hi Issue with Parsing....
>
> Can you provide the XML String? I think there are a couple 
> possibilities.
>
> On 2/2/06, [EMAIL PROTECTED] 
> <[EMAIL PROTECTED]> wrote:
> >
> >
> > Hi
> >
> >   I am new to XmlBeans I got this exception while parsing the xml
> String.
> >
> > org.apache.xmlbeans.XmlException:
> > c:\ramesh\ResponseSample.xml:0: error: The document is not a
> > [EMAIL PROTECTED]://service.wellsfargo.com/provider/emf/:
> > document element namespace mismatch expected 
> > "http://service.wellsfargo.com/provider/emf/"; got ""
> >
> >         at
> >
org.apache.xmlbeans.impl.store.Root.verifyDocumentType(Root.java:510)
> >         at
> > org.apache.xmlbeans.impl.store.Root.autoTypedDocument(Root.java:426)
> >         at
> > org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1049)
> >         at
> > org.apache.xmlbeans.impl.store.Root.loadXml(Root.java:1033)
> >         at
> >
> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeL
> oa
> derBase.java:333)
> >         at
> >
> org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeL
> oa
> derBase.java:244)
> >         at
> > com.wellsfargo.service.provider.emf.WFHMEnvelopeDocument$Factory.par
> > se
> > (Unknown
> > Source)
> >         at
> > com.wellsfargo.ilonline.shared.service.credit.Test.main(Test.java:35
> > )
> > Exception in thread "main"
> >
> > Thanks
> > Ramesh.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to