Passing an XML string as part of an XML Web Service

Hi there I am not too sure how to explain this but here goes.....

I have a Web Service and I need to pass an XML page in the form of a string to a web service. My web service takes in 5 fields and one of those 5 fields is a string which is an xml page in the form of a string. I need to pass that string onto a COM object.

Is it possible to pass XML in the form of a string to a web service or will that cause the web service to error?

The web service is normally called from a PL/SQL stored procedure. If thats of any use.
 

0
amardilo
1/17/2007 10:36:16 AM
asp.net.xml-web-services 7071 articles. 0 followers. Follow

5 Replies
1981 Views

Similar Articles

[PageSpeed] 14

Hi You can pass that XML string to the web method as a parameter.See the below link that could be help you out:

http://www.thescripts.com/forum/thread376476.html


Cheers
Ram MCP
0
ramana123
1/18/2007 7:34:02 AM

Thanks for that.

 By the sounds of it I can just do the following (or would this crash):

 

POST /MyWebService/MyWebService.asmx HTTP/1.1
Host: MyHost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/MyMethod"


<soap:Envelope......> 
  <soap:Body>
    <param1>123456789</param1>
    <xml_string> 
                  xml_string>
  </soap:Body>
</soap:Envelope>
 
 
0
amardilo
1/31/2007 3:40:45 PM

Thanks for that.

 By the sounds of it I can just do the following (or would this crash):

POST /MyWebService/MyWebService.asmx HTTP/1.1
Host: MyHost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/MyMethod"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope......>
    <soap:Body>
            <param1>123456789</param1>
        <xml_string>
                 <?xml version="1.0" encoding="utf-8"?><xml_Doc><doc_part1>abc</doc_part1></xml_Doc>
        </xml_string>
    </soap:Body>
</soap:Envelope>

 

 

I am  a little concerned that the web service doc might crash due to the string inside the xml_string tag.

0
amardilo
1/31/2007 3:46:33 PM

Hi

You can put Xml String in CDATA section to prevent crash:

<soap:Envelope>
	<soap:Body>
		<param1>123456789</param1>
		<xml_string>![CDATA[<?xml version="1.0" encoding="utf-8"?><xml_Doc><doc_part1>abc</doc_part1></xml_Doc>]]></xml_string>
	</soap:Body>
</soap:Envelope>
 Hope this helps.
NOTE:If you find my response contains a reference to a third party World Wide Web site, I am providing this information as a convenience to you.Microsoft does not control these sites and has not tested any software or information found on these sites; therefore,Microsoft cannot make any representations regarding the quality,safety, or suitability of any software or information found there.
__________________________________________________

Sincerely,
Young Fang
Microsoft Online Community Support

Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
0
Young
2/3/2007 12:03:35 PM
Sorry for the late reply but the CDATA section looks like what I was after, thank you very much!
0
amardilo
3/22/2007 9:27:07 AM
Reply:

Similar Artilces:

xml web service --uploading the file to the xml web service
how can we upload the file in the xml web service 1.i mean what will be the return value in the proxy class 2.and how am i going to send the file to the xml web service----regards Bipul Kumar Here are some links to articles that helped us get this done: http://msdn.microsoft.com/webservices http://www.microsoft.com/downloads/details.aspx?familyid=06255a94-2635-4d29-a90c-28b282993a41&displaylang=en https://www.sys-con.com/dotnet/article.cfm?id=458 Hope this helps....

XML vs XML Web Services
I'm getting up to speed with XML and have the following questions: 1) Knowing XML means knowing how to design and create XML Web Services? 2) I found the amount of details on XML/XML Web services overwhelming, harder to digest than HTML or a new language. What's the best approach to learn and use it? Thanks.Please mark the post(s) that have helped you as "Answer" 1. No. They are different things 2. I'd start with a basic XML foundation (basic XML, XPath, and XSD), then review the basic WS things: soap, WSDL, and then from there on move to the WS-specs.Tomas Restrepo ...

creating XML or XML Web Services?
Hi, I know XML is basically creating a file that allowed multiple applications to get data from the XML file ... and I am wondering .. why there is XML Web Services? What are the differences between these two? I am trying to create a Session that will keep update the value whenever it navigate to any page ... and get the Session value in multiple applications. In my guess, stores Session[] in XML file should work for what I am trying to do ... but what exactly is this XML Web Services? In what kind of situation we use XML or vice versa? All developers, even novices and hobbyists, must be a...

xml stream from client to xml web service
I'm trying to send a serialized object based of an xsd to an xml web service by an xml stream. I've serialized it into a MemoryStream and trying to sent it to the service that I've made. The service should except this xml stream and create a serialized class of his own.   Giving the fact that I need to pass the Object as an xml stream, is it a good choisse to take a MemoryStream class for me? Trying to pass the MemoryStream instance made at the client side I get a compilation error as the instance made at the client side is recognized as a System.Io.MemoryStream while the argum...

create valid xml to send to web service based on the schema provided by web service
Problem: I have a web page which is being populated from a dataset containing multiple tables.  I now need to call a web service and send the majority of this data to be incorporate into a mainframe system.  I have been supplied with the schema that the web service will be using to validate the data.  I am new to web services and I am not sure how to take my existing dataset and transform it into an xml document that matches the schema I was provided with. There is a main schema with an element which is a custom complex type.  This custom type consists of an element whi...

passing xml string into web service and getting response
Hi,I have to write a web service that handles an xml string e.g. <email>Joe.Bloggs@test.com</email><Firstname>Joe</Firstname>The web service needs to accept this string then strip out the values and insert into database and return an xml string with the element <complete>Y</complete>struggling with how to do this, any help would be great. First of all, that is not well-formed XML. It has more than one root element. Do you know how the callers will be creating this data? Do they not have the email and firstname separately?John Saunders | MVP – Connected ...

how to pass a xml text string as parameter to a web service?
I defined the the web service as the following: [WebMethod] public string SaveQuestion(string qusxml) { ... return "OK"; } the parameter 'qusxml' is a xml text string. But in the client, I try to pass a xml string to it, it return a error like this, System.Web.Services.Protocols.SoapException: Server was unable to read request. ---> System.InvalidOperationException: There is an error in XML document (5, 28). ---> System.Xml.XmlException: 'Text' is an invalid node type. Line 5, position 28. at System.Xml.XmlReader.ReadElementString() ...

XML Web service , Web form
hi i hope if u could help me in what i am making so i have a web form that does the collection of the information from the user when he hits the button this data must be sent to the xml web service but this service must deliver this data in xml then i read the information and insert it to the sql serevr Database could you help me becouse iam soo confused about where to start and what is the stuff to search in it iam new in the xml stuff help me pleaseeeeee“To be incredible you must produce great work”Visit My Bloghttp://www.dotnetjunkies.com/WebLog/hussein My first question is why are yo...

SQLDataAdapter writes different XML than the XML Web Service returns
I have an XML Web Service written in VB.Net 2.0  I use a SQL data adapter to return read only data from a database. If I use the writexml method of the data adapter it writes an xml file to disk which seems to be formatted perfectly. When I return the XML data from the service with (dataadapter.writexml(dataset)) it appends the anytype element, which is giving me trouble transforming with XSL. Is there a way to return the XML looking the same as what gets written to a file? Or am I not understanding what the anytype node is for or how to deal with it? Thank you for any help Writt...

Passing XML to web service
Hello, I am trying to make use of an SMS web service, where you pass the SMS message and details to a page in XML format. I am very new to the whole XML thing, how exactly do you pass the XML information to the website. The address that I need to pass the info to is: http://api.clickatell.com/xml/xml?data I have the information that I need to post, I just need to know how I post it using VB.net. I am sure that this is probably quite easy to do. I can get the web service to work when I pass the variables directly using a response.redirect like this: response.redirect(&qu...

PASSING XML TO WEB SERVICE
Hey guys, I'm trying to pass a xml document from javascript to a web service. The document seems to be ok, but when I post it, using xmlhttp, I got this error: System.IndexOutOfRangeException: Index was outside the bounds of the array. at System.Web.Services.Protocols.HttpServerType..ctor(Type type) at System.Web.Services.Protocols.HttpServerProtocol.Initialize() at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response) at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, ...

Problem when calling web service and passing xml-like string as parameter
Hi,In asp.net application I'm consuming web services developed on another platform. I can communicate nicely with methods that require simple string as parameter. However there is one method that requires that I pass string which have xml tags, elements, attributes etc.I'm using something like this:        StringBuilder sb = new StringBuilder();        using (XmlWriter writer= XmlWriter.Create(sb))        {            // create some xml &nb...

How to send an XML file to a Web Service (that records the XML file to HD)
I did this because I wanted to send an XML file to another computer, whether it be next to the one I’m using  or in another country. You will need to adapt my example in order for it to work as you want it. All I demonstrate here is that it is possible to send an XML file to another computer using XML Web Services. Let me know if it works for you. The code assumes you can use Visual Studio. Make the Web Service 1. Make a new project, choosing to make a Web Service. 2. In the code behind-page, place the code below. 3. Build the Web Service. Code: <WebMethod()>...

how to pass xml file to web service ?
Hi    how to pass xml file to web service            Thanks in advance . The Request/Response of webservices itself is SOAP based, specifically in C# you can pass it as string and load it from string into XmlDocument objectWhen the going gets tough - the tough gets going------------------------------------------------------------------If you find this helpful then please mark this post as Answer.  There are many ways.  The easiest is to have an XMLDocument as a parameter and load your xml file into it (XMLDocum...

Web resources about - Passing an XML string as part of an XML Web Service - asp.net.xml-web-services

Passing loop - Wikipedia, the free encyclopedia
Trains / trams going in the same direction can also overtake, providing that the signalling arrangement allows it. A passing loop is double ended ...

Facebook Gets Passing Grade From Irish Agency Audit - AllFacebook
Facebook received its report card in the form of a detailed audit by the Office of the Irish Data Protection Commissioner, and its grades were ...

Dan Aykroyd - Deeply saddened to hear of the passing of my... - Facebook
Deeply saddened to hear of the passing of my brilliant, gifted, funny friend, co-writer/performer and teacher Harold Ramis. May he now get the ...

Thread: Buck-passing bullshit.
The Repubs are tempting fate, trying to allocate blame for Obama's loss in November. Obviously it's a little presumptuous. If Romney wins, it's ...

Scripting News: People are asking about the history of RSS today because of Aaron's passing.
People are asking about the history of RSS today because of Aaron's passing. In April 2004 I put together a timeline of the various specs that ...

The secrets of passing TOEIC 600 - ValueEnglish on the App Store on iTunes
Get The secrets of passing TOEIC 600 - ValueEnglish on the App Store. See screenshots and ratings, and read customer reviews.

walmart donated a palette of water. everyone was great about passing the bottles back - Flickr - Photo ...
Explore pinguino's photos on Flickr. pinguino has uploaded 16442 photos to Flickr.

Straight Rod Passing Through Curved Hole - YouTube
To use this video in a commercial player or in broadcasts, please email licensing@storyful.com Here is the explanation on how it works​ ;) h ...

Passing of UAE companies law delayed
The council was scheduled to convene today to debate the remaining four articles of the 377-article law, but were told by the Minister of State ...

Cabcharge left with a hard road after Reg Kermode's passing
Reg Kermode's company faces testing challenges after his death, writes Colin Kruger .

Resources last updated: 1/12/2016 9:03:21 PM