Re: Convert String data from Web Service to XML
- From: linda <linda@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Feb 2008 11:26:06 -0800
I am a little confused.
If you need assign this VertexResponse to a message(e.g Msg_1 which
associated with a schema), you can just assign temp to this message in a
message consturct shape.
XmlDocument xmlDoc=VertexResponse(VertexResponse);
Msg_1=xmlDoc;
Then later you can use the Msg_1 in a map.
Otherwise, if you only need to assign the VertexResponse string to a node of
a message, why would you bother to load VertexResponse into a xml document?
Linda
"Avinash" wrote:
On Feb 13, 4:20 pm, linda <li...@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:.
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:
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 aThanks for the reply,
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;
}- Hide quoted text -
- Show quoted text -
You are right, but i need to Assign this OuterXml which is a string
type to a Schema in my project so that i can do some mapping.
- 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
- Re: Convert String data from Web Service to XML
- From: linda
- Re: Convert String data from Web Service to XML
- From: Avinash
- Convert String data from Web Service to XML
- Prev by Date: RE: Biztalk Project not available in Visual Studio 2005
- Next by Date: exit VS to build custom pipeline component
- 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