This week's book giveaway is in the Reactive Progamming forum.
We're giving away four copies of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams and have Adam Davis on-line!
See this thread for details.
Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

unable to generate correct xml using jaxb

 
Ranch Hand
Posts: 124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi team,
I am using jaxB and jax-ws in my application.

I am calling service with request xml prepared by jaxb code.
but request xml is not generating correctly.

i have given xml schema as elementFormDefault="qualified" value.
so parent and all child elements needs to display xmlns.

like :name space "sch" is in parent and child elements




using jaxb request xml is generating with out name space "sch" in child elements




jaxb code is :





can any one please suggest me how can i generate request xml with parent and child having namespace using jaxb


Regards
Ramesh
 
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the schema also.

Although you may want to explore the concept of package-info.java related to JAXB.

Something like.

 
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh,

Very interesting discussion about it at XSD: What is elementFormDefault="qualified" for?.

Joe Kesselman said there -

"Qualified", in XML terms, means "Associated with a namespace, either by
the use of a declared prefix or via a default namespace declaration".



Regards,
Dan
 
Dan Drillich
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ramesh,

It would be an interesting exercise to post the schema and the instance into a validator and see what it says.

Regards,
Dan
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!