How Do I read a String as an XML and reply?

Hello there to everyone reading my Post !
I am entering a total new subject in my learning about Java Programming, where I will need to interact with a server, I was wondering If somebody could help me with a Question I have; here it is:
A server provided me a Socket, (and that is of course an IP address and a Port), And I am supposed to connect to that server using a Java program that connects to servers using a Socket class, then I am supposed to send a String representing a valid XML, and then the server replies me With another String representing a valid XML which I am supposed to store in a String type.
Is this exact write/read operation possible? If so, could someone please give me some code to solve this problem?
PD: The server Does this operation only: recieve/send Strings. as its called transactional switch.
Sorry If I have put this Query in the Wrong Forum, I have put it in Networking also, just in case. Excuse me for any inconveniences.
Message was edited by:
BCE_Jose

I am supposed to send a String representing a valid XML.what do you mean? do you want to send value that you get from XML doc or what? cos i don't understand about "String representing a valid XML". is it XML document exists or not? can you give us more detail about what you asking for.

Similar Messages

  • How can i read a string with nextToken() of StreamTokenizer

    I need for my class paper to read a string from a file and i used the StreamTokenizer's method nextToken but i can not read a string with it. my code is:
    StreamTokenizer st = new StreamTokenizer(the code that gets the input from the file)
    String line;
    while ((line !=br.readLine()) != null) {
    String surname = (st.nextToken()).trim();
    but it gets me some error of:
    int can not be dereferenced
    what should I do to get the string i need?

    Look at the API for java.io.StreamTokenizer. In particular, look at the return type for nextToken().
    Good luck.

  • How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?

    Hi All,
    Hope to you a very happy new year,
    I have two differnt LAP 1300 and 1200 in my network and I need to add theme to the WLC,
    I successed to add one of theme by the option 60 in the DHCP pool at the Core SW,
    So my quetion is below:
    How to use multiple VCI strings for lap 1300 and 1200 (option 60) in one pool?
    Thanks in Advanced,
    Ahmed,

    To add to Scott's post.  Option 60 would be useful if you needed to put certain types of AP on specific controllers.  Otherwise, no real need to use it for the most part.
    Though, I do recall an issue a few years ago that some windows machines had issues getting DHCP if option 43 is being returned.
    Now, on an IOS switch, you can only configure one option 60 per DHCP scope
    HTH,
    Steve
    Please remember to rate useful posts, and mark questions as answered

  • How to search a special string in txt file and return it's position in txt file?

    How to search a special string in txt file and return it's position in txt file?

    I just posted a solution for a similar question here:  http://forums.ni.com/ni/board/message?board.id=170​&view=by_date_ascending&message.id=362699#M362699
    The top portion can search for the location of a string, while the bottom portion is to locate the position of a character.  Both can search for a character.
    The position of the character within the file is displayed in the indicator(s).
    R

  • WCF Service and Sharepoint Form library : How i can read a access a form libray and query a item from file name and read form xml in WCF service ?

    WCF Service and Sharepoint Form library : How i can read or access a form libray and query a item from file name and read form xml in WCF service ?
    Ahsan Ranjha

    Hi,
    In SharePoint 2013, we can take use of REST API or Client Object Model to access the SharePoint objects like Form Library.
    SharePoint 2013 REST API
    http://msdn.microsoft.com/en-us/library/office/dn450841(v=office.15).aspx
    http://blogs.technet.com/b/fromthefield/archive/2013/09/05/working-with-sharepoint-list-data-odata-rest-and-javascript.aspx
    SharePoint 2013 Client Object Model
    http://msdn.microsoft.com/en-us/library/office/fp179912(v=office.15).aspx
    http://msdn.microsoft.com/en-us/library/office/jj193041(v=office.15).aspx
    With the retrieved file, we can then use XmlDocument object to parse it and get the values you want:
    http://weblogs.asp.net/jimjackson/opening-and-reading-an-xml-file-in-a-document-library
    http://stackoverflow.com/questions/1968809/programatically-edit-infopath-form-fields
    Best regards
    Patrick Liang
    TechNet Community Support

  • How to read a string character by character and pass it into an array

    Hi,
    I have a requirement to write a function.The thing is,i need to read string,replace space with a NULL,return in the form of an arrayy.
    for this what i thought is,if the character is not a space,i need to put that into array,if its space,put a NULL for that.
    the string is of type varchar2.
    ex:XX XX XX
    i need some suggestions for this.
    thanks

    Well, you can just use a loop that runs for the length of the string.
    Then for each iteration of the loop, take the next character of the string (substr or similar) and add it to the array. If it's a space, then add a NULL to the array (if that's what you want).
    Easy :)

  • How do I read in strings in alphabetical order nto an array?

    I've been trying this for awhile now, and I do remember seeing it in a book awhile back, but can't remember how, but I've been doing it from scratch, and it's getting long. I know the basic concept - read in the first thing to the array, after that check to see if new if smaller or bigger than last, if smaller, move it forward until the one in front(below) it is smaller, or if it hits zero. But I can't get the code very short at all... (pretty long so far and only partially working..)
    Does anyone remmeber how to do this?

    here's what I have so far:
         int findSpot(Person key)//make to just check to see if one before is smaller, if yes, -1, if no, just add to end
              int pos=0;
              Person tempPerson;
              Person tempPerson2;
         temp = new Person[MAX_ENTRIES];
              for( int index=0;index<count;index++)
                   temp[index]=phones[index];
                   System.out.println(temp[index]+ "and the index value is: " + index);
              /*need to have this read in where ever it is needed temp[count]=key;*/
              for( int index=1;index<=count;index++)
                   pos=index;
                   if((temp[pos-1].getName().compareTo(key.getName()))>0)
                        while(pos>0)
                             tempPerson2=temp[index];
                             System.out.println("PERSON2 = " + tempPerson2);
                             //System.out.println("IN WHILE!!!!!\nPOS = "+ pos);
                             tempPerson=temp[pos-1];
                             System.out.println(tempPerson.getName() + "(temp) is now assigned the value of " + temp[pos-1].getName()+ (pos-1));
                             System.out.println("\n\n temp[pos-1] = " +(pos-1) + temp[pos-1] + "\n\n");
                             System.out.println(temp[pos-1].getName()+ (pos-1) + " is assigned the value of (key)" + key.getName());
                             temp[pos-1]=key;
                             /*System.out.println(temp[pos] + ""+(pos) + "is assigned the value of (temp)" + tempPerson.getName());
                             System.out.println("\nshould be tom" + tempPerson2 + "\n");
                             //tempPerson2= tempPerson;
                             temp[pos]=tempPerson; //oh no! (vital
                             //now need to switch the su
                             while(pos>1)
                                  //tempPerson2=temp[pos-1];
                                  //System.out.println(tempPerson2.getName()+ (pos-1) + "(temp2) is assigned the value of " + temp[pos-1].getName()+ (pos-1));
                                  System.out.println(temp[pos-1].getName() + ""+(pos-1) + "is assigned the value of (temp)" + tempPerson.getName());
                                  temp[pos-1]=tempPerson;
                                  System.out.println(temp[pos].getName() + ""+(pos) + "is assigned the value of (temp2)" + tempPerson2.getName());
                                  temp[pos]=tempPerson2;//needs to be assigned 'tom'
                                  pos--;
                             pos--;
                   //else
                   //temp[index]=key;
              count++;
              for( int index=0;index<count;index++)
                   System.out.println("temp array = " + temp[index]);
                   phones[index]=temp[index];
                   return pos;
         }

  • How would you read in each line of data and display them to message box?

    How would you read in each line of data from the _.txt file_ and display the whole data using an information-type message box?
    I know how to display each line of the .txt file data, but I do not know how to display the whole thing.
    Here is how I did to display each line of data using the message box:
    import javax.swing.JOptionPane;          // Needed for the JOptionPane class
    import java.io.*;                         // Needed for file classes
    public class problem3
         public static void main(String[] args) throws IOException
              String filename;          // Needed to read the file
              String categories;          // Needed to read the categories
              // Get the filename.
              filename = JOptionPane.showInputDialog("Enter the filname.");
              // Open the file.
              FileReader freader = new FileReader(filename);
              BufferedReader inputFile = new BufferedReader(freader);
              // Read the categories from the file.
              categories = inputFile.readLine();
              // If a category was read, display it and
              // read the remainig categories.
              while(categories != null)
                   // Display the last category read.
                   JOptionPane.showMessageDialog(categories);
                   // Read the next category.
                   categories = inputFile.readLine();
              // Close the file.
              inputFile.close();
    }I think I need to change here:
    // If a category was read, display it and
              // read the remainig categories.
              while(categories != null)
                   // Display the last category read.
                   JOptionPane.showMessageDialog(categories);
                   // Read the next category.
                   categories = inputFile.readLine();
              }but I don't know how to.
    Could you please help me?
    Thank you.

    kyorochan wrote:
    jverd wrote:
    What is not understood about your question is which part of "read a bunch of lines and display them in a textbox" do you not understand.
    First thing's first though: You do recognize that "read a bunch of lines and display them in a textbox" has a few distinct and completely independent parts, right?I'm sorry. I'm not good at English, so I do not understand what you said...
    What I was trying to say is "How to display the whole lines of .txt file in single dialog box."We know that.
    Do you understand that any problem can be broken down into smaller pieces?
    Do you understand that your problem has the following pieces?
    1. Read lines from the file.
    2. Put the lines together into one String.
    3. Put the String into the message box.
    and maybe
    4. Make sure the message box contents are split into lines exactly as the file was.
    (You didn't make it clear if that last one is a requirement.)
    Do you understand that 1-4 are completely independent problems and can be solved separately from each other?
    Do you understand that you have stated that you already know how to do 1 and 3?
    Therefore, you are NOT asking "How to display the whole lines of .txt file in single dialog box." Rather, you ARE asking either #2 or #4 or both.
    If you say once more "display all the lines of the file in one dialog box," then it is clear that we are unable to communicate with you and we cannot help you.

  • TS4001 How to delete reading list in the book mark and history

    How to delete in bookmark and reading list in safari in Ipad and iphone4

    Swipe across an item in the reading list and it should get a Delete button on it - you will need to do each individually, I don't think that there is a multi-select-and-delete option

  • If I got one of the free books off of Itunes, how do I read it? I double click and it does nothing. Is it only to hook up to Iphones or Ipads?

    I got one of the free books of Itunes and I'm wondering how I read it.  I double click and nothing happens.  Is it only for Ipads and Iphones??

    If you have one of the public-domain books provided by Project Gutenberg (these are books published many years ago and which have therefore fallen out of copyright, such as the Dickens and Jane Austin books), you should be able to open it using Calibre:
    http://calibre-ebook.com/
    or one of the other applications that can open ePub format. Launch the app and point it to the book file, which will be in your iTunes folder, in iTunes Music (Media) -> Books.
    Regards.

  • How can I parser a String with javax.xml.parsers.DocumentBuilder?

    Normally the DocumentBuilder can parse files, InputSource,InputStream or uri. but what if I want to parse an editing String the user created in an EditPane or JTextComponent?

    new InputSource(new StringReader(theString))

  • How to sync reading list between my old tablet and new one?

    I have like 100 links in my reading list in firefox on my old tablet. I need to transfer them to my new tablet, but it seems that Firefox sync is working only for bookmarks. How can I transfer my reading list without rooting the device?

    Hello.
    Currently, there is no way to sync your reading list between your devices. Since the reading list is just webpages without all of the ads and a more reader-like experience, it's just like a bookmark. But, you have to make all of those reading list items into bookmarks to sync between devices. The reading list is for on-device only.
    Sorry for all of the trouble. (With 100 and all) :-(

  • How can I read an email on my iPad and have it not be marked as read?

    I have an Exchange account set up on my iPad for my work email. My email is partly organized such that I look at unread emails (whether or not I've actually read them) for actions required. However, when I tap an email on my iPad, it is automatically marked as read as soon as it comes up in the reading pane. I do realize I can tap a button to have it marked as unread, but I want the default to be that an email is not marked as read. Any feedback?

    On the iPad, using the mail app, there is no way to do what you are asking without tapping the flag icon and marking the item as unread. Have you tried the OWA app for the iPad? It may have that functionality, but I haven't tested it as you need an Office 365 subscription with Exchange support to use the app.

  • How to properly read data from one DAQ-assistant and write simultaneously with another DAQ-assistant (which is inside a loop)

    Hello.
    I'm a newbie working on my Master's thesis conserning a project that is based on old G-code made by another newbie so bear with me.
    I need to create a sequance of output controls. For this I'm using a for loop that eventually creates two triangular ramps during a period of 90 seconds. I've confirmed that this function works properly by measuring the actual output of the DAQ-decice (NI USB 6353).
    The problem is the following: During this controll-cycle I need to simultanously collect data from the same DAQ-device. At this point there is only one DAQ-assistant output-block in the main loop of the program and all the signals are derived from it to where they are needed.There is a case-structure (the bottom case structure in the picture) that contains the functions needed to collect the data during the test cycle. However these two actions, outputting data and inputting data, are not synchronized in any way which may be the reason why I get the 200279 error or alternatively the 200284 error during the test cycle. I've tried changing the sample rate, buffer size and the timeout time as adviced but nothing seems to help.
    What would be the simplest way to solve this problem?
    Help is greatly appreciated!
    Attachments:
    problem.jpg ‏206 KB

    Thanks for quick reply.
    However, I did try it (see the picture) but I still have a problem: I only get 100 samples / channel during the test sequence (all from the first seconds of the sequence) in total even though I've set the data aqcuiring DAQ-assistant as "continous" and "samples to read = 95k" and rate is 1000Hz.
    Edit.
    And lastly, I have trouble adding this "extra" DAQ-assistant to the vi. because I get an error about a resource (The 6353) being reserved, even though I connected a false constant to the "STOP" -input of the main DAQ-assistant.
    Attachments:
    is_this_what_you_meant.jpg ‏212 KB

  • How can I read the active (plugged in) DAQs and then send that to the device name input on DAQ assist?

    I have a system property node for daqmx but it does not let me change it to read when i right click on it. I am trying to have my program detect the name of the daq that is plugged in to the PC and then send that to daq assistant so that it will run properly wiithout me manually having to change the device name every time i switch hardware.
    Solved!
    Go to Solution.

    labview12110 wrote:
    Im just frustrated that the only function I have is to get a list of things that I can't do anything with. MAX knows which is active can I call it up somehow?
    You have do do programming.  That is what LabVIEW is.  MAX gives you all the tools to do everything you want and much more just program it to do what you want.
    Attached is a VI that I think does what you want.  I looks at all of your devices and returns the first non simulated one.  Apparently this list already excludes devices not connected to the system.
    Unofficial Forum Rules and Guidelines - Hooovahh - LabVIEW Overlord
    If 10 out of 10 experts in any field say something is bad, you should probably take their opinion seriously.
    Attachments:
    Find Non Simulated Device.vi ‏6 KB

Maybe you are looking for

  • Using Lightroom in a group/corporate environment

    I've been excited in hopes that Lightroom would solve my department's problems with photo organization, but I didn't initially realize that it was not at all designed with multiple users in mind. So here are my questions: - Has anybody successfully s

  • My app has disappeared  how do I recover?  can I?

    My Numbers app has disappeared.  Can I recover it?  how?

  • Debit / credit entry

    Dear All,              When we create a debit / credit entry for vendor with reference to a P.O. due to some price difference in P.O. & bill of vendor,the amount which pass thru debit / credit entry will load on material price. if yes then please giv

  • Changing Color Of Console Cursor

    I've searched for about five hours trying to uncover the method of changing the color of the console cursor in Linux. Specifically I'm not trying to change the color of the cursor in terminals, I know how to do that, but I don't know how change them

  • What is a Pre-query?

    What is a Pre-query? Regards,