• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

XML in Webservices

 
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have to write a webservice method which will make a DB call and spit out the XML data from the DB. What is the data type I need to define in WSDL? is there anything equivalent of CDATA in xsd?
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Try xsd:anyType.
Best wishes!
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Thanks for the reply...but do you think it can handle XML tags in the data?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check this: http://www.w3.org/TR/xmlschema-0/#anyType
I just tested and created an XML schema with one element having content of the xsd:anyType.
Then I created an instance of the schema and pasted another XML document into the above mentioned element.
It passed validation with the note that it were not able to find the schema for the data in the anyType element.
It would not, however, accept the XML header: <?xml version="1.0" encoding="UTF-8"?>
Best wishes!
 
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So, what you are saying is anyType element is not parsable by the parser.

If there is no contract between the sender and the receiver and you don't want to use anyType as it is not supported by some BPEL as well, then how will you do this ?

Thanks,
Rahul
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

So, what you are saying is anyType element is not parsable by the parser.


No. I was testing in an XML editor and did not bother with the XML schema for the XML fragment I pasted in.

If there is no contract between the sender and the receiver and you don't want to use anyType as it is not supported by some BPEL as well, then how will you do this ?


How about sending the XML fragment as a string?
Best wishes!
 
The only cure for that is hours of television radiation. And this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic