473,756 Members | 3,499 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to handle invalid web service namespace error

Hi,

If the client tries to access a web service with invalid namespace, it gets
a SOAP exception as invalid SOAPAction.
The invalid namespace will happen because the proxies on the client side
were generated before the namespace on the server side was updated.
I would like to handle this myself and throw a SOAP exception with more
information in it.
How can I do that?

Thanks,
Ajay

Serve Code - The namespace is updated from "1111" to "2222".
[WebService(Name space=http://NoServerWithThi sName/Services/SayHello/2222)]

public class SayHello : System.Web.Serv ices.WebService

{

[WebMethod]

public string HelloWorld()

{

return "Hello World from "+Environment.U serName;

}

}

Client Proxy Code - Notice the "1111"

[System.Web.Serv ices.WebService BindingAttribut e(Name="SayHell oSoap",
Namespace=http://NoServerWithThi sName/Services/SayHello/1111)]

public class SayHello : System.Web.Serv ices.Protocols. SoapHttpClientP rotocol
{

....

}

Client Code -

try

{

SayHello s = new SayHello();

MessageBox.Show (s.HelloWorld() );

}

catch(Exception ex)

{

MessageBox.Show (ex.Message);

}
Nov 23 '05 #1
3 4703
"Ajay Choudhary" <aj***********@ hotmail.com> wrote in
news:Oq******** ******@TK2MSFTN GP15.phx.gbl:
If the client tries to access a web service with invalid namespace, it
gets a SOAP exception as invalid SOAPAction.
The invalid namespace will happen because the proxies on the client side
were generated before the namespace on the server side was updated.
I would like to handle this myself and throw a SOAP exception with more
information in it.


Where do you want to handle it, client side or server side?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #2
On the server side I would like to throw my own exception to clients with my
information in it.

"Chad Z. Hower aka Kudzu" <cp**@hower.org > wrote in message
news:Xn******** *********@127.0 .0.1...
"Ajay Choudhary" <aj***********@ hotmail.com> wrote in
news:Oq******** ******@TK2MSFTN GP15.phx.gbl:
If the client tries to access a web service with invalid namespace, it
gets a SOAP exception as invalid SOAPAction.
The invalid namespace will happen because the proxies on the client side
were generated before the namespace on the server side was updated.
I would like to handle this myself and throw a SOAP exception with more
information in it.


Where do you want to handle it, client side or server side?
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu

Nov 23 '05 #3
"Ajay Choudhary" <aj***********@ hotmail.com> wrote in
news:ex******** ******@tk2msftn gp13.phx.gbl:
On the server side I would like to throw my own exception to clients
with my information in it.


Im not sure of anyway offhand. But the webservices classes (both serve and
client) are very flexible. You'll need to dig around a bit and see if you can
hook in at the lower level.

If you cant - you could set up a redirect using a HTTP handler or ASHX, and
then preparse. If its ok, issue a HTTP redirect to send them to the real
webservice, else return the error.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programmin g is an art form that fights back"

Blog: http://blogs.atozed.com/kudzu
Nov 23 '05 #4

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

Similar topics

1
3179
by: Craig Ringer | last post by:
Hi folks I'm a bit of a newbie here, though I've tried to appropriately research this issue before posting. I've found a lot of questions, a few answers that don't really answer quite what I'm looking for, but nothing that really solves or explains all this. I'll admit to being stumped, hence my question here. I'm also trying to make this post as clear and detailed as possible. Unfortunately, that means it's come out like a book. I...
11
1304
by: Greg Smalter | last post by:
I'm converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The worst problem I've run into is all references (in codebehind CS files) to UserControls fail. I get the error "The type or namespace 'MyUserControl' does not exist in the namespace 'The.Correct.Namespace' (are you missing an assembly reference?)" even though the user control in question is named 'MyUserControl' and is explicitly wrapped in the namespace block...
0
1871
by: cnSoftware | last post by:
I come across this problem during my recent project and even now I am still be puzzled by it. So I paste the procedure here. I wish you can figure out where I am wrong or missing. The sample application is developed with VS 2005 Beta 2. 1. Create a base class named ¡°BaseEntity¡±
6
32009
by: jasn | last post by:
Hello I am getting the following error message when I try and send an XML sting to a web service, I read somewhere that most web services prefer ascii and some throw errors when using unicode so I have changed the encoding but still cant get rid of the error. System.Xml.XmlException: '', hexadecimal value 0x00, is an invalid character. Line 6, position 124. at System.Xml.XmlScanner.ScanHexEntity() at...
1
17895
by: Gabe Garza | last post by:
In the following code snippet: Microsoft.Web.Services.Security.Signature sig; try { sig = new Signature(x509Token); } catch(Exception ex) { txtStatus.Text = ex.Message + "-" + x509Token.Certificate.GetName(); }
0
1678
by: Tim_k | last post by:
I'm getting this error from Visual Studio 2005 when I do an Add Web Reference. I'm trying to connect to a web service from mQube. I can access the service through an http post in a browser so I know my login is ok. I get a warning that the cerficate has not been allowed by me. I've found a couple things in a google search on this that didn't make much sense. Does anyone have a suggestion? Thanks,
0
2365
by: =?Utf-8?B?QW5keSBZdQ==?= | last post by:
Hi, I'm trying to return exceptions from a WCF Service using FaultExceptions. I got the service compiled and running. But I get an error while adding a service reference to it. The error reads: " Attempting to download metadata from 'http://localhost:4619/WCFService1/Service.svc' using WS-Metadata Exchange or DISCO. Error: Cannot import wsdl:portType Detail: An exception was thrown while running a WSDL import extension:
2
10050
by: =?Utf-8?B?am1ncm8=?= | last post by:
I created a web service in visual studio 2003, tested it with a sample.xml file from a vendor we are using, and it worked exactly like it should. I depoloyed it to our server, created a project calling the webservice with the sample.xml file, and again it worked. Now the vendor is calling the web service from their application and receiving the following error, and stating that there is something with the Web Service or the SOAP Client...
20
6751
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1 xxx = new localhost.Service1(); localhost is not recognized by the compiler.
0
9456
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
10032
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...
0
9872
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...
0
9711
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...
1
7244
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...
0
6534
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
5141
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
5303
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2666
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.