Response to the caller in OSB
Hi ,
I have a requirement that the response has to be passed to the requestor upon insertion of the request into a JMS queue.I have defined both the schemas and I am able to insert into the JMS queue.But I am not able to send the response back to the requestor upon insertion.Is there any way that we can achieve this with the route node in the proxy service?
Cheers
Sridhar
Edited by: asbharadwaj on Jan 6, 2011 1:20 AM
If you want to expose a WSDL based web-service then follow below steps -
1. Create a WSDL using JDev/OEPE
2. Upload it in OSB configuration
3. Create a WSDL based proxy service
4. In message flow of proxy service, use Replace action to replace the content of $body with desired response XML
5. Test it using OSB test console
You may refer developer guide for implementation -
http://download.oracle.com/docs/cd/E14571_01/doc.1111/e15866/toc.htm
Regards,
Anuj
Similar Messages
-
Https in Httpservice doesn't return response to the caller.
Hi,
I am accessing my aplication through https and i am using http service to get the data from my application server.
Actually the httpservice request is going to the server and repsonse is writen to the caller. But the response is not returning to the flex end..
I have added the below line in my client end.
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
response.setHeader("Pragma","no-cache"); //HTTP 1.0
response.setDateHeader("Expires", 0); //prevents caching at the proxy server
and i am accessing the server from the same domain , so i don't need to load security policy file also.
But my flex end is not getting reponse from the Application server .But the same thing is working while accessing from HTTP
Regards,
ThiruAre you getting an error? Have you added a listener for the error event of the httpservice call? If the reply is sent out of the server, it should get back to flex so either a result or an error should be available.
I use https for all my httpservice calls, so there is nothing 'wrong' with the httpservice using https. All the problems I have had with https have been getting the call to go to the server (didn't like the certificate, wrong domain, etc).
One of the great debugging tools for any httpservice call is to just enter the call url (and any name/value pairs) into the browser address bar, and see if it works there. If it doesn't work in the browser, it won't work in flex, since flex/flash depends on the underlying browser to make/handle the http/https calls to the server.
Mark -
I am have problems with the ipad mini, it is a little crazy. It controls by itself, opens and closes application zooms in and out, end my facetime calls, Also Un certain part of the screen is no longer responsive to the touch, it Should be having so much problems. Thanks for your help.
iPad, iOS 7.0.4Try reset iPad
Hold down the Sleep/Wake button and the Home button at the same time for at least ten seconds, until the Apple logo appears
Note: Data will not be affected. -
I want to send a response from the servlet and then call another servlet.
Hi,
I want to send a response from the servlet and then call another servlet. can this happen. Here is my scenario.
1. Capture all the information from a form including an Email address and submit it to a servlet.
2. Now send a message to the browser that the request will be processed and mailed.
3. Now execute the request and give a mail to the mentioned Email.
Can this be done in any way even by calling another servlet from within a servlet or any other way.
Can any one Please help me out.
Thanks,
RameshMaybe that will help you (This is registration sample):
1.You have Registration.html;
2.You have Registration servlet;
3.You have CheckUser servlet;
4.And last you have Dispatcher between all.
See the code:
Registration.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Hello registration</TITLE>
</HEAD>
<BODY>
<H1>Entry</H1>
<FORM ACTION="helloservlet" METHOD="POST">
<LEFT>
User: <INPUT TYPE="TEXT" NAME="login" SIZE=10><BR>
Password: <INPUT TYPE="PASSWORD" NAME="password" SIZE=10><BR>
<P>
<TABLE CELLSPACING=1>
<TR>
<TH><SMALL>
<INPUT TYPE="SUBMIT" NAME="logon" VALUE="Entry">
</SMALL>
<TH><SMALL>
<INPUT TYPE="SUBMIT" NAME="registration" VALUE="Registration">
</SMALL>
</TABLE>
</LEFT>
</FORM>
<BR>
</BODY>
</HTML>
Dispatcher.java
package mybeans;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletException;
import java.io.IOException;
import javax.servlet.RequestDispatcher;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Dispatcher extends HttpServlet {
protected void forward(String address, HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
RequestDispatcher dispatcher = getServletContext().
getRequestDispatcher(address);
dispatcher.forward(request, response);
Registration.java
package mybeans;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Registration extends Dispatcher {
public String getServletInfo() {
return "Registration servlet";
public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
ServletContext ctx = getServletContext();
if(request.getParameter("logon") != null) {
this.forward("/CheckUser", request, response);
else if (request.getParameter("registration") != null) {
this.forward("/registration.html", request, response);
CheckUser.java
package mybeans;
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import java.sql.*;
public class CheckUser extends Dispatcher {
Connection conn;
Statement stat;
ResultSet rs;
String cur_UserName;
public static String cur_UserSurname;;
String cur_UserOtchestvo;
public String getServletInfo() {
return "Registration servlet";
public void service(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try{
ServletContext ctx = getServletContext();
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection("jdbc:oracle:oci:@eugenz","SYSTEM", "manager");
stat = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
String queryDB = "SELECT ID, Login, Password FROM TLogon WHERE Login = ? AND Password = ?";
PreparedStatement ps = conn.prepareStatement(queryDB);
User user = new User();
user.setLogin(request.getParameter("login"));
String cur_Login = user.getLogin();
ps.setString(1, cur_Login);
user.setPassword(request.getParameter("password"));
String cur_Password = user.getPassword();
ps.setString(2, cur_Password);
Password = admin");
rs = ps.executeQuery();
String sn = "Zatoka";
String n = "Eugen";
String queryPeople = "SELECT ID, Surname FROM People WHERE ID = ?";
PreparedStatement psPeople = conn.prepareStatement(queryPeople);
if(rs.next()) {
int logonID = rs.getInt("ID");
psPeople.setInt(1, logonID);
rs = psPeople.executeQuery();
rs.next();
user.setSurname(rs.getString("Surname"));
FROM TLogon, People WHERE TLogon.ID = People.ID";
ctx.setAttribute("user", user);
this.forward("/successLogin.jsp", request, response);
this.forward("/registration.html", request, response);
catch(Exception exception) {
}CheckUser.java maybe incorrect, but it's not serious, because see the principe (conception).
Main is Dispatcher.java. This class is dispatcher between all servlets. -
Delay in the Response Group Rining / Call Pickup from another Extension
Dear All,
We have just finished a deployment of Lync 2013 with Sonus 1000 as the Mediation Gateway, we have deloyed polycom VVX 600 phones,
We have two lines E1 and 5 Fxo lines (with same Pilot Number)
I would like the Receptionist to have both E1 DID number and FXO number and her phone to ring when the calls comes from DID line as well as FXO,
I have the below scenario
1) Currently the setup is that Receptionist is configured with the E.164 DID number : (Line URI is Tel:+971XXXX500;ext=500), which work perfectly fine
2) We have added receptionist in Response Group , and setting are (Formal,10 sec , Attendant)
The issue :
1) Call forwarding does not work on Response Group (which is by design it self)
2) When a call comes from the outside to FXO it goes to response group , (there is Music played and the ring on reception is delayed by 2-3 secs) ,
Customer does not want this delay , it should ring immediately with no music,
3) If the receptionist moves from one location to any other location to another , she should have the ability to remotely perform call forward to that extension by simply dialing few codes on the phone ( I already told customer
about PIN based authentication, by customer does like the idea of signing in or signing out)
In DIRE NEED OF HELP,
Regards,
Hasan Reza,Hi,
Did the issue only happen for IP Phone in Response Group or also happen for Lync client in Response Group?
If the issue only happen for IP Phone, it seems to be an known issue. Please Make sure Lync Server update to the latest version and then test again.
Here are several similar case may help you:
https://social.technet.microsoft.com/Forums/lync/en-US/196375a5-3ae9-4452-acbe-2679a8deef80/delay-when-response-group-calls-are-answered
https://social.technet.microsoft.com/Forums/lync/en-US/70306bf5-fcd3-488a-b6f4-2eee1bcc0457/lync-2010-ip-phone-calls-and-response-group-delays
Best Regards,
Eason Huang
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact [email protected]
Eason Huang
TechNet Community Support -
Hey,
I get this error message when calling into an unassigned number which redirects to a response group:
From user URI:
sip:[email protected];gruu;opaque=srvr:Microsoft.Rtc.Applications.Acd:RS6nRGV9DlmpNsLtmz5qeQAA
To user URI:
0220198611;phone-context=DefaultProfile
From user agent:
RTCC/4.0.0.0 Response_Group_Service Announcement_Service
Diagnostic header:
26005; reason="The Response Group application was unable to transfer the call to the configured destination and no fallback exists."
Interestingly "To user URI: 0220198611;phone-context=DefaultProfile" is the number off the caller not the destination. I wonder is this a bug? So is the response group trying to transfer to this number and failing because of course it doesnt exist?
As you can see the below the number I am calling is not 0220198611:
From phone number: 0220198611;phone-context=DefaultProfile
To phone number: +6493760053 From mediation server: onzlyncfe1.domain.co.nz To mediation server: From gateway: 192.168.100.70
To gateway:
Disconnected by: +6493760053
Does the calling party's number have to be normalised? If so how can I do this because the global normailisation rules dont seem to apply
in this situation. These rules do work when when calling into a users DDI.
Also to be clear....
+6493760053 is an unassigned number which is setup to redirect to a response group.
If I assign +6493760053 to a user then it works.
Additionally this works perfectly when the gateway sends the call to our legacy 2007r2 mediation server then on to Lync. If the gateway sends the call directly to the co-located Lync mediation server I get the error described.
I hope I make sense. If you are confused let me know :)
Help is appreciated.
Thanks,
AndrewHi ANdrew
Kindly advise how you transfered the unassigned numbers to a specific user, i used the below command but it failled, the message displayed but the call never routed:
New-CsAnnouncement -Parent service:ApplicationServer:LyncFE.squareone.local -Name "SQ unassigned number announcement" -TextToSpeechPrompt "You entered an invalid extinsion you will be forwarded to the operator" -Language "en-US" -TargetUri "sip:[email protected];user=phone"
While [email protected] is the sip uri in my lync for the operator
could you advise what is my issue? -
If I block a number . What response does that party get if they call or text my number?
The call/message simply won't go through. If iMessage, it will show as delivered, but it actually won't be delivered.
Here's what it sounds like on their end, for calls:
http://www.wired.com/images_blogs/gadgetlab/2013/09/blocked_ios7.mp3 -
Hi Experts,
I just followed the below url to invoke osb from bpel(11g).
[http://biemond.blogspot.com/2009/03/calling-osb-services-from-bpel.html]
1. For the 1st step I confused, To get a wsdl,I created one bpel process which is just taking the request and doing nothing and send back the response.
2. Now I use this wsdl(step1,bpel process wsdl) to create the proxy servcie on osb.
Then I follow the next steps.However while I test my original bpel servcie(which is calling the proxy wsdl),its displaying me the response of the o/p of the bpel servcie(which I created for proxy).Its not invoking the OSB.
Please help urgently.
-AswiniDid you resolved the problem?
-
I am sorry if this seems like a basic question but I am new to OSB and middleware.
I have a Java class that transforms a CSV to XML that I need to call from OSB.
OSB needs to pick up the csv file from a folder, pass the file name into the java class, then notify another process that the xmls have been created.
Something like that.
Any help would be appreciated.Create a Proxy Service like this:
Service Type Messaging Service
Request Message Type
Text
Response Message Type
None
Protocol file
Endpoint URI file:///c:/temp
Get All Headers No Headers
File Mask *.txt
Polling Interval 60
Read Limit 10
Sort By Arrival false
Scan SubDirectories false
Pass By Reference false
Post Read Action delete
Stage Directory file:///temp/stage
Error Directory file:///temp/error
Request encoding utf-8
Message Handling Configuration
Transaction Required Disabled
Same Transaction For Response Disabled
Content Streaming Disabled
(they are almost all default values)
When you log $body, you will see that it contains your file.
Just pass $body/* to a Java callout and do your transformation to XML.
MFL is an optional, but since you want to reuse your Java code, just do the Java Callout.
I am sure that if you google (or search on youtube) for
OSB java Callout
you will find plenty of tutorials.
Just define a Java static method
public static void processFileContent(String fileContent)
If you need to return your XML to OSB for further processing, you should return XmlObject rather than void.
I can teach you how to transform a XML String into a XmlObject -
Hi,
Our requirement is when the front end calls the proxy service, the proxy service should call the back end web service and give the response to front end service, This can be achieved.
But the other requirement is in case if the back end service is down .. we need to keep on retrying till the back end is UP and then send the response back to front end(Or we can send the response when the front end calls again) . But the front end will not wait for the response. Front end will fire and forget. its proxy service responsibility to keep on trying for the back end service to be up and store/send the response to front end.
Can we achieve this in OSB 11g? Or we need to go for BEPL.
Please post the steps to achive this.As already being stated by @vladodias, OSB is better fit for stateless designs. If you need to keep the response until a later poll comes, you may be better off with BPEL.
But not necessary.
Consider this design:
1. Front end calls OSB.
2. OSB generates an unique token for the request and saves this request into an JMS queue. The token is stored into a header.
3. OSB returns the token to the caller. Caller saves it locally for future poll and closes the connection.
4. A JMS proxy transactionally reads the message from the queue (along with the token) and calls the backend service.
5. If the backend service is down, the transaction is rolled back, and the message is returned back to the queue for retry later (retry period is configured on the queue).
6. If the backend is up, the message is placed into a persistent storage using the token as a key. The storage is not JMS queue, because OSB proxies cannot programmatically read queues with filter, and also cannot read the queues on demand. So the store should be a database. (You cannot use disk as a store in a cluster unless the disk is also shared).
7. Front end calls OSB with the token.
8. OSB checks the persistent store and, if the response with the given token is found, sends it back to the the caller.
Now, you may notice that front-end always initiates the call, i.e. there is no callbacks. I do not like callbacks in OSB designs, makes a mess when you get more than one consumer. However, you may implement it, too -- i.e in step 6, instead of persisting the message, just do an outbound call to the front-end application.
Also, this design is always asynchronous. You may improve it by trying to do a synchronous call to backend first, and only if it is down, switch into asynchronous mode.
P.S. If you're not familiar with using JMS/transactions with OSB, read my post: Transactions in OSB. Reliable Messaging.
P.P.S. You can also use JMS queue as a persistent store for the responses, but then you'll have to use a Java callout that connects to the queue with a filter (by token) to extract the only message. -
Hi.
I think this is a pretty basic LV question, but I have not been able to find a good solution.
I am attaching VIs that show the problem I am having, but obviously, the real application is a lot complicated, which forces me to try to do it this way.
The issue is: I have a subVI with a Boolean control inside a loop. When the control is true I want some action to take place. When the subVI is run on its own, it works fine, acting properly when I set the boolean control to true via the LV FPGA interface from the host. However, when I use it as a subVI, in which the top-level VI calls several instances of the subVI, I have the Boolean controls in the top level VI. What is happening is that the false Boolean value with which the top-level VI starts is passed into the subVIs, and not updated, even though the control is inside the loop.
Can any one suggest a good solution?
Thanks,
AlejandroZ
Attachments:
CallingVI.vi 7 KB
subVI.vi 8 KBHi.
I know the example I posted might seem silly, but it was just to illustrate the problem I am having. In reality this is the application:
I have some LV FPGA code which uses a few FPGA IO to implement a serial link to communicate with a device. Most of the time we are getting data from the device, so the serial link is used to send a read command, read in the data and put it into a FIFO. However, I also wanted the VI to support sending data to the device, so I added an array control to put the data you want to send, and a boolean control to tell it you want to send it.
Since sending and receiving data are done using the same FPGA IO, they cannot be independent operations, because they would garble each other. Therefore, in the subVI I have a loop in which I first read data if there is any to read, then check the boolean write control to see if there is data to write.
As I mentioned, this works perfectly for talking to a single device. However, we run into the issue of this topic when trying to replicate this for several devices.
One easy solution is to not have the loop in the subVI, and have it in the calling VI (I am favoring this simple solution right now). The only reason why I have not done this yet, is that the subVI has more than one loop, so I am going to have to create several subVIs. I just posted to see if there was an even simpler solution...
There have been some other possibly good solutions proposed here, though I am not sure if they work in LV FPGA.
Thanks for all your responses.
AlejandroZ -
How can I pass Flex Field value to the Call Wrap Up screen?
Hello helpers,
I am trying to get a value from the 'Flex Field' passed over to the 'Call Wrap Up' screen by using Form Personalization.
Oracle was configured by a subcontractor and therefore I do not know what the exact name of the textfield is in the Flex Field however the label is 'Method of Contact'. When i set 'Show Custom Events' to 'On', I get the response: 'CSXXXRC.INCIDENT_TRACKING.STATUS_CODE:WHEN-NEW-ITEM-INSTANCE' When i enter a value in the Method of Contact field in the Flex Field.
Can anyone help?
I am a complete Newbie to Oracle.... I only know a bit about Oracle Form Personalization.
Any help would be much appreciated,
SSeems like you're talking about a from from the eBusiness-suite. There are special rules for that, ask your question in the eBusiness-suite-forum OA Framework
-
Filtering a region source based upon a value in the calling form
Hi,
I am calling a report form with the following SQL
select
"RESPONSE_ID",
"ASSIGNMENT_ID",
"QUESTION_ID",
"DATE_CREATED",
"GRADING_1_10",
"RESPONSE"
from "#OWNER#"."CR_QUESTION_RESPONSES"
where assignment_id = NVL(:P17_ASSIGNMENT_ID, assignment_id).
P17_ASSIGNMENT_ID is populated from the calling form, but it is not been recognised when the query is run.
Is there a way to pass values to a query dynamically?
Thanks.Hi,
Most likely :P17_ASSIGNMENT_ID is not set
To check the value of :P17_ASSIGNMENT_ID you can add it to the query:
select
:P17_ASSIGNMENT_ID val_check, -- <-- added to check value
"RESPONSE_ID",
"ASSIGNMENT_ID",
"QUESTION_ID",
"DATE_CREATED",
"GRADING_1_10",
"RESPONSE"
from "#OWNER#"."CR_QUESTION_RESPONSES"
where assignment_id = NVL(:P17_ASSIGNMENT_ID, assignment_id)Regards,
Lev
Edited by: le on Nov 29, 2010 11:32 AM -
Issue: Not getting response when the document is having special chars
Please help following issue: Not getting response when the document is having special chars(Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
Error message:
System.FormatException: Invalid length for a Base-64 char array. at
System.Convert.FromBase64String(String s) at
Summarize.Summarizer.AccumulateBroadcast(String filedata, String givenWords) in
c:\DocumentSummarizer\App_Code\Summarizer.cs:line 66
Code:
File 1:
import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.Properties;
import org.apache.poi.poifs.filesystem.POIFSFileSystem;
import org.apache.poi.hwpf.*;
import org.apache.poi.hwpf.extractor.*;
import com.lowagie.text.Document;
import com.lowagie.text.pdf.PRTokeniser;
import com.lowagie.text.pdf.PdfReader;
public class DocumentSummarizerClient {
static Properties loadProperties() {
Properties prop = new Properties();
try {
prop.load(DocumentSummarizerClient.class.getClassLoader().getResourceAsStream("vep.properties"));
} catch (Exception ioe) {
ioe.printStackTrace();
return prop;
public String getSummary(String fileName,String noOfWordsOrPercentage ){
String summaryInputData ="";
String summarizedData="";
String summarizerURL = loadProperties().getProperty("Summarizer.serviceURL");
try {
String fileExtension=fileName.substring(fileName.lastIndexOf(".")+1, fileName.length());
if (fileExtension.equalsIgnoreCase("doc")|| fileExtension.equalsIgnoreCase("txt")|| fileExtension.equalsIgnoreCase("pdf")) {
if (fileExtension.equalsIgnoreCase("txt")) {
BufferedReader bufferedReader = new BufferedReader(
new FileReader(fileName));
String line = null;
while ((line = bufferedReader.readLine()) != null) {
summaryInputData += line;
if(fileExtension.equalsIgnoreCase("doc")){
POIFSFileSystem fs = null;
fs = new POIFSFileSystem(new FileInputStream(fileName));
HWPFDocument doc = new HWPFDocument(fs);
WordExtractor we = new WordExtractor(doc);
String[] paragraphs = we.getParagraphText();
for( int i=0; i<paragraphs .length; i++ ) {
paragraphs[i] = paragraphs.replaceAll("\\cM?\r?\n","");
summaryInputData+= paragraphs[i];
if(fileExtension.equalsIgnoreCase("pdf")){
Document document = new Document();
document.open();
PdfReader reader = new PdfReader(fileName);
int pageCount =reader.getNumberOfPages();
for(int i=1;i<=pageCount;i++){
byte[] bytes = reader.getPageContent(i);
PRTokeniser tokenizer = new PRTokeniser(bytes);
StringBuffer buffer = new StringBuffer();
while (tokenizer.nextToken()) {
if (tokenizer.getTokenType() == PRTokeniser.TK_STRING) {
buffer.append(tokenizer.getStringValue());
summaryInputData += buffer.toString();
else{
System.out.println("This is Invalid document. Presntly we support only text,word and PDF documents ");
// String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
// encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
summarizedData= postRequest(parameters,summarizerURL);
String slength= "<string xmlns=\"http://tempuri.org/\">";
if(summarizedData.contains("</string>")){
summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
summarizedData = replaceVal(summarizedData);
//System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
// System.out.println("Summarized data "+summarizedData);
if(summarizedData.contains("Please enter the percentage")){
summarizedData="Data given cannot be summarized further";
else{
System.out.println("Data given cannot be summarized further");
summarizedData="";
} catch (FileNotFoundException e) {
return("The File is not found \n\n"+e.toString());
} catch (IOException e) {
return("The File is already in use \n\n"+e.toString());
} catch (Exception e) {
return(e.toString());
return summarizedData;
public static String postRequest(String parameters,String webServiceURL) throws Exception{
Properties systemSettings = System.getProperties();
systemSettings.put("http.proxyHost", loadProperties().getProperty("proxyHost"));
systemSettings.put("http.proxyPort", loadProperties().getProperty("proxyPort"));
System.setProperties(systemSettings);
String responseXML = "";
try {
URL url = new URL(webServiceURL);
URLConnection connection = url.openConnection();
HttpURLConnection httpConn = (HttpURLConnection) connection;
byte[] requestXML = parameters.getBytes();
httpConn.setRequestProperty("Content-Length", String
.valueOf(requestXML.length));
httpConn.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");
httpConn.setRequestMethod("POST");
httpConn.setDoOutput(true);
httpConn.setDoInput(true);
OutputStream out = httpConn.getOutputStream();
out.write(requestXML, 0, requestXML.length);
out.close();
InputStreamReader isr = new InputStreamReader(httpConn
.getInputStream());
BufferedReader br = new BufferedReader(isr);
String temp;
String tempResponse = "";
while ((temp = br.readLine()) != null)
tempResponse = tempResponse + temp;
responseXML = tempResponse;
br.close();
isr.close();
} catch (java.net.MalformedURLException e) {
System.out
.println("Error in postRequest(): Secure Service Required");
} catch (Exception e) {
System.out.println("Error in postRequest(): " + e.getMessage());
return responseXML;
public String replaceVal(String value) {
if (value == null) {
value = "";
value = value.replace("<", "<");
value = value.replace(">", ">");
value = value.replace("&", "&");
return value;
public static void main(String[] args) {
DocumentSummarizerClient testdoc=new DocumentSummarizerClient();
System.out.println("hello");
testdoc.getSummary("C:\\working_folder\\vep\\UnitTestCases\\VEP1.0\\DocumentSummarizerTestData\\TestErrorFour.doc","100%");
Note: Use any doc with special char(ex: &, $, <, >,.....) TestErrorFour.doc
File 2:
---------public class Base64Utils {
private static byte[] mBase64EncMap, mBase64DecMap;
* Class initializer. Initializes the Base64 alphabet (specified in RFC-2045).
static {
byte[] base64Map = {
(byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F',
(byte)'G', (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L',
(byte)'M', (byte)'N', (byte)'O', (byte)'P', (byte)'Q', (byte)'R',
(byte)'S', (byte)'T', (byte)'U', (byte)'V', (byte)'W', (byte)'X',
(byte)'Y', (byte)'Z',
(byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f',
(byte)'g', (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l',
(byte)'m', (byte)'n', (byte)'o', (byte)'p', (byte)'q', (byte)'r',
(byte)'s', (byte)'t', (byte)'u', (byte)'v', (byte)'w', (byte)'x',
(byte)'y', (byte)'z',
(byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5',
(byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'};
mBase64EncMap = base64Map;
mBase64DecMap = new byte[128];
for (int i=0; i<mBase64EncMap.length; i++)
mBase64DecMap[mBase64EncMap[i]] = (byte) i;
* This class isn't meant to be instantiated.
private Base64Utils() {
* Encodes the given byte[] using the Base64-encoding,
* as specified in RFC-2045 (Section 6.8).
* @param aData the data to be encoded
* @return the Base64-encoded <var>aData</var>
* @exception IllegalArgumentException if NULL or empty array is passed
public static String base64Encode(byte[] aData) {
if ((aData == null) || (aData.length == 0))
throw new IllegalArgumentException("Can not encode NULL or empty byte array.");
byte encodedBuf[] = new byte[((aData.length+2)/3)*4];
// 3-byte to 4-byte conversion
int srcIndex, destIndex;
for (srcIndex=0, destIndex=0; srcIndex < aData.length-2; srcIndex += 3) {
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
(aData[srcIndex] << 4) & 077];
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+2] >>> 6) & 003 |
(aData[srcIndex+1] << 2) & 077];
encodedBuf[destIndex++] = mBase64EncMap[aData[srcIndex+2] & 077];
// Convert the last 1 or 2 bytes
if (srcIndex < aData.length) {
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] >>> 2) & 077];
if (srcIndex < aData.length-1) {
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] >>> 4) & 017 |
(aData[srcIndex] << 4) & 077];
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex+1] << 2) & 077];
else {
encodedBuf[destIndex++] = mBase64EncMap[(aData[srcIndex] << 4) & 077];
// Add padding to the end of encoded data
while (destIndex < encodedBuf.length) {
encodedBuf[destIndex] = (byte) '=';
destIndex++;
String result = new String(encodedBuf);
return result;
* Decodes the given Base64-encoded data,
* as specified in RFC-2045 (Section 6.8).
* @param aData the Base64-encoded aData.
* @return the decoded <var>aData</var>.
* @exception IllegalArgumentException if NULL or empty data is passed
public static byte[] base64Decode(String aData) {
if ((aData == null) || (aData.length() == 0))
throw new IllegalArgumentException("Can not decode NULL or empty string.");
byte[] data = aData.getBytes();
// Skip padding from the end of encoded data
int tail = data.length;
while (data[tail-1] == '=')
tail--;
byte decodedBuf[] = new byte[tail - data.length/4];
// ASCII-printable to 0-63 conversion
for (int i = 0; i < data.length; i++)
data[i] = mBase64DecMap[data[i]];
// 4-byte to 3-byte conversion
int srcIndex, destIndex;
for (srcIndex = 0, destIndex=0; destIndex < decodedBuf.length-2;
srcIndex += 4, destIndex += 3) {
decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
((data[srcIndex+1] >>> 4) & 003) );
decodedBuf[destIndex+1] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
((data[srcIndex+2] >>> 2) & 017) );
decodedBuf[destIndex+2] = (byte) ( ((data[srcIndex+2] << 6) & 255) |
(data[srcIndex+3] & 077) );
// Handle last 1 or 2 bytes
if (destIndex < decodedBuf.length)
decodedBuf[destIndex] = (byte) ( ((data[srcIndex] << 2) & 255) |
((data[srcIndex+1] >>> 4) & 003) );
if (++destIndex < decodedBuf.length)
decodedBuf[destIndex] = (byte) ( ((data[srcIndex+1] << 4) & 255) |
((data[srcIndex+2] >>> 2) & 017) );
return decodedBuf;
issue 2: Exception when passing 2MB .txt file
Steps to reproduce:
Call getSummary() with 2MB .txt file
Actual:
The following exception has occured:
1. Error in postRequest(): Unexpected end of file from server
java.lang.NullPointerException
Please provide your precious feedback/suggestions.
Thanks in advance…..
Edited by: EJP on 15/03/2011 16:52: added code tags. Please use them. Code is unreadable otherwise.Thanks for your response….
This is enhancement project and some one develops long back.
Regarding point (b) You should be using the java.net.URLEncoder to encode URL parameters, not a base64 encoder.
DocumentSummarizerClient.java I am using base64
Ex:
// String encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
String encoded=Base64Utils.base64Encode(summaryInputData.getBytes());
// encoded =new String (summaryInputData.getBytes("ISO-8859-1"),"UTF-8");
String parameters= "base64String="+encoded+"&noOfWordsOrPercentage="+noOfWordsOrPercentage;
summarizedData= postRequest(parameters,summarizerURL);
String slength= "<string xmlns=\"http://tempuri.org/\">";
if(summarizedData.contains("</string>")){
summarizedData= summarizedData.substring(summarizedData.indexOf(slength)+slength.length(),summarizedData.indexOf("</string>"));
summarizedData = replaceVal(summarizedData);
//System.out.println("<?xml version=\"1.0\" encoding=\"utf-8\"?><![CDATA["+summarizedData+"]]>");
System.out.println("Summarized data "+summarizedData);
if(summarizedData.contains("Please enter the percentage")){
summarizedData="Data given cannot be summarized further";
Above specific please I need to modify to resolve above issue.
Could you please suggest me what changes I need to do.
Waiting for positive response. -
The following error occurs.
Welcome to the Exchange Management Shell!
Full list of cmdlets: Get-Command
Only Exchange cmdlets: Get-ExCommand
Cmdlets that match a specific string: Help *<string>*
Get general help: Help
Get help for a cmdlet: Help <cmdlet name> or <cmdlet name> -?
Show quick reference guide: QuickRef
Exchange team blog: Get-ExBlog
Show full output for a command: <command> | Format-List
Tip of the day #0:
Did you know that the Identity parameter is a "positional parameter"? That means you can use:
Get-Mailbox "user" instead of: Get-Mailbox -Identity "user"
It's a neat usability shortcut!
VERBOSE: Connecting to mail1.dorothy.local.
New-PSSession : [mail1.dorothy.local] Connecting to remote server mail1.dorothy.local failed with the following error
message : The WinRM client cannot process the request. It cannot determine the content type of the HTTP response from
the destination computer. The content type is absent or invalid. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI "$connectionUri" -ConfigurationName Microsoft.Excha ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed
Exception calling "GetComputerSite" with "0" argument(s): "The Specified directory object cannot be found."
At C:\Program Files\Microsoft\Exchange Server\V15\bin\ConnectFunctions.ps1:164 char:2
+ $localSite=[System.DirectoryServices.ActiveDirectory.ActiveDirectorySite]::GetC ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : ActiveDirectoryObjectNotFoundException
Failed to connect to an Exchange server in the current site.
Enter the server FQDN where you want to connect.: mail1.dorothy.local
VERBOSE: Connecting to mail1.dorothy.local.
New-PSSession : [mail1.dorothy.local] Connecting to remote server mail1.dorothy.local failed with the following error
message : The WinRM client cannot process the request. It cannot determine the content type of the HTTP response from
the destination computer. The content type is absent or invalid. For more information, see the
about_Remote_Troubleshooting Help topic.
At line:1 char:1
+ New-PSSession -ConnectionURI "$connectionUri" -ConfigurationName Microsoft.Excha ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : -2144108297,PSSessionOpenFailed
Randy CheekGood Morning,
Log into the server with an account that has appropriate Exchange rights, not a local account.
Note: By default - Domain Admins don't have Exchange rights.
Dame Luthas, ITILv3, MCSE Messaging 2013, MCSA, MCITP
My Technical Blog: http://thelifestrategist.wordpress.com
Discipline is the Difference between Goals and Accomplishments
If this post is useful, please hit the green arrow on the left & if this is the answer hit "mark as answer"
Maybe you are looking for
-
Using a NAS as Time Machine Backup
Hello Apple Communty! I just installed a new NAS system and everyting but time machine is working. I have been trying to create a sparse bundle to place on my drive so Time Machine Can find it. Main point- How can I back up my mac to a hard drive on
-
Tcp_local channel mails
Hi, we are using Messaging server7u3. # imsimta qm summarize tcp_local 63 0.4 Totals 63 0.4 there are mails with non-existent/misspelled domains in this channel when will be these messages deleted? is there a automatic way to do this(delete them) by
-
How to config nfs client in netware 6 SP5
Hello, I'm with some problems to find some information. It becomes difficult to find on a system already without support. I need to access an NFS from NetWare 6 SP5, and the truth can not find anything, so some links are broken. Anyone have any idea.
-
Itunes is not letting me add missing art work on a few albums, any ideas
-
Can't login. Stuck at "Logging in"
I looked through past posts for a solution but none of them seemed to be exactly what I needed. Recentley my emac started to freeze up when I tried to empty the trash. Soon after I was not able to login and I still cannot login. I tried booting off o