Re: Convert String data from Web Service to XML
- From: linda <linda@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 13 Feb 2008 13:20:01 -0800
Hi Avinash,
why not return temp directly? the way i see would work is:
public XmlDocument VertexResponse(string VertexResponse)
{
XmlDocument temp= new XmlDocument();
temp.LoadXml(VertexResponse);
return temp;
}
"Avinash" wrote:
On Feb 12, 6:48 pm, Mark <mcole...@xxxxxxxxxxx> wrote:.
On 12 Feb, 16:05, Avinash <avinashd...@xxxxxxxxx> wrote:Thanks for the reply,
Hi
I am trying to Convert String data from Web Service to XML
My String data looks like
<String>My XML is inside this string tag </String>
I want to extract the XML inside the string tag in Orchestration, How
do i do it ??
Any help is appreciated.
Thanks-
Avinash
You could load it into a DOM using System.Xml.XmlDocument. If it is a
small piece of XML this shouldn't be too much of an overhead. If it's
a large amount of data this is not recommended as it will consume lots
of memory. Another option is to use an XmlTextReader (also in the
System.Xml namespace) to parse the document and use the
ReadElementContentAsString method to retrieve the value. Another quick
and dirty method is string parsing.
I tried using this method below and return an Xml document type back
to Orchestration, when i go thru the Orchestration Debugger it stops
at where it actually calls this method and gives me an error saying
Inner exception: Invalid cast from 'System.String' to
'System.Xml.XmlDocument'.
I double checked my variables and messages every thing is assigned
right and builds the project, but in run time in throws the above
error.
public XmlDocument VertexResponse(string VertexResponse)
{
XmlDocument temp= new XmlDocument();
string temp1;
temp.LoadXml(VertexResponse);
temp1= temp.DocumentElement.OuterXml;
XmlDocument temp2 = (XmlDocument)Convert.ChangeType(temp1,
typeof(XmlDocument));
return temp2;
}
- Follow-Ups:
- Re: Convert String data from Web Service to XML
- From: Avinash
- Re: Convert String data from Web Service to XML
- References:
- Convert String data from Web Service to XML
- From: Avinash
- Re: Convert String data from Web Service to XML
- From: Mark
- Re: Convert String data from Web Service to XML
- From: Avinash
- Convert String data from Web Service to XML
- Prev by Date: RE: How to set icon for custom pipeline component using VB
- Next by Date: RE: EDI Biztalk Issue - Unparsed Interchange
- Previous by thread: Re: Convert String data from Web Service to XML
- Next by thread: Re: Convert String data from Web Service to XML
- Index(es):
Relevant Pages
|
Loading