Sending an XML data as string with a web service as parameter


I'm trying to send data to a .net webservice with a webservice client on Delphi 2006. The service functions which i'm trying to use has two different versions. I'm using the second one because first one has a Dataset paramater.Second version has string pDataSetXmlContent parameter instead of the pdataset parameter of first one. (They say that second version for Delphi and Java as first one for C#)

Versions of Service Functions:

1. int SendDepartmentGeneralInfo(string pUsername, string pPassword, string pIP, string pHospitalCode, *DataSet pDataSet* )

2. int SendDepartmentGeneralInfoWithString(string pUsername, string pPassword, string pIP, string pHospitalCode, *string pDataSetXmlContent* )

When i send the data, i see that the XML data which i prepared has changed on HTTPRIO onbeforeexecute.

While the some parts of the XML look fine, the part of it which contains the pDataSetXmlContent is changed as < and > characters replaced by & l t ; and & g t ; characters (without spaces) and service returns "Dataset is empty" error message. I think it must work if i could change *& l t ;* and *& g t ;* (without spaces) to < and >.

*1. Is it normal to send &lt; and &gt; characters to a web service?*

*2. If it is not why < and > characters changed to & l t ; and & g t ; (without spaces) automatically?*

*3. How could i prevent them to change?*

*4. Or could i use dataset version of service function in Delphi 2006?*

Thanks so much for help.

ibrahim kazanci

It is not a public service but i think i could send WSDL file for more information.

