[JBossWS] - user error handling.
by DoubleDenim
does anyone have any techniques for handling user errors with webservices?
for example you have a web service that queries a database for records but no records are found (not a terribly good example, but lets pretend that no records could mean a number of different things)..
do you use a webservice fault (exception) to say that theres no records because...? or do you have the operation return a "response" type message that contains a nullable object for the records (if there is any) and a list of error messages if there isn't?
When i started creating webservices in java i would have just thrown a bunch of custom faults for my user error handling.. but faults come back in a soap response with a 500 Internal server error http header and this just doesn't seem right. Plus i've since been programming using VB in dotnet *vomits* and exceptions (which i see faults as) are used a little differently to the way they are in java, moreso for exceptional circumstances rather than handling possible expected outcomes.
So I'm really just wondering how you guys handle expected user errors/responses? Are there any recommended or standard patterns for ways to handle these circumstances?
thanks
d
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009950#4009950
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009950
19Â years, 2Â months
[Beginners Corner] - Problem with Dukes Bank
by joshsmith
Hi,
Ive managed to get to 4.1.7.1 (v4) of the Getting Started Guide - following the Dukes Bank example. I think it is my configuration of the hsqldb-ds.xml file that is causing a problem:
<datasources>
| <local-tx-datasource>
| <jndi-name>DefaultDS</jndi-name>
| <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
| <driver-class>org.hsqldb.jdbcDriver</driver-class>
| <user-name>sa</user-name>
| <password></password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <security-domain>HsqlDbRealm</security-domain>
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
| <metadata>
| <type-mapping>Hypersonic SQL</type-mapping>
| </metadata>
| <depends>jboss:service=Hypersonic,database=default</depends>
| </local-tx-datasource>
|
| <local-tx-datasource>
| <jndi-name>juddiDB</jndi-name>
| <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
| <driver-class>org.hsqldb.jdbcDriver</driver-class>
| <user-name>sa</user-name>
| <password></password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <security-domain>HsqlDbRealm</security-domain>
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
| <metadata>
| <type-mapping>Hypersonic SQL</type-mapping>
| </metadata>
| <depends>jboss:service=Hypersonic,database=default</depends>
| </local-tx-datasource>
|
| <local-tx-datasource>
| <jndi-name>JBossESBDS</jndi-name>
| <connection-url>jdbc:hsqldb:hsql://localhost:1701</connection-url>
| <driver-class>org.hsqldb.jdbcDriver</driver-class>
| <user-name>sa</user-name>
| <password></password>
| <min-pool-size>5</min-pool-size>
| <max-pool-size>20</max-pool-size>
| <idle-timeout-minutes>0</idle-timeout-minutes>
| <security-domain>HsqlDbRealm</security-domain>
| <prepared-statement-cache-size>32</prepared-statement-cache-size>
| <metadata>
| <type-mapping>Hypersonic SQL</type-mapping>
| </metadata>
| <depends>jboss:service=Hypersonic,database=default</depends>
| </local-tx-datasource>
|
|
| <mbean code="org.jboss.jdbc.HypersonicDatabase"
| name="jboss:service=Hypersonic">
| <attribute name="Database">default</attribute>
| <attribute name="InProcessMode">true</attribute>
| </mbean>
|
| <!-- ,database=default
| <mbean code="org.jboss.jdbc.HypersonicDatabase" name="jboss:service=Hypersonic">
| <attribute name="Port">1701</attribute>
| <attribute name="Silent">true</attribute>
| <attribute name="Database">default</attribute>
| <attribute name="Trace">false</attribute>
| <attribute name="No_system_exit">true</attribute>
| </mbean>
| -->
| </datasources>
And Im getting the following error:
--- MBEANS THAT ARE THE ROOT CAUSE OF THE PROBLEM ---
ObjectName: jboss:service=Hypersonic,database=default
State: NOTYETINSTALLED
Depends On Me:
jboss.jca:service=ManagedConnectionFactory,name=DefaultDS
jboss.jca:service=ManagedConnectionFactory,name=juddiDB
jboss.jca:service=ManagedConnectionFactory,name=JBossESBDS
Any ideas on how I could solve this?
Cheers
Josh - JBoss 4.0.4GA WinXP(SP2)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4009949#4009949
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4009949
19Â years, 2Â months