• Post Reply Bookmark Topic Watch Topic
  • New Topic

XML in Webservices  RSS feed

 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • 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?
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Try xsd:anyType.
Best wishes!
 
Mary Cole
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
Rahul Juneja
Ranch Hand
Posts: 425
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!