JIRA

  • Log In Access more options
    • Online Help
    • GreenHopper Help
    • Agile Answers
    • Use Agile By Default
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What’s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Agile Access more options (Alt+g)
  • Create Issue
  • Mule
  • MULE-1634

Add some error handling in the WSDL Stock Quote example to detect if the service is down (i.e. HTML payload is received)

  • Agile Board
  • More Actions
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.4.1
  • Fix Version/s: None
  • Component/s: Examples / Tutorials
  • Labels:
    None
  • User impact:
    Medium
  • Similar Issues:
    None

Description

We should ind a generic way of handling this since most .Net web services retrun HTML not SOAP faults. genius. See MULE-1613.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
  • Transitions
  • Commits
  • Source
  • Builds
Hide
Permalink
Holger Hoffstaette added a comment - 18/Apr/07 06:35 AM

A frightening idea: could the SOAP message adapters peek for <html> and wrap that into a fault - maybe as an option so that it can be turned off?

Show
Holger Hoffstaette added a comment - 18/Apr/07 06:35 AM A frightening idea: could the SOAP message adapters peek for <html> and wrap that into a fault - maybe as an option so that it can be turned off?
Hide
Permalink
Holger Hoffstaette added a comment - 18/Apr/07 06:47 AM

Alternatively we could try to test for the response content-type, i.e. text/html vs. xml

Show
Holger Hoffstaette added a comment - 18/Apr/07 06:47 AM Alternatively we could try to test for the response content-type, i.e. text/html vs. xml
Hide
Permalink
Lajos Moczar added a comment - 18/Apr/07 06:50 AM

Somebody is reading my mind. A couple of hours ago I set up a test case for a service that is indeed down so I could figure out more intelligent error handling. So far, sadly, it is failing with the proper error being thrown but I'm trying to break it

Show
Lajos Moczar added a comment - 18/Apr/07 06:50 AM Somebody is reading my mind. A couple of hours ago I set up a test case for a service that is indeed down so I could figure out more intelligent error handling. So far, sadly, it is failing with the proper error being thrown but I'm trying to break it
Hide
Permalink
Ross Mason added a comment - 18/Apr/07 08:26 AM

Testing for the content-type is probably the best way to go.

Show
Ross Mason added a comment - 18/Apr/07 08:26 AM Testing for the content-type is probably the best way to go.
Hide
Permalink
Lajos Moczar added a comment - 23/Apr/07 05:15 AM

This is more complicated than it sounds. On external calls, the MessageAdapter isn't used; the Object[] response is wrapped in a MuleMessage. And sadly, the only webservicex.net service that is done, returns a proper SOAP fault So, after looking thru the XFire source and testing various things, I conclude that the best way to deal with this is via a connector property that specifies whether to throw an exception if response[0] mimetype does not match xml. This has to be configured by the user, no defaulting here, as there are valid services (like the Currency Converter example I posted in the wiki last week) that don't return xml.

Show
Lajos Moczar added a comment - 23/Apr/07 05:15 AM This is more complicated than it sounds. On external calls, the MessageAdapter isn't used; the Object[] response is wrapped in a MuleMessage. And sadly, the only webservicex.net service that is done, returns a proper SOAP fault So, after looking thru the XFire source and testing various things, I conclude that the best way to deal with this is via a connector property that specifies whether to throw an exception if response[0] mimetype does not match xml. This has to be configured by the user, no defaulting here, as there are valid services (like the Currency Converter example I posted in the wiki last week) that don't return xml.
Hide
Permalink
Holger Hoffstaette added a comment - 23/Apr/07 05:44 AM

Webservicex may return a proper fault when it's up and used incorrectly, but definitely not when it's down (otherwise there wouldn't be HTML in the response). Might be because the service itself is proxied by a webserver in front of it which returns the "error page" in HTML when the service is down.

Show
Holger Hoffstaette added a comment - 23/Apr/07 05:44 AM Webservicex may return a proper fault when it's up and used incorrectly, but definitely not when it's down (otherwise there wouldn't be HTML in the response). Might be because the service itself is proxied by a webserver in front of it which returns the "error page" in HTML when the service is down.
Hide
Permalink
Lajos Moczar added a comment - 23/Apr/07 10:46 AM

All that is academic, in fact. The XFire dynamic client, which we are using here, seems to only return primitives. So there is no mime type to use. Basically, we get a java.lang.String for both normal and error invocations of stockquote. We can a java.lang.Double for invocations of the currency converter. However you look at it, if you get a non-XML error, can have no good way to trap it. Unless we want to hack xfire, of course . I think I will close this as "will not fix", since any solution will be fairly complex.

Show
Lajos Moczar added a comment - 23/Apr/07 10:46 AM All that is academic, in fact. The XFire dynamic client, which we are using here, seems to only return primitives. So there is no mime type to use. Basically, we get a java.lang.String for both normal and error invocations of stockquote. We can a java.lang.Double for invocations of the currency converter. However you look at it, if you get a non-XML error, can have no good way to trap it. Unless we want to hack xfire, of course . I think I will close this as "will not fix", since any solution will be fairly complex.
Hide
Permalink
Ross Mason added a comment - 23/Apr/07 11:47 AM

I'd imaging we can hook in a handler of sort to get the Http Soap Response and determine the error. Not sure how we pass that back to Mule though...

Show
Ross Mason added a comment - 23/Apr/07 11:47 AM I'd imaging we can hook in a handler of sort to get the Http Soap Response and determine the error. Not sure how we pass that back to Mule though...

People

  • Assignee:
    Unassigned
    Reporter:
    Ross Mason
Vote (0)
Watch (0)

Dates

  • Created:
    18/Apr/07 05:38 AM
    Updated:
    11/Jun/07 04:18 PM

Agile

  • View on Board
  • Atlassian JIRA (v5.0.7#734-sha1:8ad78a6)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for MuleForge. Try JIRA - bug tracking software for your team.