473,624 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The surrogate pair is invalid

Greetings,

I have an application with several web services. They all connect to an
Oracle database to retreive/save data. Some methods return datasets
containning English and/or Arabic data. All these methods work fine most of
the time, but sometimes I receive the following error:

Server was unable to process request. --> There was an error generating the
XML document. --> The surrogate pair is invalid.

I cannot reproduce the error, but I think it happens only when the dataset
is being serialized to XML before being sent to the client.

When this exception is thrown after calling a certain web method, it is only
resolved by restarting the application domain in which the web services are
running. I restart the application domain by making any change in the
web.config file (such as adding/removing a space at the end of the file).
After restarting the application domain, the problem is solved, even though
I call the same web method with the same parameters and against the same
database (I just refresh the web page that calls the web method and it
works)

Thanks for your help in advance

Jan 5 '06 #1
3 4710
Sorry I forgot to mention that I am using .NET Framework version 1.1 service
pack 1. The problem happens on both Windows 2000 Server and Windows Server
2003 machines.

"Bike" <no****@nospam. nospam> wrote in message
news:%2******** *******@TK2MSFT NGP14.phx.gbl.. .
Greetings,

I have an application with several web services. They all connect to an
Oracle database to retreive/save data. Some methods return datasets
containning English and/or Arabic data. All these methods work fine most of the time, but sometimes I receive the following error:

Server was unable to process request. --> There was an error generating the XML document. --> The surrogate pair is invalid.

I cannot reproduce the error, but I think it happens only when the dataset
is being serialized to XML before being sent to the client.

When this exception is thrown after calling a certain web method, it is only resolved by restarting the application domain in which the web services are running. I restart the application domain by making any change in the
web.config file (such as adding/removing a space at the end of the file).
After restarting the application domain, the problem is solved, even though I call the same web method with the same parameters and against the same
database (I just refresh the web page that calls the web method and it
works)

Thanks for your help in advance

Jan 5 '06 #2
CG
Do you have session enabled?

I have seen problem where session is enabled and we get wiered error messages

"Bike" wrote:
Sorry I forgot to mention that I am using .NET Framework version 1.1 service
pack 1. The problem happens on both Windows 2000 Server and Windows Server
2003 machines.

"Bike" <no****@nospam. nospam> wrote in message
news:%2******** *******@TK2MSFT NGP14.phx.gbl.. .
Greetings,

I have an application with several web services. They all connect to an
Oracle database to retreive/save data. Some methods return datasets
containning English and/or Arabic data. All these methods work fine most

of
the time, but sometimes I receive the following error:

Server was unable to process request. --> There was an error generating

the
XML document. --> The surrogate pair is invalid.

I cannot reproduce the error, but I think it happens only when the dataset
is being serialized to XML before being sent to the client.

When this exception is thrown after calling a certain web method, it is

only
resolved by restarting the application domain in which the web services

are
running. I restart the application domain by making any change in the
web.config file (such as adding/removing a space at the end of the file).
After restarting the application domain, the problem is solved, even

though
I call the same web method with the same parameters and against the same
database (I just refresh the web page that calls the web method and it
works)

Thanks for your help in advance


Jan 9 '06 #3
Raj
I found your post when I was encountering the same problem. And did not see a resolution for it.

Here is what happened to me.

After days of scouring multiples times through every field/object that was being sierielized, I finally found one that had some very unusual data. And there was a lot of it, it almost looked like what I used to see in old C code for an unterminated string. Of course I have been told that that is impossible for .Net code, it still looked that way to me.

Anyway the field in question was being populated by a call to the database for a single date field from a table. I am using an Oracle 8i db, the select was "SELECT TO_CHAR(MAX(DB_ DATE_FIELD), 'YYYYMMDDHH24MI SS') AS VAL FROM TABLE_OF_DATES" . The tricky part was that it did not always return the "garbage", somtimes it was a NULL, sometimes it was real data. I tried the SQL repeatedly outside of the program, sqlplus, and every time it returned me the maximum date.

