List Info

Thread: xmlbeans error




xmlbeans error
country flaguser name
United States
2007-08-24 16:26:47
Hello,
I am trying to create document object 
RequestDocument doc2 =
RequestDocument.Factory.parse("Input.xml");
from the following xml  schema:

<?xml version="1.0"
encoding="UTF-8"?>
<xs:schema targetNamespace="http://xmlb
eans.apache.org/myschema"
	xmlns:mc="http://xmlb
eans.apache.org/myschema"
	xmlnss=&qu
ot;http://www.w3.
org/2001/XMLSchema"
	elementFormDefault="qualified">
	
	<xs:element name="request"
type="mc:requestType">
	</xs:element>
	<xs:complexType name="requestType">
		<xs:sequence>
			<xs:element name="serviceName"
type="xs:string"/>
			<xs:element name="serviceMethod"
type="xs:string"/>
		</xs:sequence>
	</xs:complexType>
</xs:schema>

I see the following exception:
( here is Input.xml)
<xml-fragment><any:serviceName
xmlns:any="htt
p://xmlbeans.apache.org/samples/any">test_serviceNam
e</any:serviceName><any:serviceMethod
xmlns:any="http://xmlbeans.apache.org/samples/any">test_servic
eMethod</any:serviceMethod></xml-fragment>
!!!!
error: The document is not a requesthttp://www.nabble.com/xmlbeans-error-tf4325861.html
#a12320067
Sent from the Xml Beans - User mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
For additional commands, e-mail: user-helpxmlbeans.apache.org


Re: xmlbeans error
user name
2007-08-24 16:31:57
RequestDocument is the reference to the element and your
input.xml
should look like:
<any: request xmlns:any="http
://xmlbeans.apache.org/samples/any">
<any:serviceName
>test_serviceName</any:serviceName>
<any:serviceMethod>test_serviceMethod</any:serviceM
ethod>
</any:request>

I suspect you generated input.xml using RequestType.
Please let us know if you are still having trouble,
-Jacobd

On 8/24/07, smx_ <vlyamtsevmzeal.com> wrote:
>
> Hello,
> I am trying to create document object
> RequestDocument doc2 =
RequestDocument.Factory.parse("Input.xml");
> from the following xml  schema:
>
> <?xml version="1.0"
encoding="UTF-8"?>
> <xs:schema targetNamespace="http://xmlb
eans.apache.org/myschema"
>         xmlns:mc="http://xmlb
eans.apache.org/myschema"
>         xmlnss=&qu
ot;http://www.w3.
org/2001/XMLSchema"
>         elementFormDefault="qualified">
>
>         <xs:element name="request"
type="mc:requestType">
>         </xs:element>
>         <xs:complexType
name="requestType">
>                 <xs:sequence>
>                         <xs:element
name="serviceName"
type="xs:string"/>
>                         <xs:element
name="serviceMethod"
type="xs:string"/>
>                 </xs:sequence>
>         </xs:complexType>
> </xs:schema>
>
> I see the following exception:
> ( here is Input.xml)
> <xml-fragment><any:serviceName
> xmlns:any="htt
p://xmlbeans.apache.org/samples/any">test_serviceNam
e</any:serviceName><any:serviceMethod
> xmlns:any="http://xmlbeans.apache.org/samples/any">test_servic
eMethod</any:serviceMethod></xml-fragment>
> !!!!
> error: The document is not a requesthttp://www.nabble.com/xmlbeans-error-tf4325861.html
#a12320067
> Sent from the Xml Beans - User mailing list archive at
Nabble.com.
>
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
> For additional commands, e-mail: user-helpxmlbeans.apache.org
>
>

------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
For additional commands, e-mail: user-helpxmlbeans.apache.org


Re: xmlbeans error
country flaguser name
United States
2007-08-29 14:48:36
I managed to get marshalling/unmarshalling working following
one of the
samples but I really don't understand it.. I just declared
my element in the
schema like following:

<xs:element name="myrequest">
<xs:complexType>
<xs:choice maxOccurs="unbounded">
<xs:element name="request"
type="tns:requestType"/>
</xs:choice>
</xs:complexType>
</xs:element>

vs. just <xs:element name="request"
type="tns:requestType"/>

But I still have <xml-fragment> as root tag in the
resulting xml. E.g.
resulting xml looks as following:
<xml-fragment>
<any:serviceName
>test_serviceName</any:serviceName>
 <any:serviceMethod>test_serviceMethod</any:service
Method>
</xml-fragment>


Any ideas?

Thank you again.
smx


Jacob Danner-2 wrote:
> 
> RequestDocument is the reference to the element and
your input.xml
> should look like:
> <any: request xmlns:any="http
://xmlbeans.apache.org/samples/any">
> <any:serviceName
>test_serviceName</any:serviceName>
>
<any:serviceMethod>test_serviceMethod</any:serviceM
ethod>
> </any:request>
> 
> I suspect you generated input.xml using RequestType.
> Please let us know if you are still having trouble,
> -Jacobd
> 
> On 8/24/07, smx_ <vlyamtsevmzeal.com> wrote:
>>
>> Hello,
>> I am trying to create document object
>> RequestDocument doc2 =
RequestDocument.Factory.parse("Input.xml");
>> from the following xml  schema:
>>
>> <?xml version="1.0"
encoding="UTF-8"?>
>> <xs:schema targetNamespace="http://xmlb
eans.apache.org/myschema"
>>         xmlns:mc="http://xmlb
eans.apache.org/myschema"
>>         xmlnss=&qu
ot;http://www.w3.
org/2001/XMLSchema"
>>        
elementFormDefault="qualified">
>>
>>         <xs:element name="request"
type="mc:requestType">
>>         </xs:element>
>>         <xs:complexType
name="requestType">
>>                 <xs:sequence>
>>                         <xs:element
name="serviceName"
type="xs:string"/>
>>                         <xs:element
name="serviceMethod"
>> type="xs:string"/>
>>                 </xs:sequence>
>>         </xs:complexType>
>> </xs:schema>
>>
>> I see the following exception:
>> ( here is Input.xml)
>> <xml-fragment><any:serviceName
>> xmlns:any="htt
p://xmlbeans.apache.org/samples/any">test_serviceNam
e</any:serviceName><any:serviceMethod
>> xmlns:any="http://xmlbeans.apache.org/samples/any">test_servic
eMethod</any:serviceMethod></xml-fragment>
>> !!!!
>> error: The document is not a
>> requesthttp://www.nabble.com/xmlbeans-error-tf4325861.html
#a12320067
>> Sent from the Xml Beans - User mailing list archive
at Nabble.com.
>>
>>
>>
------------------------------------------------------------
---------
>> To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
>> For additional commands, e-mail: user-helpxmlbeans.apache.org
>>
>>
> 
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
> For additional commands, e-mail: user-helpxmlbeans.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/xmlbeans-error-tf4325861.html
#a12394494
Sent from the Xml Beans - User mailing list archive at
Nabble.com.


------------------------------------------------------------
---------
To unsubscribe, e-mail: user-unsubscribexmlbeans.apache.org
For additional commands, e-mail: user-helpxmlbeans.apache.org


[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )