• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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!
 
Wanna see my flashlight? How about this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic