generating ASP.NET SOAP faults

April 9, 2003

I have been hacking around today using ASP.NET to create a web service (basically updating an existing ASP HTTP GET based credit card processing service).

I have run into a number of problems:

  • I can’t specify that parameters are optional.
  • I can’t generate a SOAP Fault.

I don’t think there is a solution to the former but I have discovered my problem with the latter.

I now know that it is trivial to generate a SOAP Fault with .Net by throwing a SoapException.

I spent an hour trying to generate a SOAP Fault while using the GET request. During lunch I realized that I was not sending a SOAP request so I should not expect a SOAP response.

So, I needed a quick way to send a SOAP request and see the result.

curl works well for this task:

curl -d @- -H "Content-Type: text/xml; charset=utf-8" "SOAPAction: \"http://missouri.edu/iats/ecommerce/\"" http://dev_server.missouri.edu/application/service.asmx

Note: You will need to change the charset and SOAPAction.

This causes curl to read the SOAP request from stdin.

The result returned now contains a SOAP fault (caused by the thrown SoapException).

Entry Filed under: programming. .

2 Comments Add your own

  • 1. Ramesh  |  November 20, 2003 at 3:26 pm

    Hi,
    I am looking for doing exactly like this. can you please share you code sample which will return the SOAPException. I just couldn’t get this to work.

    Thanks in advance

    Reply
  • 2. nathan jacobs  |  November 20, 2003 at 9:47 pm

    My understanding is that any uncaught exception will be converted into a SOAPException by ASP.NET so long as it is processing a SOAP request.

    Reply

Leave a Comment

Required

Required, hidden

Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <pre> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe to the comments via RSS Feed


About me

Hello, I'm Nathan Jacobs and you are looking at my blog. I am a doctoral candidate in Computer Science at Washington University in St. Louis focusing on Computer Vision. My research is in algorithms to improve the ability of computer to reason about the natural world. I also really like to make attractive and informative visualizations of complex data.

I currently update my flickr site much more frequently than this blog.

RSS twitter

Category Cloud

computer vision friend information retrieval information technology knowledge management landscaping machine learning math mozilla noise personal programming research site admin social software teaching travel ultimate frisbee usability web standards

friend

links

papers

Top Posts

Flickr Photos

Smooth

View from Mill Club 405

View from Mill Club 405

Rainbow Sunrise

Why can't I turn left?

More Photos