Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / October 2004

Tip: Looking for answers? Try searching our database.

FaultTo endpoint does not work with "soap.tcp"

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ramadass - 28 Sep 2004 22:08 GMT
I am designing an application,in which, i wish to catch an exception if the
destination SoapReceiver doesnt exist or is not actively running.
For this i initialized a SoapReceiver (the faultReceiver) at a specific
endpoint (the fault endpoint) to catch all faults.
The FaultTo address of the SoapEnvelope's context is set to the above fault
endpoint.

Now if i send a request to a non existing endpoint, the FaultReceiver is
sent a message. This works fine as long the end points are "soap.inproc".
If i change the endpoint to "soap.tcp", then the faultReceiver doesnt
receive a message.
Does the FaultTo works only with inproc?
Is there a better way to throw and catch Faults?

Thanks
Ramadass

The code is shown below.

private EndpointReference faultEndpoint = new EndpointReference(new Uri
("soap.inproc://localhost/fault"));
private EndpointReference destination = new EndpointReference(new
Uri("soap.inproc://localhost/SomeWhere"));

 private void Form1_Load(object sender, System.EventArgs e)
 {
      FaultReceiver faultReceiver = new FaultReceiver(); // FaultReceiver
derives from a SoapReceiver
      SoapReceivers.Add(faultEndpoint, faultReceiver);
 }

 private void button1_Click(object sender, System.EventArgs e)
 {
      SoapSender sendRequest = new SoapSender(destination);

      SoapEnvelope env = new SoapEnvelope();
      env.Context.Addressing.Action = new Action("SomeTestAction");
      env.Context.Addressing.FaultTo = new FaultTo(faultEndpoint);
      env.Body.InnerText = "TestData";
      sendRequest.Send(env);
 }

the receive method of the faultReceiver is show below

protected override void Receive(SoapEnvelope envelope)
{
      System.Diagnostics.Debug.WriteLine("The receiver was unavailable");
}
Hervey Wilson [MSFT] - 29 Sep 2004 05:56 GMT
> I am designing an application,in which, i wish to catch an exception if the
> destination SoapReceiver doesnt exist or is not actively running.
[quoted text clipped - 9 lines]
> Does the FaultTo works only with inproc?
> Is there a better way to throw and catch Faults?

In general, FaultTo and ReplyTo are tricky things to obey at a receiver
because they provide an easy mechanism for someone to flood a different
server by sending bad requests with one of these headers pointing at
another machine. By default, WSE will inject a Via element into incoming
ReplyTo and FaultTo headers to force them back down the originating
connection. There is a specific configuration for enabling ReplyTo and
FaultTo behaviour - it's called allowResponseRedirection and details can
be found in the wse.config file in the WSE installation directory. Only
if you enable this will the product obey these headers.

soap.inproc works here regardless of this setting because it is using an
app.domain wide central dispatch queue rather than unique network
connections and therefore the injected Via doesn't prevent delivery of
the fault.

Signature

This posting is provided "AS IS", with no warranties, and confers no rights.

Ramadass - 29 Sep 2004 22:41 GMT
Thanks,
I added <allowRedirectedResponses enabled="true" /> and the fault receiver
receives the message on a fault.
This works fine as long as my faultreceiver endpoint is of the format
"soap.tcp://localhost/xyz",
but Fails if the endpoint is like "soap.tcp://localhost:8040/xyz".
Is my address configuration incorrect?
Does this affect only when i use the localhost or does it affect if use
soap.tcp://servername:portname/xyz?

Regards
Ramadass

> > I am designing an application,in which, i wish to catch an exception if the
> > destination SoapReceiver doesnt exist or is not actively running.
[quoted text clipped - 24 lines]
> connections and therefore the injected Via doesn't prevent delivery of
> the fault.
Hervey Wilson [MSFT] - 03 Oct 2004 19:02 GMT
> Thanks,
> I added <allowRedirectedResponses enabled="true" /> and the fault receiver
[quoted text clipped - 5 lines]
> Does this affect only when i use the localhost or does it affect if use
> soap.tcp://servername:portname/xyz?

Specifying a port should work provided that you have registered the your
fault receiver at the same address.

Signature

This posting is provided "AS IS", with no warranties, and confers no rights.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.