Re: Convert String data from Web Service to XML



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 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.
Thanks for the reply,

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.

.



Relevant Pages

  • Re: Convert String data from Web Service to XML
    ... if you only need to assign the VertexResponse string to a node of ... I am trying to Convert String data from Web Service to XML ... again to xmldocument by using loadxml and assign to xmldocument ...
    (microsoft.public.biztalk.general)
  • Re: Convert String data from Web Service to XML
    ... XmlDocument temp2 = ... why not use temp instead of temp2, ... I am trying to Convert String data from Web Service to XML ...
    (microsoft.public.biztalk.general)
  • Re: Convert String data from Web Service to XML
    ... Are you using Xlang or external .net assembly to load xml? ... XmlDocument temp2 = ... why not use temp instead of temp2, ... I am trying to Convert String data from Web Service to XML ...
    (microsoft.public.biztalk.general)
  • Re: Convert String data from Web Service to XML
    ... why not use temp instead of temp2, ... I am trying to Convert String data from Web Service to XML ... xmldocument & outerxml ...
    (microsoft.public.biztalk.general)
  • RE: FileSearch to locate the latest (last saved) file
    ... Dim sReport As Workbook, sDashboard As Workbook ... Dim fLdr As String, Fil As String, FPath As String, x As String, _ ... FileDates= temp ... For i = 1 To NewestFile ...
    (microsoft.public.excel.programming)

Loading