473,396 Members | 1,777 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to change SOAP message before it's validation

Hi, All,

I have a very simple webmethod:

[WebMethod]
public string HelloWorld(int i)
{
return i.ToString();
}

when someone call this service to pass a empty string and I got the nasty
error like:
System.ArgumentException: Cannot convert Test to System.Int32.
Parameter name: type ---> System.FormatException: Input string was not in a
correct format.
at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatP rovider provider)
at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
at System.Web.Services.Protocols.ScalarFormatter.From String(String value,
Type type)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.ScalarFormatter.From String(String value,
Type type)
at
System.Web.Services.Protocols.ValueCollectionParam eterReader.Read(NameValueC
ollection collection)
at System.Web.Services.Protocols.UrlParameterReader.R ead(HttpRequest
request)
at System.Web.Services.Protocols.HttpServerProtocol.R eadParameters()
at System.Web.Services.Protocols.WebServiceHandler.In voke()
at System.Web.Services.Protocols.WebServiceHandler.Co reProcessRequest()
Is there a way to override the behavior? I tried the SoapExtension and try
to change the empty string
Nov 21 '05 #1
1 2066
You cannot assign a null value to an int

"John" <jo*********@pursca.com> дÈëÏûÏ¢
news:#Y*************@tk2msftngp13.phx.gbl...
Hi, All,

I have a very simple webmethod:

[WebMethod]
public string HelloWorld(int i)
{
return i.ToString();
}

when someone call this service to pass a empty string and I got the nasty
error like:
System.ArgumentException: Cannot convert Test to System.Int32.
Parameter name: type ---> System.FormatException: Input string was not in a correct format.
at System.Number.ParseInt32(String s, NumberStyles style,
NumberFormatInfo info)
at System.String.System.IConvertible.ToInt32(IFormatP rovider provider)
at System.Convert.ChangeType(Object value, Type conversionType,
IFormatProvider provider)
at System.Web.Services.Protocols.ScalarFormatter.From String(String value, Type type)
--- End of inner exception stack trace ---
at System.Web.Services.Protocols.ScalarFormatter.From String(String value, Type type)
at
System.Web.Services.Protocols.ValueCollectionParam eterReader.Read(NameValueC ollection collection)
at System.Web.Services.Protocols.UrlParameterReader.R ead(HttpRequest
request)
at System.Web.Services.Protocols.HttpServerProtocol.R eadParameters()
at System.Web.Services.Protocols.WebServiceHandler.In voke()
at System.Web.Services.Protocols.WebServiceHandler.Co reProcessRequest()
Is there a way to override the behavior? I tried the SoapExtension and try
to change the empty string

Nov 21 '05 #2

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

Similar topics

0
by: Meh-Lit Kim | last post by:
Hi All, I'd like to use SOAP 1.2 messaging in a document-centric fashion. Does anyone know - 1. What to do to validate an incoming SOAP message ? Do people write an XML schema for their...
4
by: Peter Wullems | last post by:
I have created a schema to vallidate SOAP messages the first couple of lines are as follows: <?xml version="1.0" encoding="utf-8" ?> <SOAP-ENV:Envelope xmlns:SOAP-...
2
by: Rick | last post by:
I have an XML document that is generated from Infopath, I need to change the value of a namespace that is defined in a node in the form: <xsf:xDocumentClass "xmlns:my=valuehere">. when i navigate...
0
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method...
6
by: A.M-SG | last post by:
Hi, We are developing a SmartClient application and we are planning to expose business objects layer to SmartClient application by using ASP.NET SOAP web services.
7
by: cj | last post by:
Simple Object Access Protocol is new to me. Can anyone point me to a simple soap example? I found something on MS site but they don't tell me what namespace to include for dim SOAPClient = New...
0
by: glidin | last post by:
I'm hoping someone can help me with a SOAP signature validation issue I am having. A client is posting a signed SOAP envelope to our .NET web service and I am unable to validate their signature. ...
0
by: Patrick Brunmayr | last post by:
Hello I have a big Problem with validating a Soap Envelope. I have downloaded the xsd for a soap envelope from http://schemas.xmlsoap.org/soap/envelope/ The validation succeeds as lonng as i...
4
by: thebjorn | last post by:
I've been trying to use SOAPpy and ZSI (with and without the use of wsdl2py) to communicate with a SOAP server (looks like it's a WebLogic server(?) in front of some enterprise java bean) and not...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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,...

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.