I played around with the select inside the program and found that the table had null values in some of the rows for the date. This should not have mattered but I was at my wits end, so added "WHERE DB_DATE_FIELD IS NOT NULL" to the SQL and TA DA !!! I got a good value. I have been watching it now for the past 2 days and so far so good.

My suggestion to you is to create a method thats dumps the object you are serializing to a debug/log file that you can easily access. Also put a try...catch around your serialize method so you can match up the dumped object with the attempt to serialize. At least that way you know what data is being processed when the error occurs. After a few tiems a pattern my show up.

I hope this helps you in some way. If you found a differnt cause or solution please post back.
---
Posted via www.DotNetSlackers.com
Jan 31 '06 #4

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

Similar topics

4
8100
by: DCM Fan | last post by:
{CREATE TABLEs and INSERTs follow...} Gents, I have a main table that is in ONE-MANY with many other tables. For example, if the main table is named A, there are these realtionships: A-->B A-->C A-->D
3
5268
by: Chris Mullins | last post by:
I've got a big unicode character, and i'm trying to build it into a string. The unicode character is in the range "0x10400", so it's going to require a surrogate pair. I've been through all the logic to iterate over strings that already have these pairs in them, but how do I encode this Unicode Character INTO the string? The string is UTF-8 encoded, but none of the things I've trided using the encoders seems to work right...
2
3264
by: Chris Mullins | last post by:
I've spent a bit of time over the last year trying to implement RFC 3454 (Preparation of Internationalized Strings, aka 'StringPrep'). This RFC is also a dependency for RFC 3491 (Internationalized Domain Names / IDNA) which is something that I also need to support. The problem that I've been struggling with in .NET is that of Unicode Code Points > 0xFFFF. These points are encoded into UTF8 using the Surrogate Pair encoding scheme that...
6
2618
by: guy | last post by:
if a string contains surrogate chars (i.e. Unicode characters that consiste of more than 1 char) do functions that use an indexer or a string length into the string e.g. Mid, Len work correctly? guy
3
2004
by: Sakcee | last post by:
Hi In one of the data files that I have , I am seeing these characters \xed\xa0\xa0 . They seem to break the xsl. --------------------------------------------------------------- Extra content at the end of the document XML/XSL Error: </data><data ><![CDATA[ í Pls advice ----------------------------------------------------------------
2
1714
by: JohnnyDeep | last post by:
Hi, I am creating an unique index on surrogate key column. The surrogate key is a generate number always increasing on my dimension table. The only operation on the table is insert (no update and no delete). 1- Can I specify pctfree=0 for the unique index on the surrogate key without getting page splits since I am only inserting an increasing number?
3
3194
by: MikeB | last post by:
Hello All, I have a console application that is run via a scheduled task everyday at 4 in the morning. For some reason, a couple of days ago, every time the scheduled task is run (ether manually or by scheduled time) I get a "The surrogate pair is invalid" error. When ever I manually run the app by double clicking it, it runs fine. Any ideas what could be causing this error? It used to run fine previously and am pretty sure nothing...
1
2749
by: Alexander Higgins | last post by:
>>Thanks for the response.... Point Taken but this is not the case. Thus, if a person writes a text file on her or his computer and does not use UNICODE to save it, the current code page is used. If this file is given to someone with some other current codepage, the file is not displayed correctly. Simply converting the file to Unicode will make the data display properly. When performing the encoding process the encoding will escape...
0
2082
by: =?Utf-8?B?Qy4gSHVnaGVz?= | last post by:
Hello, I have a .net 2.0 application using a 'Settings.settings' configuration file to store application settings. The settings are modified at runtime and stored when the user exits the application. Occasionaly, this exception will occur when calling the Settings.Default.Save() method: Invalid high surrogate character (0xDE1C). A high surrogate character must
0
8234
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8172
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
8677
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8335
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
8474
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
7158
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6110
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2605
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1482
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.