Objects communication (urgent)

Hie,
I'm making a project and i'd like to know how to do so that objects (in java) communicate between them independently of the user's intervention ?
Thanks
caroline

i'd like to know how some objects that have no relationship
between them can communicate by sending events to each other.... hmmm... I'm going to go out on limb here and say: THEY DON'T!
If they are sending events to each other then have a relationship via listeners.

Similar Messages

  • In ID object Communication Channel - Enter a value for Service Number?

    Hi,
    I have completed all the steps of this link upto 4.5 > 11,
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/40574601-ec97-2910-3cba-a0fdc10f4dce
    but when i activate my messge interfarence from senario tab list or change object tab list, <b>it is showing error that :
    Check Result for Object Communication Channel(GeneratedReceiverChannel_XI )  Enter a value for Service Number</b>
    address type: URL Adress
    target host: my bi server aibid
    Service Number: ?????????
    Path: /sap/xi/engine?type=entry
    What is the Service NO.
    Best Regards,
    Dushyant.

    Hi,
    >>>>The serice number is ur port number. In your XI system URL http://host:port/rep/start/index.jsp
    this is the j2ee port and he should put http port
    as his path is: /sap/xi/engine?type=entry
    on WAS ABAP I guess..
    Regards,
    michal

  • What ports need to be open on Fw for Waas Communication--Urgent

                       Hi All,
    This product is new to need your help in configuring this. I am explaining the architecture below:-
    We have a requirement to use WAVE-594-K9 Software Release 5.3.1 and in our Manila location and it will not talk to Waas central Manager in our client location instead client has installed one same model Wave-594 in PHX.
    So now client has said it will only be used for caching contents and not for optimizing, they have some video training on web which will be passed through this wave and for making them highly/fastly available to agents they want to use this.
    We have installed one Wave in Manila in application-accelerator mode and using PBR to redirect the desired traffic via Wave. As per our client Manila Wave will talk to PHX wave and PHX wave will get registered to Waas Manager in client network.
    We have firewall between PHX wave & Manila wave, please let me know do we need to opened tcp/udp ports on FW for opening the communication between these two waves?
    and what else i need to configure on Manila wave?
    This is very urgent quick reply will be highly appreciated!!
    Thanks!!
    Bhisham

    Thanks for the quick reply Kanwal!!
    I checked with my team in PHX and we have Juniper FW in between these two Wave's, so what i understand from the links which you have shared.
    In Manila Wave i need to configure that in Directed Mode and udp port 4050 needs to be opened bi-directionally on Juniper FW between IPs configured on wave devices.
    In Manila we have 10.111.x.189 (Virtual-Blade IP) & 10.111.x.190 IPs & in PHX we 63.149.23.x & 63.149.23.x (VB) so from both IPs we required to open udp 4050 bi-directionally? Want to be sure before raising any request :-)
    In PHX wave i am not sure whether we can configure that in directed mode and if it’s not then also it will work by opening port 4050 on FW Right?
    In last our client was saying that Manila Wave will only be used as cache engine (VB is configured as content-engine) and it will download contents from PHX Wave (which is registered to CM at client side), what does it mean and do i need to do any special config on wave to achieve this?
    I am very new to this device and lot of research on net confused me a lot, please don’t mind!!
    Will wait for your reply then only i will raise request with FWteam.
    Thanks,
    Bhisham

  • Servlet Applet object communication problem???!!!

    Hy folks,
    I need to validate the ability of complex Servlet Applet communication an run into my first pb right at the beginning of my tests. I need to have around 200 Applet clients connect to my servlet and communicate by ObjectInput and ObjectOutput streams. So I wrote a simple Servlet accepting HTTP POST connections that return a Java object. When the java Applet get instantiated, the Object Stream communication workes fine. But when the Applet tries to communicate with the servlet after that, I can not create another communication session with that Servlet, instead I get a 405 Method not allowed exception.
    Summarized:
    - Applet init() instantiate URLConnection with Servlet and request Java object (opening ObjectInput and Output Stream, after receaving object, cloasing streams).
    - When I press a "get More" button on my Applet, I am not able to instantiate a new URLConnection with my servler because of that 405 exception, WHY???
    Here my Servlet code:
    public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException{
             ObjectInputStream inputFromApplet = null;
             ArrayList transmitContent = null;       
             PrintWriter out = null;
             BufferedReader inTest = null;
             try{               
                   inputFromApplet = new ObjectInputStream(request.getInputStream());           
                     transmitContent = (ArrayList) inputFromApplet.readObject();       
                     inputFromApplet.close();
                     ArrayList toReturn = new ArrayList();                 
                     toReturn.add("One");
                     toReturn.add("Two");
                     toReturn.add("Three");
                     sendAnsweredList(response, toReturn);                 
             catch(Exception e){}        
         public void sendAnsweredList(HttpServletResponse response, ArrayList returnObject){
             ObjectOutputStream outputToApplet;    
              try{
                  outputToApplet = new ObjectOutputStream(response.getOutputStream());          
                  outputToApplet.writeObject(returnObject);
                  outputToApplet.flush();           
                  outputToApplet.close();              
              catch (IOException e){
                     e.printStackTrace();
    }Here my Applet code:
    public void init() {         
             moreStuff.addActionListener(new ActionListener(){
                  public void actionPerformed(ActionEvent e){
                       requestMore();
             try{
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");              
                  servletConnection = studentDBservlet.openConnection();      
                   servletConnection.setUseCaches (false);
                   servletConnection.setDefaultUseCaches(false);
                   servletConnection.setDoOutput(true);
                   servletConnection.setDoInput(true);
                   ObjectOutputStream outputToApplet;
                 outputToApplet = new ObjectOutputStream(servletConnection.getOutputStream());          
                 outputToApplet.writeObject(new ArrayList());
                 outputToApplet.flush();           
                 outputToApplet.close(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
                  inputFromServlet.close();
                  outputToApplet.close();             
              catch(Exception e){
                   area = new JTextArea();
                   area.setText("An error occured!!!\n");
                   area.append(e.getMessage());
            getContentPane().add(new JScrollPane(area), BorderLayout.CENTER);
            getContentPane().add(moreStuff, BorderLayout.SOUTH);
        private void requestMore(){
             try{              
                  studentDBservlet = new URL("http://localhost/DBHandlerServlet");                             
                  servletConnection = studentDBservlet.openConnection(); 
                   ObjectInputStream inputFromServlet = new ObjectInputStream(servletConnection.getInputStream());
                   ArrayList studentVector = (ArrayList) inputFromServlet.readObject();
                   area.setText("Success2!\n");
                   for (int i = 0; i<studentVector.size(); i++) {
                        area.append(studentVector.get(i).toString()+"\n");
              catch(Exception e){               
                   area.setText("An error occured2!!!\n");
                   area.append(e.getMessage());
        }Can someone help me solv this issue please, this is my first Applet Servlet work so far so I have no idea on how to solve this issue.

    Sorry folks, just found my error. Forgot about the ObjectInputStream waiting on the Servlet side, so of course had a dead look...
    Sorry!

  • Problem in System object - Very urgent - Pls help

    Hi ,
    I have installed Portal version SP9 on windows with MS SQL server as database . I am experencing some
    issues during the system object creation for R3 . Below I will specify all the configuration I have done for
    system object creation ,
    1. I have selected the option Dedicated application server for R/3 system .
    2. Under th eproperty category , I have selected Connector and put the following values .
    Application Host  - 128.1.7.2
    Remote Host Type - Select -3
    SAP Client  - 120
    SAP System ID (SID)- DV1
    SAP System Number - 00
    System Type - SAP_R3
    Trace Mode - Select -01
    3 . Then Under the property category , Web Application server ( WAS ) I have selected
    the following properties .
    WAS hostname - 128.1.7.2
    Was Protocol - http
    4 . Next step I have selected the User Management and put the below details
    Logon Method - UIDPW
    usermapping type - admin ,user
    4. I have also created an alias and made it default
    6. Then I have gone to usermapping under the user administration and created the
    user mapping for the user .
    But when I have tested the system object , I am getting the following error .
    SAP Web AS Connection - Jan 1, 1970 8:17:25 AM
      Test Details:
    The test consists of the following steps:
    1. Check that the system object defines an SAP system
    2. Validate the following parameters: wap.WAS.protocol; wap.WAS.hostname
    3. Check the HTTP/S connection to the defined backend application
      Results
    1. The system object represents an SAP system.
    2. The following parameters are valid: wap.WAS.protocol (http) ; wap.WAS.hostname (128.1.7.2)
    3. HTTP/S connection failed. Make sure the protocol, host name, and user mapping are correctly defined.
    ITS Connection - Jan 1, 1970 8:17:25 AM
      Test Details:
    The test consists of the following steps:
    1. Check that the system object defines an SAP system
    2. Validate the following parameters: wap.ITS.path; wap.ITS.protocol; wap.ITS.hostname
    3. Check the HTTP/S connection to the defined backend application
      Results
    1. The system object represents an SAP system.
    2. The following parameters are not valid: wap.ITS.path () ; wap.ITS.protocol () ; wap.ITS.hostname ()
    I really dont know what is foing wrong . Do I need to omit the WAS details which I have mentioned in the step number 3 . What is the
    real use of this step ? Could any body guide me as this is quite urgent
    Thanks
    Aneez

    Hi,
      We have similar setup and having same userids in both R/3 (webas 6.40 based) as well as
    in EP 6.0, so we are not doing any user mapping as recommended. I hope i gave all necessary
    parameters under system object of categories user management with SAPLOGON, connector
    properties and also WAS properties with hostname and type as http. When i try to do test
    connection it is giving following error message:
    SAP Web AS Connection - 
      Test Details:
    The test consists of the following steps:
    1. Check that the system object defines an SAP system
    2. Validate the following parameters: wap.WAS.protocol; wap.WAS.hostname
    3. Check the HTTP/S connection to the defined backend application
      Results
    1. The system object represents an SAP system.
    2. The following parameters are valid: wap.WAS.protocol (http) ; wap.WAS.hostname (xxxxxxxx)
    3. HTTP/S connection failed. Make sure the protocol, host name, and user mapping are
    correctly defined.
    Test Connection with Connector - Jan 1, 1970 6:40:19 PM
      Test Details:
    The test consists of the following steps:
    1. Retrieve the default alias of the system
    2. Check the connection to the backend application using the connector defined in this
    system object
      Results
    Retrieval of default alias successful
    Connection successful
    Also when i try to do the testing of transaction from :
    System Adm.>Support.>SAP Application>SAP transaction>
    Select the system and Tcode and most important SAP GUI type = SAP GUI for Windows
    i am getting connection broken error.
    Let me know is there anything in specific which is missing.
    Thanks

  • Serializing/Deserializing Objects..Urgent !!!

    Hello Everyone,
    Out of the blue I got an exception like
    java.io.StreamCorruptedException: invalid stream header
         at java.io.ObjectInputStream.readStreamHeader(Unknown Source)
         at java.io.ObjectInputStream.<init>(Unknown Source)
    I am implementing "Applet to Servlet communication".
    Actually i am trying to deserialize the object which was passed to the servlet.But when i read it back i am geting the above exception.
    Can anyone throw some light on it?
    Her is my code
    APPLET CODE:
    private void interactWithServlet() {
    WBObject result = null;
    try {
    // Create an object we can use to communicate with the servlet
    URL servletURL = new URL(sURL);
    URLConnection servletConnection = servletURL.openConnection();
    servletConnection.setDoOutput(true);
    servletConnection.setUseCaches(false);
    servletConnection.setRequestProperty("Content-Type", "application/octet-stream;charset=utf-8");
    ObjectOutputStream request = new ObjectOutputStream(
    new BufferedOutputStream(servletConnection.getOutputStream()));
    WBObject wbObj=m_whiteBoardComponent.getDesignPanel().getWBObject();
    int size=wbObj.getChildren().size();
    for(int i=0;i<size;i++){
    PickObject pick=(PickObject)wbObj.getChildren().get(i);
    System.out.println("the pick object name is"+pick.getName());
    int count=pick.getChildren().size();
    for(int j=0;j<count;j++){
    ItemObject item=(ItemObject)pick.getChildren().get(j);
    System.out.println("the item object name is"+item.getName());
    request.writeObject(wbObj);
    request.flush();
    request.close();
    ObjectInputStream response = new ObjectInputStream(
    new BufferedInputStream(servletConnection.getInputStream()));
    result = (WBObject)response.readObject();
    System.out.println("The object is"+(result instanceof WBObject));
    response.close();
    } catch (Exception e) {
    e.printStackTrace();
    SERVLET CODE:
    public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException,
    IOException {
    WBObject o = null;
    ObjectInputStream inputStream = new ObjectInputStream(
    new BufferedInputStream(req.getInputStream()));
    try {
    o = (WBObject)inputStream.readObject();
    inputStream.close();
    } catch( ClassNotFoundException ex ) {
    ex.printStackTrace();
    // send response
    resp.setStatus(HttpServletResponse.SC_OK);
    resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.close();
    Best Regards
    Ashish

    client
    URLConnection servletConnection = servletURL.openConnection();try
    HttpURLConnection servletConnection = (HttpURLConnection)servletURL.openConnection();server
    // send response
    resp.setStatus(HttpServletResponse.SC_OK);
    resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.close();try
    // send response
    //resp.setStatus(HttpServletResponse.SC_OK);
    //resp.setContentType("application/octet-stream;charset=utf-8");
    ObjectOutputStream oos = new ObjectOutputStream(
    new BufferedOutputStream(resp.getOutputStream()));
    oos.writeObject(o);
    oos.flush();
    oos.close();

  • Business Objects Presentation - Urgent...!!!

    Hi BOBJ Experts,
    Could anyone please send me Business Objects Presentation? I have to do a presentation tomorrow. I tried other sources but no good.
    This is something urgent. Points will be assigned.
    Thanks in Advance.
    Chandu

    Hi chandu,
    pls refer the below ppt links...
    www.businessobjects.hu/hirek/Sybase-PS82_Konferencia_2006-04-19.ppt
    https://boc.sdn.sap.com/node/2272 - 20k
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/63aea398-0e01-0010-6fbb-a4069913d975
    www.ch.businessobjects.com/download/events/archive/2004/040622_cd/040622_peter_busenhart.pdf
    www.ch.businessobjects.com/download/events/archive/2004/040622_cd/040622_stephan_einfeldt.pdf
    www.sap.com/about/investor/presentations/pdf/Kagermann_IR_Conf_Orlando2008.pdf
    www.sap.com/about/investor/presentations/pdf/WB_Cheuveux_Jan2008_FINAL.pdf
    thanks
    karthik
    reward me if usefull

  • SRM2.0 to SRM3.0 Additional Objects - Very Urgent

    Hi
    This is very urgent. I want to integrate SRM2.0 with ERP 2005. There is a note to integrate SRM3.0 with ERP 2005 but not for SRM2.0.
    Can anyone please tell me what are the additional objects available in SRM3.0 that are not in SRM2.0.
    Any help would be highly appreciated.
    Thanks in advance
    Ajay

    Hi,
    http://service.sap.com/instguides
    Navigate in the lft pane to check SAP EBP4.0 guides
    Download the Upgrade Guide (not master guide).This will require OSS iD and Pwd.
    Link:https://websmp110.sap-ag.de/~sapidb/011000358700002702252003E
    It contains the info you wanted.
    BR,
    Disha.
    Pls reward points for useful answers.

  • Using event for objects communication

    hi,
    i have two kinds of object, an producer and a consummator, i want to make them communicating with event.
    when the producer have information to send, it wrapped within an event an send it to the consummator, do you have some documentation how to do
    that, or samples
    thanks for your help

    // the Producer class...
    class Producer
       EventListenerList elList = new EventListenerList();
       public final void addXxxxListener(XxxxListener l)
           this.elList.add(XxxxListener.class, l);
       public final void removeXxxxListener(XxxxListener l)
           this.elList.remove(XxxxListener.class, l);
       // do one of these for each type of XxxxEvent
       // there may be one or more
       public final void fireXxxxYyyyy(<arguments>)
          EventListener[] listeners = this.elList.getListeners(XxxxListener.class);
          if (listeners != null)
             XxxxEvent evt = new XxxxEvent(<arguments>);
             for (int i=0; i<this.elList.length; i++)
                ((XxxxListener)(listeners)).yyyyy(evt);
    // this is what you called the Consumator...
    interface XxxxListener
    extends EventListener
    public void yyyyy(XxxxEvent evt);
    // the Event class...
    class XxxxEvent
    extends EventObject
    public XxxxEvent(<arguments>)
    For more info see the EventObject, EventListenerList and EventListener documentation pages.
    Have fun.
    Ben

  • Asp-applet communication(URGENT!!)

    hi,
    i am facing a problem on asp-applet communication. i would like to ask how to pass applet parameters to asp page?my code below doesnt seem to work..
    smsClient.java
    public class smsClient {
    private JOptionPane jOptionPanel = new JOptionPane();
    private dialog dd;
    String str;
    public void executeSend(String smsno, String smsMessage,String user_id){
    String qrysmsno=smsno;
    String qrysmsMessage=smsMessage;
    String qryUserId=user_id;
    try{
    String qry=URLEncoder.encode("smsno")+ "=" + URLEncoder.encode(qrysmsno) + "&";
    qry= qry + URLEncoder.encode("smsMessage")+ "=" + URLEncoder.encode(qrysmsMessage);
    //qry= qry + URLEncoder.encode("user_id")+ "=" + URLEncoder.encode(qryUserId);
    URL url=new URL("http://172.20.34.116:8081/3dcommunity/sendsms.asp?"+qry);
    dialog dd=new dialog();
    //dd.showDialog(qry, "Alert!", JOptionPane.WARNING_MESSAGE);
              URLConnection uc = url.openConnection();
              uc.setDoOutput(true);
              uc.setRequestProperty("Content-Type","application/x-www-form-urlencoded");
              PrintWriter pw = new PrintWriter(uc.getOutputStream());
              pw.println(str);
              pw.close();
              BufferedReader in = new BufferedReader(new InputStreamReader(uc.getInputStream()));
              String res = in.readLine();
              dd.showDialog(res, "Alert!", JOptionPane.WARNING_MESSAGE);
              in.close();
    /*HttpURLConnection http = (HttpURLConnection)url.openConnection();
         http.setRequestMethod("GET");
         InputStream iStrm = null;
         if (http.getResponseCode() == HttpURLConnection.HTTP_OK) {
         iStrm = http.getInputStream();
         int length = (int) http.getContentLength();
         if (length > 0) {
         byte servletData[] = new byte[length];
         iStrm.read(servletData);
         String resultString = new String(servletData);
    dd.showDialog(res, "Alert!", JOptionPane.WARNING_MESSAGE);
         iStrm.close();*/
         catch(MalformedURLException e){
         System.err.println(e);
    dd.showDialog("MalformedURLException", "Alert!", JOptionPane.ERROR_MESSAGE);
         catch(IOException e){
         System.err.println(e);
    dd.showDialog("IOException", "Alert!", JOptionPane.ERROR_MESSAGE);
    sendsms.asp
    <%
         set mySMS = Server.CreateObject("SCSMS.SMS")
         mySMS.Port = "COM3"
    %>
    <%
              mfg = mySMS.Manufacturer
              mdl = mySMS.Model
              if mySMS.Error then
                   response.write mySMS.ErrorMsg
              else
                   response.write "Manufacturer : " & mfg & "<br>"
                   response.write "Model : " & mdl & "<br><br>"
              end if
              smsno=request.queryString("smsno")
              smsMessage=request.queryString("smsMessage")
         mySMS.sendsms smsno, smsMessage
         if mySMS.Error <> 0 then
              'response.write "Failed" & mySMS.ErrorMsg
         else
              response.write "Success"
         end if
    %>

    use the following class for applet to any web site connection (it can be asp, jsp, cgi etc)
    package com.oreilly.servlet;
    import java.io.*;
    import java.net.*;
    import java.util.*;
    * A class to simplify HTTP applet-server communication. It abstracts
    * the communication into messages, which can be either GET or POST.
    * <p>
    * It can be used like this:
    * <blockquote><pre>
    * URL url = new URL(getCodeBase(), "/servlet/ServletName");
    * HttpMessage msg = new HttpMessage(url);
    * // Parameters may optionally be set using java.util.Properties
    * Properties props = new Properties();
    * props.put("name", "value");
    * // Headers, cookies, and authorization may be set as well
    * msg.setHeader("Accept", "image/png"); // optional
    * msg.setCookie("JSESSIONID", "9585155923883872"); // optional
    * msg.setAuthorization("guest", "try2gueSS"); // optional
    * InputStream in = msg.sendGetMessage(props);
    * </pre></blockquote>
    * <p>
    * This class is loosely modeled after the ServletMessage class written
    * by Rod McChesney of JavaSoft.
    * @author <b>Jason Hunter</b>, Copyright &#169; 1998
    * @version 1.3, 2000/10/24, fixed headers NPE bug
    * @version 1.2, 2000/10/15, changed uploaded object MIME type to
    * application/x-java-serialized-object
    * @version 1.1, 2000/06/11, added ability to set headers, cookies,
    and authorization
    * @version 1.0, 1998/09/18
    public class HttpMessage {
    URL servlet = null;
    Hashtable headers = null;
    * Constructs a new HttpMessage that can be used to communicate with the
    * servlet at the specified URL.
    * @param servlet the server resource (typically a servlet) with which
    * to communicate
    public HttpMessage(URL servlet) {
    this.servlet = servlet;
    * Performs a GET request to the servlet, with no query string.
    * @return an InputStream to read the response
    * @exception IOException if an I/O error occurs
    public InputStream sendGetMessage() throws IOException {
    return sendGetMessage(null);
    * Performs a GET request to the servlet, building
    * a query string from the supplied properties list.
    * @param args the properties list from which to build a query string
    * @return an InputStream to read the response
    * @exception IOException if an I/O error occurs
    public InputStream sendGetMessage(Properties args) throws IOException {
    String argString = ""; // default
    if (args != null) {
    argString = "?" + toEncodedString(args);
    URL url = new URL(servlet.toExternalForm() + argString);
    // Turn off caching
    URLConnection con = url.openConnection();
    con.setUseCaches(false);
    // Send headers
    sendHeaders(con);
    return con.getInputStream();
    * Performs a POST request to the servlet, with no query string.
    * @return an InputStream to read the response
    * @exception IOException if an I/O error occurs
    public InputStream sendPostMessage() throws IOException {
    return sendPostMessage(null);
    * Performs a POST request to the servlet, building
    * post data from the supplied properties list.
    * @param args the properties list from which to build the post data
    * @return an InputStream to read the response
    * @exception IOException if an I/O error occurs
    public InputStream sendPostMessage(Properties args) throws IOException {
    String argString = ""; // default
    if (args != null) {
    argString = toEncodedString(args); // notice no "?"
    URLConnection con = servlet.openConnection();
    // Prepare for both input and output
    con.setDoInput(true);
    con.setDoOutput(true);
    // Turn off caching
    con.setUseCaches(false);
    // Work around a Netscape bug
    con.setRequestProperty("Content-Type",
    "application/x-www-form-urlencoded");
    // Send headers
    sendHeaders(con);
    // Write the arguments as post data
    DataOutputStream out = new DataOutputStream(con.getOutputStream());
    out.writeBytes(argString);
    out.flush();
    out.close();
    return con.getInputStream();
    * Performs a POST request to the servlet, uploading a serialized object.
    * <p>
    * The servlet can receive the object in its <tt>doPost()</tt> method
    * like this:
    * <pre>
    * ObjectInputStream objin =
    * new ObjectInputStream(req.getInputStream());
    * Object obj = objin.readObject();
    * </pre>
    * The type of the uploaded object can be determined through introspection.
    * @param obj the serializable object to upload
    * @return an InputStream to read the response
    * @exception IOException if an I/O error occurs
    public InputStream sendPostMessage(Serializable obj) throws IOException {
    URLConnection con = servlet.openConnection();
    // Prepare for both input and output
    con.setDoInput(true);
    con.setDoOutput(true);
    // Turn off caching
    con.setUseCaches(false);
    // Set the content type to be application/x-java-serialized-object
    con.setRequestProperty("Content-Type",
    "application/x-java-serialized-object");
    // Send headers
    sendHeaders(con);
    // Write the serialized object as post data
    ObjectOutputStream out = new ObjectOutputStream(con.getOutputStream());
    out.writeObject(obj);
    out.flush();
    out.close();
    return con.getInputStream();
    * Sets a request header with the given name and value. The header
    * persists across multiple requests. The caller is responsible for
    * ensuring there are no illegal characters in the name and value.
    * @param name the header name
    * @param value the header value
    public void setHeader(String name, String value) {
    if (headers == null) {
    headers = new Hashtable();
    headers.put(name, value);
    // Send the contents of the headers hashtable to the server
    private void sendHeaders(URLConnection con) {
    if (headers != null) {
    Enumeration enum = headers.keys();
    while (enum.hasMoreElements()) {
    String name = (String) enum.nextElement();
    String value = (String) headers.get(name);
    con.setRequestProperty(name, value);
    * Sets a request cookie with the given name and value. The cookie
    * persists across multiple requests. The caller is responsible for
    * ensuring there are no illegal characters in the name and value.
    * @param name the header name
    * @param value the header value
    public void setCookie(String name, String value) {
    if (headers == null) {
    headers = new Hashtable();
    String existingCookies = (String) headers.get("Cookie");
    if (existingCookies == null) {
    setHeader("Cookie", name + "=" + value);
    else {
    setHeader("Cookie", existingCookies + "; " + name + "=" + value);
    * Sets the authorization information for the request (using BASIC
    * authentication via the HTTP Authorization header). The authorization
    * persists across multiple requests.
    * @param name the user name
    * @param name the user password
    public void setAuthorization(String name, String password) {
    String authorization = Base64Encoder.encode(name + ":" + password);
    setHeader("Authorization", "Basic " + authorization);
    * Converts a properties list to a URL-encoded query string
    private String toEncodedString(Properties args) {
    StringBuffer buf = new StringBuffer();
    Enumeration names = args.propertyNames();
    while (names.hasMoreElements()) {
    String name = (String) names.nextElement();
    String value = args.getProperty(name);
    buf.append(URLEncoder.encode(name) + "=" + URLEncoder.encode(value));
    if (names.hasMoreElements()) buf.append("&");
    return buf.toString();
    }

  • Creation of a user with a particular authorization object (Very Urgent)

    Hi,
    There is a requirement in my project to create a user who can only reset his password. So for this I think a authorization object should be created and assign it to a profile which displays only the tab for reseting the password which is( Logon in SU01). I want to know two things in this regard.
    1. The whole process of creating customised authorization object and assigning it to a profile and
    2. Any other way to achieve the needed scenario.
    Thanks & Regards,
    Sujith
    Edited by: Sujith K on Feb 4, 2008 1:26 PM

    In transaction pfcg ,
    give single/composite role name
    give profile name and description in authorization tab, save it
    enter into change authorization data
    select manually tab
    give authorization objects name (creating auth. objects)
    fields will automatically come inside it
    enter the field values
    save and generate profiles (Profiles created)
    go to su01,
    create users (fill address, logon data, roles )
    In pfcg,
    select the role you created and click on the user comparison for giving the authorization to access.
    award points if useful

  • Account  requires an assignment to a CO object-very urgent

    Hi experts,
    I have 2 questions
    1.while  doing transaction MI07 -post inv.differences its giving an errorr <b>Account requires an assignment to a Co object.</b>
    2.while doing transactions called MIGO  for a particular PLANT its not trigerring an GL account and giving an errorr as <b>Account requires an assignment to a CO object</b>
    pls try to slove this issue.
    points are considered.
    Thank you and Regards
    sasikanth.

    Hi
    While doing MI07 it requires a posting to a P&L account for the difference as it is going to be charged off, and if this GL account is a Cost element it will ask for a Assignment to CO object. You can default it in OKB9 for the Gl account based on the profit center and G.L account combination since Profit center will be obtained from the material master assignment it can be done this way.
    In transaction MIGO which is for Goods receipt it posts to Fi automatically through the configuration in OBYC. If standard cost is maintained then there may be a posting to price difference account hence it will also be a cost element due t which it required an CO object. For this also you have to maintain a Co object in transaction OKB9
    This will solve your problem.
    Anand

  • Problem in transporting the objects(very urgent)

    hello Experts,
    I have saved my tables , domains,data elements and programs in local object.Now i want to tranport into production server,For that i have to save this objects in some request.How to do that.Please give me the solution .
    Thanks in advance
    regards,
    Ashok.

    hi,
    Please follow below steps to handle the same:
      1. Go to Transaction: SE10.
      2. Create a new workbench request by using key F6.
      3. Double on the newly created request
      4. Add a new entry: R3TR,TABU,<table> for Program Id, Object Type and Object Name Respectively.
      <table> being the table name for which the contents are to be transported.
      5. Click on Function icon next to table name.
      6. Click the contents from the icons in next screen.
      7. Select entire table.
      8. In next screen we can select required entries to be transported.
      9. Come back and save.
    10. Now release the request and transport to the required server.
    Rgds
    Anver

  • Trouble with object privileges /urgent, pls !!!/

    Hi all !
    I've got the next problem.
    1. Function in package use dynamic PL/SQL:
    snippet:
         stmt :=
         'select ' ||
    'r.role_name,' ||
    'u.locked,' ||
    'u.adm,' ||
    'u.ch_pwd_on_next_log ' ||
    'from ' ||
         'usr5.c_roles      r,' || --- !!!!!
    'usr5.c_users     u ' || --- !!!!!
    'where ' ||
         'r.role_id = u.role_id ' ||
    'and u.login = :login_ ' ||
    'and u.pwd = :pwd_';
    2. As default role my user /usr4/ have role with granted
    SELECT on usr5.c_roles and SELECT on usr5.c_users.
    3. When I execute simple 'select from usr5.c_roles'
    from sqlplus - all OK.
    4. When I execute stored procedure - I get
    error messsage that 'table or view does not exist'.
    What's wrong ???
    Thanks in advance.
    Konstantin.

    We cannot build procedures or views using object or system privileges granted to us through a role. You need to get SELECT on usr5.c_roles and SELECT on usr5.c_users granted to your user directly.
    This is (of course) in the documentation which states quite clearly that "roles are not meant to be used for application developers".
    Cheers, APC

  • Applet Servlet communication (urgent)

    Hi,
    I m using Netscape Enterrpise server 4.0 as my web server. I am passing data from applet to servlet using BufferedInputStream(). But it takes about 30 seconds to send the data. If i don't use it, the data is not being read by the servlet. Is there any alternative to this ? Please help.
    Thanks

    It's only the primary key field that i am passing to the servlet from applet .. For this particular process, it takes 30 seconds + other things like loading the applet, etc. so in all, it takes about 1 minute just to fetch the data from servlet which is not reasonable. We have monitored the whole process. We found that other things like query, etc. does not take much time, but BufferedInputStream() itself takes 30 seconds. Regarding communication line, it is quite fast. We are a corporate sector, so no doubt about the speed of the communication line ...
    Thanks for help.

Maybe you are looking for