*The XML data which i catch on onbeforeexecute:* (i think & l t ; and & g t ; characters will auto. changed into < and > as i see preview of this forum. So you imagine bold part of XML has no < and > characters but *& l t ;* and *& g t ;* with no spaces.

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="">
  <SOAP-ENV:Body SOAP-ENV:encodingStyle="">
    <NS1:SendDepartmentGeneralInfoWithString xmlns:NS1="hbyswebservice">
      <pUsername xsi:type="xsd:string">yyy</pUsername>
      <pPassword xsi:type="xsd:string">xxx</pPassword>
      <pIP xsi:type="xsd:string"></pIP>
      <pHospitalCode xsi:type="xsd:string">xxxxxxxx</pHospitalCode>
      *<pDataSetXmlContent xsi:type="xsd:string">&lt;NewDataSet&gt;&lt;SendDepartmentGeneralInfo&gt;&lt;Row1&gt;&lt;BolumKodu&gt;124&lt;/BolumKodu&gt;&lt;HizmetDurumu&gt;1&lt;/HizmetDurumu&gt;&lt;BolumSorumlusu&gt;UZM.DR.SEDAT AKSIN&lt;/BolumSorumlusu&gt;&lt;IrtibatTelefonu&gt;0533 xxx xxx xxx&lt;/IrtibatTelefonu&gt;&lt;UzmanHekimAdedi&gt;13&lt;/UzmanHekimAdedi&gt;&lt;ToplamYatakAdedi&gt;-1&lt;/ToplamYatakAdedi&gt;&lt;ToplamVentilatorAdedi&gt;-1&lt;/ToplamVentilatorAdedi&gt;&lt;ToplamKuvezAdedi&gt;-1&lt;/
ToplamKuvezAdedi&gt;&lt;Aciklama&gt;Aciklama &lt;/Aciklama&gt;&lt;/Row1&gt;&lt;Row2&gt;&lt;BolumKodu&gt;126&lt;/BolumKodu&gt;&lt;HizmetDurumu&gt;1&lt;/HizmetDurumu&gt;&lt;BolumSorumlusu&gt;OP.DR.HÜSEYIN AKÇA&lt;/BolumSorumlusu&gt;&lt;IrtibatTelefonu&gt;&lt;/IrtibatTelefonu&gt;&lt;UzmanHekimAdedi&gt;34&lt;/UzmanHekimAdedi&gt;&lt;ToplamYatakAdedi&gt;-1&lt;/ToplamYatakAdedi&gt;&lt;ToplamVentilatorAdedi&gt;-1&lt;/ToplamVentilatorAdedi&gt;&lt;ToplamKuvezAdedi&gt;-1&lt;/ToplamKuvezAdedi&gt;&lt;Aciklama&gt;Aci
klama &lt;/Aciklama&gt;&lt;/Row2&gt;&lt;Row3&gt;&lt;BolumKodu&gt;127&lt;/BolumKodu&gt;&lt;HizmetDurumu&gt;1&lt;/HizmetDurumu&gt;&lt;BolumSorumlusu&gt;UZM.DR.SÃœLEYMAN TOKER&lt;/BolumSorumlusu&gt;&lt;IrtibatTelefonu&gt;0 xxx xxx xx xx&lt;/IrtibatTelefonu&gt;&lt;UzmanHekimAdedi&gt;29&lt;/UzmanHekimAdedi&gt;&lt;ToplamYatakAdedi&gt;-1&lt;/ToplamYatakAdedi&gt;&lt;ToplamVentilatorAdedi&gt;-1&lt;/ToplamVentilatorAdedi&gt;&lt;ToplamKuvezAdedi&gt;-1&lt;/ToplamKuvezAdedi&gt;&lt;Aciklama&gt;Aciklama &lt;/Aciklama&gt

*and it must be like that:*

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="" xmlns:xsd="" xmlns:xsi="" xmlns:SOAP-ENC="">
  <SOAP-ENV:Body SOAP-ENV:encodingStyle="">
    <NS1:SendDepartmentGeneralInfoWithString xmlns:NS1="hbyswebservice">
      <pUsername xsi:type="xsd:string">yyy</pUsername>
      <pPassword xsi:type="xsd:string">xxx</pPassword>
      <pIP xsi:type="xsd:string"></pIP>
      <pHospitalCode xsi:type="xsd:string">xxxxxxxx</pHospitalCode>
      *<pDataSetXmlContent xsi:type="xsd:string"><NewDataSet><SendDepartmentGeneralInfo><Row1><BolumKodu>124</BolumKodu><HizmetDurumu>1</HizmetDurumu><BolumSorumlusu>UZM.DR.SEDAT AKSIN</BolumSorumlusu><IrtibatTelefonu>0xxx xxx xx xx</IrtibatTelefonu><UzmanHekimAdedi>13</UzmanHekimAdedi><ToplamYatakAdedi>-1</ToplamYatakAdedi><ToplamVentilatorAdedi>-1</ToplamVentilatorAdedi><ToplamKuvezAdedi>-1</ToplamKuvezAdedi><Aciklama>Aciklama </Aciklama></Row1><Row2><BolumKodu>126</BolumKodu><HizmetDurumu>1</HizmetDuru
mu><BolumSorumlusu>OP.DR.HÜSEYIN AKÇA</BolumSorumlusu><IrtibatTelefonu></IrtibatTelefonu><UzmanHekimAdedi>34</UzmanHekimAdedi><ToplamYatakAdedi>-1</ToplamYatakAdedi><ToplamVentilatorAdedi>-1</ToplamVentilatorAdedi><ToplamKuvezAdedi>-1</ToplamKuvezAdedi><Aciklama>Aciklama </Aciklama></Row2><Row3><BolumKodu>127</BolumKodu><HizmetDurumu>1</HizmetDurumu><BolumSorumlusu>UZM.DR.SÜLEYMAN TOKER</BolumSorumlusu><IrtibatTelefonu>0 xxx xxx xx xx</IrtibatTelefonu><UzmanHekimAdedi>29</UzmanHekimAdedi><ToplamYatakAd
edi>-1</ToplamYatakAdedi><ToplamVentilatorAdedi>-1</ToplamVentilatorAdedi><ToplamKuvezAdedi>-1</ToplamKuvezAdedi><Aciklama>Aciklama </Aciklama></Row3></SendDepartmentGeneralInfo></NewDataSet></pDataSetXmlContent>*
3/25/2010 9:26:21 PM
embarcadero.delphi.webservices 976 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 30


Similar Artilces:

Reporting services: Querying a web service with report parameters (xml data extension)
 Hi all,I am using SQL Server Reporting Services 2005 and am attempting to query a web service that I have. If I query a webservice that doesn't take in any parameters, say service(), then I am able to get a flatten dataset. If I try with a web service that requires parameters, say service(string id, string procedure), I tried to pass in report parameters. However, on the web service side the report parameters do not exist and if I inspect the parameters, they are null. I added report parameters using the Data and Layout tabs via a Report Server Project. Does anyone k...

send data from web service to local computer, using web services.
hii have a web application, on web server , and a database on my local computer in my office.i want to send data from my web pages to my local database.i think one way is using web services.i used that, but it has permission errors.that web service have this error :  Server Error in '/in' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30180: Keyword does not name a type.Source Err...

delphi 2009 web service parameter as xml
Hi I'm trying to make a web service function with a xml as parameter. I don't want to make the parameter as a string, instead I want to add the xml schema to the wsdl, so that the client program gets the schema and requests the function with a proper xml. Could somebody help me? On 03.03.2010 20:54, vesa tuominen wrote: > I'm trying to make a web service function with a xml as parameter. I don't want to make the parameter as a string, instead I want to add the xml schema to the wsdl, so that the client program gets the schema and requests the function with a proper xm...

sending xml data aas a parameter in a webservice
I'm trying to use a webservice to gather xml data, but I want the XML to stay as XML. I'm sending the data from the source computers in vbscript. I need to serialise the data into binary or something so the webservice does not parse the XML. I would then deserialise back into XML on the webservice to then store the xml in my database.. Any ideas welcomed! This article has the answer  Vikram www.vikramlakhotia.comPlease mark the answer if it helped you  The xml data is coming from vbscript soap send, so I c...

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...

How to build XML String from XSD then send to Web Service
HI.... I need some guidance please.  I'm pretty new to XML and Web Services and need direction. Using VS2005 and Framework 2.0 I need to build an XML string that will be sent via a Windows Forms client to a Web service.  The folks who wrote this Web Service didn't make things very easy for using a .Net Proxy Class to create a client application. Here's the WSDL (fragment) for the Method that I need to consume.... <s:element name="SaveData">    <s:complexType>      <s:sequence>    ...

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() ...

Urgent : Passing XML data as a web service' Parameter ?
hello friends, i need a genuine help and that is urgent need to solve it. my problem is how can i write a code that accepts Web Form's input values and that generate one xml tag file internally and after that whenever i consume it in to my web service it allows me to pass that whole XML file as a parameter in webservice's browser's textbox residing with "invoke" button. can u provide some URL that expplains me basic - pls give reference to specific code. please give me favour and help for that. thx. An entire XML document can be passed to a web service metho...

sending utf-8 data to .net web service from delphi
Hi I have a .net web service and i use delphi client to work with it , When i read information from my web service every thing is OK and i can easily get unicode data from my web service but when i want to send my unicode data to my web service all of unicode data changes to ???? ????????? ... I have this problem in delphi because when sending my unicode data directly from IE to web service it work correctly . Please Help me if u can . Thanks and Best Regards i had same problem, and after wasting couple of time find the solution. after importing WSDL file bye WSDL Importer, ...

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: Hope this helps....

Ajax calls web service. Web service returns string nodes and 1 node of binary data...How?
I've been all over the place looking for some helpful clues with ASP.Net 3.5 and handling binary data returned to a client.  Initially it was a standard PDF this point, I'd be happy to see that Ajax ASP.Net sending back an image or sound file embedded as binary data within the XML/SOAP data sent back to the user.  Below is one of several variations that I've tried.  Any suggestions? 1.  User clicks a button on the web page.  The button calls a JScript which calls the web service. 2.  The web service sends back an XML/SOAP respon...

Problem when calling web service and passing xml-like string as parameter
Hi,In 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...

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.  Hi You can pass that XML string to the web method as a parameter.See...

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()>...

Web resources about - Sending an XML data as string with a web service as parameter - embarcadero.delphi.webservices

Parameter - Wikipedia, the free encyclopedia
A parameter (from the Ancient Greek παρά , "para", meaning "beside, subsidiary" and μέτρον , "metron", meaning "measure"), in its common meaning, ...

fb_source Parameter - Facebook-Entwickler
This document lists the complete list of values for the fb_source parameter that is returned with th...

Google / Firefox Parameter - Flickr - Photo Sharing!
HS what?

Cat 8: TIA performance standards committee chairman previews parameters of forthcoming twisted-pair cable ...
Category 8, the next-generation twisted-pair cabling specification, is still in development, but the outlook looks quite positive that it will ...

Philippine president asks for 'parameters' of Mayon Volcano tours
Philippine president asks for 'parameters' of Mayon Volcano tours People's Daily Online ... 26, 27, 28, 29, 30, 31. Jan, Feb, Mar, Apr, May, ...

Alternatives to boolean parameters
... ) { PrintLine ( item . Name ); if ( printDetails ) { PrintLine ( item . Description ); } } } Aha! Now can see that the boolean parameter ...

Exporting Error (Error in Parameter...: Apple Support Communities
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability ...

Apple tech monitors device aging, adjusts operating parameters to ensure optimal performance
... describing a method of monitoring the aging of a device's electronics, comparing the data with a global average and modifying operating parameters ...

Is it poor programming practice to pass parameters as objects?
... a free, community-powered network of 100+ Q&A sites . Risser asked: So, we've got a guy who likes to write methods that take Objects as parameters, ...

Parameter Short Film Competition sponsored by Grolsch
Grolsch presents Parameter The A.V. Club Short Film Competition Please Enter Your Date of Birth Ineligible entry Enter For people over the age ...

Resources last updated: 12/18/2015 12:17:53 PM