Current position:  Home > Default > Unable to capture return values in web services api

Unable to capture return values in web services api

Time:October 11
Advertisement
At the time of login to web services if my server is down ,
it returns following error :
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(String.java:1438)
        at java.lang.String.substring(String.java:1411)
I want to capture this error so that i can try another server to login. how do i capture this error
Another place where i want to capture the return Value is when i look for a report on the server
rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
                           "@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
oInfoObjects = rh.getInfoObjects();
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
Here if the report is not there on the server , it returns a null handler exception.
but if i try catching it by checking my responsehandler is null  like rh == null  it does not catch it.
Any help will be appreciated
thanks
Rakesh Gupta
Advertisement
Ted : i have two cases
1)   server = server_st.nextToken();
    providerURL = "http://"server"/dswsbobje/services";
    sessConnURL = new URL(providerURL + "/session");
   Connection boConnection = new Connection(sessConnURL);
   Session boSession = new Session(boConnection);
  EnterpriseCredential boEnterpriseCredential = new    EnterpriseCredential();
              boEnterpriseCredential.setLogin(userid);
  boEnterpriseCredential.setPassword(pwd);
  boEnterpriseCredential.setAuthType(auth);
SessionInfo boSI = boSession.login(boEnterpriseCredential);
I have got a list of servers running web servcies stored in my tokens. when i pass the first server name say " test:8080" and that server is down , i want to catch somewhere in the code above that it did not get the connection so that i can loop back and try with the second server say test1:8080
This is for failover purposes.
at present when i was trying to capture return value of boSI it  breaks giving the error
java.lang.StringIndexOutOfBoundsException: String index out of range: -1
at java.lang.String.substring(String.java:1438)
at java.lang.String.substring(String.java:1411)
2nd case :
I am geeting reports from the server and scheduling them:
i run the following code which works fine if reports is there
rh = boBIPlatform.get("path://InfoObjects/Root Folder/"src_folder"/" + reportName +
"@SI_SCHEDULEINFO,SI_PROCESSINFO" ,oGetOptions);
oInfoObjects = rh.getInfoObjects();
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
Here if  the  report  is not there on the server  then i should be able to catch from the response handle rh that it has got a null value.
but rh does not return a null value 
the code ultimately throws a null handle at the following line
CrystalReport = (CrystalReport)oInfoObjects.getInfoObject(0);
i am not able to catch the null value there also.
hope you got my issue.

Facing problem while going to  catch return result from web-services.

2015-10-11

Hi everybody, I am new to BPEL. I am facing problem while going to catch the attributes of resultsets returning from web-services(QAS). As far as my knowledge, two types of results it should return - XML entities and another is attributes which is co

What are the different messages that OCOD may return for a web service requ

2015-10-11

Hi, Please give me feedback on the questions below, concerning the limitations of web service, and messages which may return. 1) What are the different messages that OCOD may return for a web service request? I need all the messages of all the scenar

Unable to access calendar, because the web service is configured incorrectly

-0001-11-30

When attempting to access my web based calender I recieve the following error, "Unable to access calendar, because the web service is configured incorrectly." I have both the web service and iCal server configured to use SSL. Thanks for any help

Web Services API Sample w/ Filters

2015-10-11

Does anyone know how to use a Filter in a doOracleSearch call using the Java proxies supplied for the Web Services API? I tried doing this but it appears there is a conflict with Servlet Filter class. When I used the complete path to the class, it co

Web Service API v.3 overview

-0001-11-30

Post Author: yura.tkachenko CA Forum: Nsite There are a lot of calls available in Web Service API v.3, here is list of functions: login (create WS API session which is valid 15,30,60 minutes - actually depends of company settings). Return back to use

What's New in Nsite Web Service API v.4?

-0001-11-30

Post Author: yura.tkachenko CA Forum: Nsite With Nov '07 Release you will be able to start use Nsite Web Service API v.4. This release contains numerous bug fixes and performance improvements. This new API is improved stability for different operatio

Web Service API sample code

-0001-11-30

Howdy All, I am trying to work through the iTunes U Admin's guide directions on how to upload content using the Web Service API. I have completed everything through step 2, (I believe it is page 48 in the current guide), Request an Upload URL from iT

Adding transaction layer to Web service API

-0001-11-30

Our company, an ISP, recently invested in the BroadHop Enterprise Service Manager platform. The platform enables us to provision Internet services via the Web. We were able to write, largely from scratch, a "registration process" by which our us

Using WebCenter Spaces Web Service API through JDeveloper's Data Control

2015-10-11

Hi, I'm trying to access WebCenter Spaces Web Service API (located at http://host:port/webcenter/SpacesWebService) using JDeveloper's Web Center Data Control. I created a data control in my portal project using JDeveloper's Web Service Data Control w

Process for adding a boolean option to the web service API

2015-10-11

Hey guys, Here's a little background: I'm currently working on adding an optional "strict" mode to some of the unmarshalling functions in SchemaMarshaller that will throw exceptions when receiving bad data for certain fields, and also improving

Create Workspace(Library) in domain by OCS Web Service API

-0001-11-30

Hi, I am currently using the OCS Web Service API to create a Workspace(Library) in domain level. Here is the code I used:           DomainManager dm = wsCon.getDomainManager();           WorkspaceManager wm = wsCon.getWorkspaceManager();           It

Right content.jar for web service API?

-0001-11-30

I have a java application that interacts with Content Services via the Content Services Web Services API. I wish to update the content-ws-client.jar file my app uses, since we have undergone several upgrades since I set my app up. When I search my ne

Get started with web service API

-0001-11-30

I have a test installation and I can run the web service calls using the URL https://myserver.com/sgd/admin/apitest/. I can authenticate and start a session and open an application using this apitest fixture. I can't find any documentation about usin

Implement the web-service API on an external service desk

-0001-11-30

Hi, I want to implement the web-service API on an external service desk system. I am working with the IMG and got to the point where I define a logical port. At this point I need the web-service to be implemented on the external system. I have web-se

Have the web service API URLs changed?

-0001-11-30

I'm currently in the beginning stages of working with the iTunes U Web Service API, and I'm running into an issue. Step 2 of uploading a web services document (pg 50 of the admin guide) says to request an upload URL. The base URL for this request: ht

Web Service API for KVM

-0001-11-30

Dou you know if KWm supports Web Services clients? Thanks[becatelvent], Dou you know if KWm supports Web Services clients? ThanksThere is a JSR (JSR-172) with an expert group working to define the web services APIs for J2ME. Sun is the spec lead for

Capture Request IP in Web Service

-0001-11-30

Hi, Please let me know if we can able to capture the request IP inside web methods? I am aware we can able to do this in Servlet request using HttpServletRequest.getRemoteAddr() Is there is something similar to this in web service? Thanks for your ti

Unable to expose a method in web service

2015-10-11

Hi, My scenario is to expose a method in service. This method will take date as input & should return all the rows. To Implement this, I took employeeVO of HR DB(Employees Table) & created a ViewCriteria "GetEmpbyHireDate" with Hiredate

Return values from Web services

2015-10-11

I want to return an array of objects that contain only the allowed Java Types. Is it possible to return an array of objects as xml for example from a WL web service? Thanks, Georgehttp://www.w3.org/TR/SOAP/ See 5.4.2. Peace, Cameron Purdy Tangosol In