473,657 Members | 2,535 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem when sending an xml string to a web service


Hi,

I'am sending an xml string to a web service(which is written in c#)
using the microsoft web services behavior.
When I check this string from the web service I observed that some of
the charaters have been replaced.

e.g "<" is replaced with "%3C", ">" is replaced with "%3E"
characters lik =," are replaced too.

can anybody explain the reason for this and give a solution

Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 15 '05 #1
2 3035
Try to encode xml with

System.Web.Http Utility.UrlEnco deUnicode

"anonymous" <an*******@devd ex.com> schrieb im Newsbeitrag
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..

Hi,

I'am sending an xml string to a web service(which is written in c#)
using the microsoft web services behavior.
When I check this string from the web service I observed that some of
the charaters have been replaced.

e.g "<" is replaced with "%3C", ">" is replaced with "%3E"
characters lik =," are replaced too.

can anybody explain the reason for this and give a solution

Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #2
The problem you are seeing is by design. A webservice communications via XML
over HTTP. Therefore, if the data you are sending is also XML, and no
changes were made to the data, the webservice would not be-able to
destinguish the Webservice XML from the dataXML and the it would not work.
Therefore, everything you send to the webservice must first be encoded. You
can use the built in System.Web.Http Utility.UrlEnco de function to encode
your data before sending.


"anonymous" <an*******@devd ex.com> wrote in message
news:%2******** ********@TK2MSF TNGP12.phx.gbl. ..

Hi,

I'am sending an xml string to a web service(which is written in c#)
using the microsoft web services behavior.
When I check this string from the web service I observed that some of
the charaters have been replaced.

e.g "<" is replaced with "%3C", ">" is replaced with "%3E"
characters lik =," are replaced too.

can anybody explain the reason for this and give a solution

Thanks
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 15 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
2025
by: Fabio Papa | last post by:
I am trying to write a windows service that sends emails to clients at specific times based on information in a sql db. Since this is done for multiple cities, I start a thread for each city and continue the processing from each thread. My service starts fine (gives me no errors, etc), but it doesn't seem to start the new threads. I am new to windows services, so I don't know if I'm doing something wrong. Should I maybe be doing this...
2
352
by: Stewart | last post by:
Hi, I'm hoping that someone will be able to help out with a problem we are having. We have a web service built in .Net 1.1. We are trying to call it from PHP4 using the NuSOAP add on. It seems the SOAP it is sending as the request isn't what the web service is looking for. Here is what my PHP4 NuSOAP client is sending: <?xml version="1.0" encoding="ISO-8859-1"?>
0
1125
by: zurg | last post by:
Hi! I have a problem with sending a custom command to a windows service i wrote before. If I use ControlService it works perfectly - the service send an answear... but when I use WMI there's no reaction... Thanks in advance The code look like this: Option Explicit On
1
2192
by: Byungchul Lee | last post by:
Hello. I'm making a small web service program (with a small web-server component, without ASP.Net). I made a server and a client and client calls the service with invoke method. But I have a problem with sending string array to a server. When server try to deserialize it, it makes weird exception(system.ExecutionEngineException).
3
5057
by: Jerome Cohen | last post by:
AI am trying to call a third-party web service. this service expects an XML fragment that contains the request plus other parameter. adding the web reference created the syntax below(reference.vb). I changed the data type for the structure that contains the XML data from the default "String" to "xml.xmldocument" to enable easy filling of the data. my client code creates an XML document class, fills the data using standard xml dom...
0
1565
by: iprogrammer | last post by:
i have a problem when i try to run my windows service ..which is "Error 1053: The service did not respond to the start or control request in a timely fashion" >after this i cannot anything with the service and have to restart the computer inorder for the service to be deleted. >1) my service program is basically a client tht is listening on a port to a request from a server and establishing a new connection. 2) reading and extracting...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4315
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.