You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Damian Carey <ja...@gmail.com> on 2010/03/01 03:47:35 UTC

Re: How to tailor our generated client XML

Amila,

Many thanks for your reply.

Unfortunately I was wasting your time by not understanding the
difference between Axis2/ADB and JAXB. My questions are related to
JAXB, not Axis2. So I offer my humblest apologies !!!

For the information of future "googlers" the I can answer ..
Turn "<XYZ_Quote>" into "<XYZ_Quote
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd">" by setting the
appropriate JAXB property as follows
"marshaller.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION,
"XYZ_Quote.xsd");"

I have not found out how to remove the <snip>standalone="yes"</snip> yet.
Many thanks,
-Damian


On Sun, Feb 28, 2010 at 1:27 AM, Amila Suriarachchi
<am...@gmail.com> wrote:
>
>
> On Fri, Feb 19, 2010 at 3:41 AM, Damian Carey <ja...@gmail.com> wrote:
>>
>> Hello,
>>
>> We have created client software using ADB and a WSDL & XSD files
>> supplied by a third party who controls the Web Service.  We have no
>> control over the Web Service at all, and we are not yet able to test
>> against it.
>>
>> We do have some sample XML as to what is expected. In checking our
>> generated XML against the samples we noticed differences in the first
>> two lines as follows.
>>
>> -------- OUR GENERATED first two lines  .......
>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>> <XYZ_Quote>
>
> you did you generate the xml?
>>
>> ------- 3rd PARTY EXAMPLES first two lines ........
>> <?xml version="1.0" encoding="UTF-8"?>
>> <XYZ_Quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd">
>
> with ADB there is no way to add this. but without this you should be able to
> invoke the service.
>
> thanks,
> Amila.
>
>>
>> Can anyone advise how to
>> (1) remove the "standalone="yes"" from our generated xml
>> (2) add the  "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd"" to our generated xml.
>>
>> Any pointers, advice, suggestions would be greatly appreciated.
>>
>> Many thanks,
>> -Damian
>
>
>
> --
> Amila Suriarachchi
> WSO2 Inc.
> blog: http://amilachinthaka.blogspot.com/
>

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@axis.apache.org
For additional commands, e-mail: java-user-help@axis.apache.org


Re: How to tailor our generated client XML

Posted by da...@davidkarlsen.com.
On Mon, 1 Mar 2010, Damian Carey wrote:

> Amila,
>
> Many thanks for your reply.
>
> Unfortunately I was wasting your time by not understanding the
> difference between Axis2/ADB and JAXB. My questions are related to
> JAXB, not Axis2. So I offer my humblest apologies !!!
>
> For the information of future "googlers" the I can answer ..
> Turn "<XYZ_Quote>" into "<XYZ_Quote
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd">" by setting the
> appropriate JAXB property as follows
> "marshaller.setProperty(Marshaller.JAXB_NO_NAMESPACE_SCHEMA_LOCATION,
> "XYZ_Quote.xsd");"
>
> I have not found out how to remove the <snip>standalone="yes"</snip> yet.
> Many thanks,
> -Damian
>
>
> On Sun, Feb 28, 2010 at 1:27 AM, Amila Suriarachchi
> <am...@gmail.com> wrote:
>>
>>
>> On Fri, Feb 19, 2010 at 3:41 AM, Damian Carey <ja...@gmail.com> wrote:
>>>
>>> Hello,
>>>
>>> We have created client software using ADB and a WSDL & XSD files
>>> supplied by a third party who controls the Web Service.  We have no
>>> control over the Web Service at all, and we are not yet able to test
>>> against it.
>>>
>>> We do have some sample XML as to what is expected. In checking our
>>> generated XML against the samples we noticed differences in the first
>>> two lines as follows.
>>>
>>> -------- OUR GENERATED first two lines  .......
>>> <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
>>> <XYZ_Quote>
>>
>> you did you generate the xml?
>>>
>>> ------- 3rd PARTY EXAMPLES first two lines ........
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <XYZ_Quote xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd">
>>
>> with ADB there is no way to add this. but without this you should be able to
>> invoke the service.
>>
>> thanks,
>> Amila.
>>
>>>
>>> Can anyone advise how to
>>> (1) remove the "standalone="yes"" from our generated xml
>>> (2) add the  "xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>> xsi:noNamespaceSchemaLocation="XYZ_Quote.xsd"" to our generated xml.
>>>
>>> Any pointers, advice, suggestions would be greatly appreciated.

Set the jaxb fragment option to true:
http://java.sun.com/javase/6/docs/api/javax/xml/bind/Marshaller.html


--
David J. M. Karlsen - +47 90 68 22 43
http://www.davidkarlsen.com
http://mp3.davidkarlsen.com
Sent from my bog-standard SMTP client