Error Handling in a web service
Hi,
We are going through the process of producing some test web services, and was wondering if there is a way of handling errors so that a more meaningful message can be output instead of a SOAP Exception.
For example if a number was passed in that was invalid, such as a negative number when only positive would be allowed. Is it possible to output a message that would say something like
'Number input must be positive'
instead of this type of error
[SOAPException: faultCode=SOAP-ENV:Server; msg=ORA-06502: PL/SQL: numeric or value error
ORA-06512: at "CDDEV.SQUARE_ROOT", line 6
ORA-06512: at line 1
java.lang.String mypackage3.Square_rootStub.get_square_root(java.math.BigDecimal)
Square_rootStub.java:68
void mypackage3.Class1.main(java.lang.String[])
Class1.java:15
This example was done using a PL/SQL web service, but equally using Java if you throw an exception for a negative number you get a NaN type error.
Thanks
Gary
As the error is thrown by the PL/SQL Java wrapper, you possibly could capture it on the server side and throw a more meaningful message. What is happening is that java.sql.SQLException thrown on the server side by the Java PL/SQL wrappers is wrapped into a SOAP fault.
If you were to catch it yourself before propagating it back, you could replace the string. Unfortunately, the java.sql.SQLException is strewn about the generated code so it is hard to isolate - it isn't exactly straight forward. Another avenue to consider might be to wrapper the stored procedure code Java wrapper itself and write your own exception handling where you set the string explicitly (remember the string value set in any exception is what is passed back in the SOAP fault).
None of these are perfect, but perhaps they might give you some ideas ...
Mike.
Similar Messages
-
How to check error type in accessing web service?
Dear all,
I have created a form using WSDL connection to access web service in SOAP protocol.
But I have difficulties in error handling when acccessing web service.
I try to put a try catch block for the following statement :
ie. xfa.connectionSet.WebServiceDC.execute(false);
in case for any error, I can only catch message saying GeneralFault only.
Is there any extra object in the script that I can catch to handle for different error type?
e.g checking SOAP.? and where should I put the codes in?
Actualy I want to detect if network connection is not ok or if it fails to find ecert which is required under https connection
Rgds.Have you tried the try catch block ?
See the error codes it responds with.
Then look through the properties of the Exception
try
doInit();
} catch(err)
var vDebug = "";
for (var prop in err)
vDebug += "property: "+ prop+ " value: ["+ err[prop]+ "]\n";
vDebug += "toString(): " + " value: [" + err.toString() + "]";
status.rawValue = vDebug;
function doInit()
doWebServiceCallThatFails();
Have fun with these articles
http://blogs.adobe.com/formfeed/2009/06/collected_form_development_and.html
http://blogs.adobe.com/formfeed/2009/03/handling_javascript_exceptions.html -
Error in calling External web service from soa suite 11.1.1.3
Hi
I am getting following error while calling external web service......
####<Jan 20, 2011 6:54:26 PM IST> <Warning> <oracle.integration.platform> <in-mum-adina05> <soa_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-490B9BABECE372A277DF> <24b9eca72eaaa6a3:-4bc6fb7c:12da206ca2c:-7ffd-0000000000006287> <1295529866047> <SOA-20136> <WS Binding: exception durign SOAP invocation: java.util.NoSuchElementException>
####<Jan 20, 2011 6:54:26 PM IST> <Warning> <oracle.soa.mediator.common> <in-mum-adina05> <soa_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-490B9BABECE372A277DF> <24b9eca72eaaa6a3:-4bc6fb7c:12da206ca2c:-7ffd-0000000000006287> <1295529866047> <BEA-000000> < Payload after BaseActionHander.requestMessage :{parameters=oracle.xml.parser.v2.XMLElement@bd2382}>
####<Jan 20, 2011 6:54:26 PM IST> <Warning> <oracle.soa.mediator.common> <in-mum-adina05> <soa_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <BEA1-490B9BABECE372A277DF> <24b9eca72eaaa6a3:-4bc6fb7c:12da206ca2c:-7ffd-0000000000006287> <1295529866063> <BEA-000000> < Properties after BaseActionHander.requestMessage :{ReferenceInstance=[email protected]63ea5,
####<Jan 20, 2011 6:54:29 PM IST> <Error> <oracle.webservices.service> <in-mum-adina05> <soa_server1> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <24b9eca72eaaa6a3:-4bc6fb7c:12da206ca2c:-7ffd-0000000000006287> <1295529869375> <OWS-04115> <An error occurred for port: FabricProvider: javax.xml.rpc.soap.SOAPFaultException: oracle.fabric.common.FabricInvocationException.>
I am able to hit external ws from soap ui and getting response but while calling from soa suite getting this error.
Any clues?
Thanks
VibhorWS Binding: exception durign SOAP invocation: java.util.NoSuchElementException
Looks like the error is in the data sent to or expected from the service in your composite. Check that audit logs and composite flow to make sure your soap message when using soapui matches what you are working with in soa suite. -
Error while completing a web service
Hi,
I have create a RFC, now to use that as a web service I have done the stpes for creating a web service as given in the link
sap technical link tutorial, web service create
when I click on complete button system is giving a messge as Error during activation of web service.
what configuration required for this we have ECC6 system.
regards,
zafar
Edited by: zkarnalkar on Dec 3, 2010 11:13 AMI guess that would depend on the error you're receiving - what is it? I've never seen a generation error for a service provider when following the few steps required, but you could debug the activation if the message isn't clear. Service consumer errors happen all the time and are generally related to WSDL file compatibility.
-
"RABAX" occurs on server side error while testing asynchoronous web service
I got error while testing asynchronous web service in WS navigator. I have created asynchronouse web service using RFC. Then I configured it in SOAMANAGER. When I tested it, got error "RABAX occurs on server side". Also I got dump in ST22. It is 'UNCHAUGHT_EXCEPTION - CX_SOAP_SEQ_SCD_ERROR'.
I have tested for synchronous web service it works fine. I found a difference in both web service WSDL file for below parameters value -
commit
blocking
transaction
wsrm
I tried different way .. but no solution .. Plz suggest if someone have any idea.....Its very helpfull....your problem:
Missing class: oracle.tip.adapter.jms.JmsManagedConnectionFactory
Dependent class: oracle.tip.adapter.fw.wsdl.WSDLUtils
Loader: oracle.bpel.common:10.1.3
Code-Source: /oraclesoa/oraclesoa/product/10.1.3.1/OracleAS_1/bpel/lib/orabpel.jar
Configuration: <code-source> in /oraclesoa/oraclesoa/product/10.1.3.1/OracleAS_1/j2ee/home/config/server.xml
It happens when server is custom installed, try to reinstall it as full version and problem should disappear otherwise your need another full installation to retrieve and replace orabpel.jar file from (or maybe more) -
Receiving the internal 500 error while testing java web service
HI,
Problem Summary:
Receiving the internal 500 error while testing java web service in integrated weblogic server.
my scenario is like,
retrieve the Payload from Dehydration tables.
We are connected to SOA_INFRA schema and we are retrieving the payload from the dehyadration tables based on InstanceId and ECID using Java Classes.After that i make it as a web service and i deployed in to intergrated weblogic Server.It is generating the Target End Point URI.When am i hitting this it is showing structure of the service.I am testing this service from soapUi it is returning the Server internal error with 500.Here i am passing inputs as InstanceId and ECID.
I had verified in my Jdeveloper,Proxy settings are available.
Error Payload:
I am receiving the Internal 500 error because of JDeveloper HTTP Analyzer encountered an error retrieving: CONNECT https://192.168.0.41:9102 HTTP/1.0.
An exception occurred while retrieving the response for https://192.168.0.41:9102.
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.checkEOF(SSLSocketImpl.java:1293)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:65)
at com.sun.net.ssl.internal.ssl.AppInputStream.read(AppInputStream.java:50)
at oracle.jdevimpl.webservices.tcpmonitor.model.HttpMessageBase.readLine(HttpMessageBase.java:658)
at oracle.jdevimpl.webservices.tcpmonitor.model.HttpRequest.read(HttpRequest.java:327)
at oracle.jdevimpl.webservices.tcpmonitor.ConnectionHandler.getResponse(ConnectionHandler.java:405)
at oracle.jdevimpl.webservices.tcpmonitor.ConnectionHandler.run(ConnectionHandler.java:331)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1165)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.getSession(SSLSocketImpl.java:1916)
at oracle.jdevimpl.webservices.tcpmonitor.ConnectionHandler.negotiateSSL(ConnectionHandler.java:707)
at oracle.jdevimpl.webservices.tcpmonitor.ConnectionHandler.negotiateForwardedSSLConnection(ConnectionHandler.java:672)
at oracle.jdevimpl.webservices.tcpmonitor.ConnectionHandler.run(ConnectionHandler.java:311An exception occurred while retrieving the response for https://192.168.0.41:9102.
javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?This error says that port 9102 is a plain HTTP port so either use the correct port (which is listening for HTTPS connections) or use HTTP instead of HTTPS in the URL.
Regards,
Anuj -
Error During Activation of Web services
When I try to create a web services using RFC and try to complete the steps in the wizard. I am getting error message as "Error during Activation of web services". and also when configure service in wizard, im getting only two profiles as "Basic Authorization: SOAP PROFILE" and "Secure SOAP PROFILE". Kindly do the needful.
Moderator message: please do more research before asking, show what you have done yourself when asking.
Edited by: Thomas Zloch on Aug 8, 2011 1:33 PMOlivier, thank you so much
SOAMANAGER does not exist in my system (sp level 8), so node "/sap/bc/soap/rfc" should be active. Actually, it is active.
I think the problem is related to user rights/profiles.
I have tried to create another WS after assigning role SAP_BC_WEBSERVICE_ADMIN. The same error when trying to activate it, but now, I can see this WS in SE80 (under "Enterprise Services->Service Definition"). It is not active there and if I try to activate it, a success message appears indicating that user "is not authorized to use function netzwerkadministration". I cannot see any new services in SICF...
Probably the new entry in SICF will be created after activating WS in SE80...
Do u know what user profile should I add in order to properly activate the WS in SE80?
Thank you very much!
Vicente -
Error: Error #2170 Connection Type: Web Service
Hi all,
In BO I have changed the external address on DNS say abc.com
Now when I try to access the dashboard internally it gives the error trying to access xyz.com which was previous external ip.
The error I get is
To access external data, add a cross-domain policy file to the external data web server.
For more information, on the Adobe website, see the article "Cross-domain Policy File Specification".
If the problem persists, contact the file creator or your system administrator.
Error: Error #2170
Connection Type: Web Service
File URL: http://abc.com...
External Data URL: http://xyz.com...."May be in connections, you have hardcoded the server as xyz.com. It is always advisable to use relative url so that the servername and port is resolved in runtime.
Also, check in CMC > Applications > Web Service > Properties what is the server name specified ? Is it still the old one ? -
Errors when compiling the web service (SAP Web Service Design Tool)
After downloading and installing the SAP de Web Service Design Tool (for Crystal Reports Server) I created a connection, a simple query and was able to deploy a web services. I tested the web service with an Xcelsius dashboard within InfoView. Thereafter I created a second connection (other name but same ODBC connection / server) and created another simple query with two date(range) parameters and a group by year and month function in order to do a select count(). It executes fine, but when I try to publish the web service I get an error.
There are errors when compiling the web service.
Is does not say whatu2019s wrong or how I can solve this problem.
Who can help me?
Some notes:
1) Within expert mode I used a MONTH() SQL function which does not show in the normal mode.
2) It seams that the u2018administrationu2019 of Web Service Design Tool got u2018corruptedu2019 after only creating the two connections, queries and services mentioned above. I believe so because I could select one of two queries when I created the second service, but within the current connection I had only one query.
Thanks for any help,
Ron
ADDITIONAL INFO: The parameters seam to be the problem. After removing the parameters I can publish the service. But without parameters it is NO SOLOTION.
Edited by: RonKoudijs on Aug 26, 2010 6:28 PMHello Taylan,
I think the error that you received was due to packaging issues.I placed the
UtilClass.java file under a directory called data which was present under
the project directory.
When you want to access a java class, you can either place the compiled
class file in the WEB-INF/classes folder or you can place the java file
under the project directory.
I have attached the sample project that I created with your files.
Let me know if you have any other questions.
Thanks
Raj Alagumalai
WebLogic Workshop Support
"taylan" <[email protected]> wrote in message
news:3d6351b0$[email protected]..
>
I am trying to write a simpe web service in WebLogic Workshop, but havingan error
which I could not understand. Could you please help me? Thanks in advance.
Regards,
Taylan
My web service code is like belows:
import weblogic.jws.control.JwsContext;
import data.*;
public class WebService1
/** @jws:context */
JwsContext context;
* @jws:operation
public UtilClass testType(UtilClass tTest){
UtilClass returnObj=new UtilClass();
if(tTest.getName()!= null){
returnObj.setName(tTest.getName());
return returnObj;
and my UtilClass is placed in the data directory under the same directorywith
my web service code. It is a simpe class as belows:
package data;
public class UtilClass
private String name;
public void setName(String name){
this.name=name;
public String getName(){
return name;
However I got an error when I try to compile the webservice class. Theerror is
like belows:
File Line Message
WebService1.jws 0 Resource found on system classpath: data.UtilClass
Build complete - 1 error(s), 0 warning(s)
[ngroup.zip] -
I get an web service error when trying enable web services. I have latest update and rebooted
i get an web service error when trying enable web services. I have latest update and rebooted
hi there philnj,
could you help the community narrow troubleshooting by providing a little more information? Particularly what model printer are we dealing with?
You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too. -
Handling sessions in Web Services
Hi all,
I am quite new to Web Services. I am facing problems in handling sessions in Web Services.
I am using Apache Axis as SOAP engine. I have different Web Services like AuthenticationService, DataService and ReportService.
The problem is in handling authentication. I need to authenticate only once using AuthenticationService and maintain the
session for rest of the calls to different web services like DataService, ReportService.
Has anyone faced similar situation?
Please help.
Thanks,
Prashantha bit unspecific, anyway, here a solution for a plain JAX-RPC implementation
in a JAX-RPC client, use
((javax.xml.rpc.Stub)myProxy)._setProperty(javax.xml.rpc.Stub.SESSION_MAINTAIN_PROPERTY, Boolean.TRUE);
to let the client maintain session state
in JAX-RPC server, implement ServiceLifecycle and call getHttpSession() on the servlet endpoint context
Merten -
Error when querying REST web services from web-based InfoPath form 2013 environment
Error when querying REST web services from web-based InfoPath form 2013 environment, we are trying to consume REST web service in InfoPath form ( SharePoint 2013 version)
http://spapp/sites/litigation/Intake/_api/web/lists/getbytitle('Email%20Profiles')/items(1)
it works in preview but does not when it is published. because of claim based authentication i m getting below error
The form cannot run specified query, the underlying connection was closed. An expected error occurred
same works in 2010 environment .. are we missing anything in 2013 servers?? please let me know how we can resolve it.. thank you
gurueveryone face this issue, nothing in event viewer, its easy to reproduce error at ur end also..
just you need to use below web service in infopath and populate some data on form load like id = 1 pull the title and try to set in form any field...the
list has one item thats all
guru -
Error deploying custom java web service -Jdeveloper11.1.1.3.0
Hi all,
Error deploying custom java web service in - Jdeveloper 11.1.1.3.0
Weblogic Server Exception: weblogic.deploy.api.internal.utils.DeployerHelperException: The source 'C:\DOCUME~1\.......\LOCALS~1\Temp\.xyz..........Project-context-root.war'
for the application 'xyz....Project-context-root' could not be loaded to the server 'http://hostname:port/bea_wls_deployment_internal/DeploymentService'.
Server returned HTTP response code: 409 for URL: http://hostname:port/bea_wls_deployment_internal/DeploymentService
See server logs or server console for more details.
weblogic.deploy.api.spi.exceptions.ServerConnectionException: [J2EE Deployment SPI:260041]Unable to upload 'C:\JDeveloper\mywork\MyApllicationName\Project\deploy\xyz........Project-context-root.war' to 't3://hostname:port'
#### Deployment incomplete. ####
Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
Thanks
Edited by: soauser on Sep 3, 2010 8:55 AMAny help for the above post is appreciated..
Edited by: soauser on Sep 3, 2010 11:58 PM -
Error deploying custom java web service in SOA11g-Jdeveloper 11.1.1.3.0
Hi all,
I am getting Error deploying custom java web service in SOA 11G- Jdeveloper 11.1.1.3.0
Weblogic Server Exception: weblogic.deploy.api.internal.utils.DeployerHelperException: The source 'C:\DOCUME~1\.......\LOCALS~1\Temp\.xyz..........Project-context-root.war'
for the application 'xyz....Project-context-root' could not be loaded to the server 'http://hostname:port/bea_wls_deployment_internal/DeploymentService'.
Server returned HTTP response code: 409 for URL: http://hostname:port/bea_wls_deployment_internal/DeploymentService
See server logs or server console for more details.
weblogic.deploy.api.spi.exceptions.ServerConnectionException: [J2EE Deployment SPI:260041]Unable to upload 'C:\JDeveloper\mywork\MyApllicationName\Project\deploy\xyz........Project-context-root.war' to 't3://hostname:port'
#### Deployment incomplete. ####
Remote deployment failed (oracle.jdevimpl.deploy.common.Jsr88RemoteDeployer)
Edited by: soauser on Sep 3, 2010 7:44 AM
Edited by: soauser on Sep 3, 2010 7:45 AM
Edited by: soauser on Sep 3, 2010 7:46 AMAny help for the above post is appreciated..
Edited by: soauser on Sep 3, 2010 11:58 PM -
Unexpected element name: expected error while invoking external web service
Hi,
In JDeveloper when I invoke external web service call, I am getting following exception
"unexpected element name: expected=..."
But the same application works fine in .NET. Can someone help me as to why I am getting the exception only in JDeveloper and how to fix this exception.
Thanks.Hi,
Without more information, it will be hard to help, and tell you what could be teh issue.
Usually, this kind of error occurs when the payload and the WSDL schema are out of sync, for example if the order of the element on the wire do not match the order in a sequence declaration, you may get this error.
In such case, .NET handle the XML as if it was a 'all' -- no specific order -- and deserialize the message properly.
Hope this helps,
-eric
Maybe you are looking for
-
PC with 2 two accounts and home sharing is not working in itunes
I have a PC with two user's accounts and we both have individual iTunes libraries and accounts. We have home sharing turned on both nothing is showing up in the new iTunes--any ideas why?
-
My Phone has data that I deleted how do i get the space back?
I deleted all of the photos on my phone permanently yesterday, but after looking at how much usage i have left on my phone's space I still see that it has the deleted photos taking up false space. I checked to see if any photos where on my phone but
-
HT5467 Why is my default camera app not appearing in the location list?
Any photo taken by the native camera app in ios6 (after a restore from ios5.1 to ios6) no longer includes gpsinfo. The default camera never asked for permission, nor is it found in the location data list under privacy settings. Even resetting the pri
-
TS1702 ibooks ridiculously slow since upgrading to OS6
since i upgraded to os6 on my ipad3 16gb, ibooks is so slow. it doesnt even open up some/most pdfs any more. I've got loads of books in there. Its gonna be a ball ache having to delete the app and then adding all the pdfs again. any help please
-
I have the latest Creative Cloud versions of Lightroom and Lightroom Mobile on my Ipad. On my desktop I have created a collection which I have put in a custom order. On my Ipad I go into that collection and set the order to custom order, which I pres