Write To A URL And Communicate With A Host Server

The java.net.URL is the package we use to read from and write to existing web pages. I have a Java program that imports the java.net.URL and reads and extracts some information from web pages. However, it is only the latter half of the task.
How does a Java program interact with; for example, cgi-bin scripts, on the server side provide that I have no idea about the contents of the cgi-bin scripts?
What I mean is that:
Many HTML pages contain forms-- text fields and other GUI objects that let us enter data to send to the server. After we type in the required information and initiate the query by clicking a button, the Web browser writes the data to the URL over the network. At the other end, a cgi-bin script (usually) on the server receives the data, processes it, and then sends us "a response", usually in the form of a new HTML page. As I stated in the beginning of this post, I have prepared a Java program to read the responding HTML page.
My question is regarding the first half of the process. How do I feed data in my Java program that initiate the query (instead of manually entering data in the text field) over the network for the host server to process? And then the Java program continues its work in reading the HTML page returned by the server? Provided that I do not know what kind of the program the hosting server uses to process the query.

This is my problem. I do not have any idea about the program on the hosting server that processes the query and returns to output HTML webpage. I mentioned "cgi" just to give an example. Not to mention whether the program on the hosting server uses "GET" or "POST".
Usually, we go to; for example, http://www.yahoo.com, and fill out its text field to make a query and then the yahoo returns a HTML page in response to our query.
My task is to write a Java program to communicate with http://www.yahoo.com. I have to submit the query string in my Java program. I have no idea about what yahoo uses to process my query and my Java program must scan the HTML web page returned by the yahoo to pick up certain information from that page.

Similar Messages

  • What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?

    What is available on new Windows servers that allow you to write scripts that can work directly with Windows, SQL Server, and Exchange Server?
    a. PowerShell
    b. isql
    c. osql
    d. sqlcmd

    All questions seem to be from the interview or a test. I think I even took this test once, it's KForce test.
    For every expert, there is an equal and opposite expert. - Becker's Law
    My blog
    My TechNet articles

  • Can Oracle run in real time OS(such as PSOS) and communicate with data server by OCI?

    Hi, all!
    i have a question to get your help! now my oracle client running in SUN solaris communicate with oracle data server by OCI(oracle call interface). In future, my client system will port to embeded system that will use real time OS, such as PSOS, so i'm afraid that is OCI communicating with data server ok in PSOS environment??? Is there a special driver or OCI lib for PSOS?
    thanks very much!!!
    null

    I have no idea which platforms the Oracle client has been ported to. If there exists an Oracle client for PSOS, then you should have no problem with OCI there. If there's no Oracle client for PSOS, then you won't be able to make OCI calls.
    Regardless, this probably is a question better addressed to Oracle sales rather than to an ODBC forum.
    Justin

  • Error: Unable to communicate with the Reports Server

    The configuration I am working with is:
    * Oracle 8.1.6 DB on a Unix machine
    * Oracle Reports 6i on an NT machine
    * Microsoft IIS web server
    I have successfully tested my reports during the development phase of my project. Unfortunately, now that it is considered production and is available to upwards of 30 people, I am getting the following error message after verifying the server is up and after a numerous reports have been served:
    Error: The requested URL was not found, or cannot be served at this time.
    Oracle Reports Server CGI - Unable to communicate with the Reports Server.
    After receiving this message I noticed that the Report Server service is down and the log only indicates that it "shut down immediately". (no ORA messages) I tried restarting the service, but after serving one report, it would shut down again with the same message.
    I am wondering if it is a problem related to the cache. I used the default of 50M in the config file, but when the cache directory reaches 50M, the problem seems to appear. I then deleted approx. 30M of files from the cache directory and the Report Server service appeared stable. I changed the cache limit to 1M to see if there was a problem with the cache being so big. All appeared well for the first few hours of operation but then the Report Server service shut down again and upon restart crashed within a minute or two (usually as someone tests a report, it crashes again).
    Do I have a configuration problem? Has anyone seen this problem? Thanks in advance.

    Hi,
    I just found out that if i give
    http://localhost/cgi-bin/rwcgi60.exe?key1
    where key1 is a key mapping file that contains the report name,username and pwd for the database and desformat...etc..
    the report pulls out fine with the correct data..
    i am stunned...
    while none of the other commands like
    http://.../rwcgi60.exe
    or
    http://..../showenv?server=repserver
    or any other usual command doesnt work...
    anybody faced this before??
    Thanks.

  • Oracle reports 6i error unable to communicate with the reports server

    Hi,
    I have followed the steps for running oracle reports server 6i..i am using win2k3 and IIS6.0
    i have checked tnsnames.ora and sqlnet.ora and everything looks good..
    when i try
    http://localhost/cgi-bin/rwcgi60.exe
    i get a page called User Database Authentication and asks for username,password and database..instead of the help page that should be displayed..
    when i enter those values nothing happens for the first time and the same page is displayed again..when i enter it again i am getting this error
    url requested not found or cannot be served at this time
    oracle reports cgi: unable to communicate with the reports server
    any help would be grateful..
    Thanks.

    Hi,
    I just found out that if i give
    http://localhost/cgi-bin/rwcgi60.exe?key1
    where key1 is a key mapping file that contains the report name,username and pwd for the database and desformat...etc..
    the report pulls out fine with the correct data..
    i am stunned...
    while none of the other commands like
    http://.../rwcgi60.exe
    or
    http://..../showenv?server=repserver
    or any other usual command doesnt work...
    anybody faced this before??
    Thanks.

  • The updater has been unable to communicate with the update server for at least 1h.

    Hi All,
    there is a warning message on one of my IronPort C300V
    Version: 8.0.1-023
    The error message is mention below
    "The updater has been unable to communicate with the update server for at least 1h."
    please suggest the issue and steps to resolve the problem or suggest that it is very critical so can i open the cisco tac call.
    Thanks ,
    Madhuraj

    If you continue to receive this error please check that the virtual appliance is configured to use the dynamichost for updating:
    myesa_2.local> updateconfig
    Service (images): Update URL:
    <ommitted for brevity>
    []> dynamichost
    Enter new manifest hostname : port
    [update-manifests.sco.cisco.com:443]>
    Once 'dynamichost' is entered, the current dynamic host in use will be displayed in the prompt [ ]>, as seen above. 
    You will need to verify that the appliance - escpecially if a virtual (VESA) - is using the correct host.
    Steve
    Cisco Content Security - Email Security

  • DMZ Ports to Communicate with SCCM Primary Server

    Hello,
    I have searched and came to know that on firewall, following ports should be open for DMZ to communicate with SCCM primary server 
    HTTP 80 and 443
    8530
    TCP 10123
    TCP 135TCP 445
    We are planning to implement a software on DMZ server which should communicate with SCCM primary server.
    Do the above ports work for communication from DMZ to Primary or if there are more ports required for it?
    Is it possible to achieve this without the SCCM client installed on the DMZ server as i would like the software to communicate via its own methods but the required ports should be open.

    Could you please provide the WMI and SQL ports which would be required.
    If we talk about generically, Are below ports enough for a DMZ server to communicate with the primary site server ?
    HTTP 80 and 443
    8530
    TCP 10123
    TCP 135TCP
    445

  • Can't communicate with other hosts from primary domain.

    Hi all, I add vsw0 as below:
    ldm add-vsw net-dev=e1000g0 primary-vsw0 primary
    ifconfig vsw0 plumb
    ifconfig e1000g0 down unplumb
    ifconfig vsw0 (ipaddressofserver) netmask 255.255.224.0 broadcast + up
    mv /etc/hostname.e1000g0 /etc/hostname.vsw0
    init 6
    but now I can't communicate with other hosts from primary domain,if I plumb and up e1000g0 and down vsw0 ,everything is OK,what's wrong with it?Thanks.

    This is greate!I replaced e1000g0 with vsw0 now.
    Could ldm automatic update the ldm configuration parameters?I created a file for the virtual disk,the output of ldm list-bindings as below:
    ......................ignore.............................
    Vdisk: disk0 vol0@primary-vds0
    service: primary-vds0 @ primary
    ......................ignore.................................
    but when I updated some other parameters such as vsw,vnet,the vol0 became:
    .................ignore.........................
    Vdisk: disk0 primary-vds0-vol0@primary-vds0
    service: primary-vds0
    .......................ignore........................................
    and the same time the primary-vds0-vol0 link with /dev/zvol/rdsk/domdisk/dom1,so the guest domain couldn't get the boot disk,I had to update it manunally.
    Did you have the same issue?
    Greetings fenglimian.

  • CLI104 Unable to communicate with the administration server:

    i am doing a glass fish clustering with load balancer plugins using SJWS7.0 as the loadbalancer.
    i installed glassfish v2.1 and set up a cluster with a single node and single instance
    and i did all the steps as per this document
    https://glassfish.dev.java.net/javaee5/build/GlassFish_LB_Cluster.html
    i did all the steps with out any errors.
    but when i am trying to run the commad <websrvr_install_dir>/bin/wadm deploy-config --user=<websrvr_admin_user> <websrvr_instance_config>
    i am getting following errors
    CLI104 Unable to communicate with the administration server: Unable to connect t
    o admin-server. Please check if the server is up and running and that the host
    and port provided are correct.
    i don't how to fix this error , i search a whole day for fixing this errors.now i am waiting for help .please help me to fix this one
    Thanks and Regards

    The glassfish document that you mentioned does not provide any instructions to start the web server's administration server.
    Could you verify that the web server's administration server is indeed running? Do the following to start web server's administration server:
    $ <websrvr_instance_dir>/admin-server/bin/startservAfter that step try out the deploy-config command as described in the document.
    HTH.

  • CBS failed to communicate with some other server.

    Dear All,
    We are facing this error when we are trying to activate a request in
    NWDS & trying to check in.
    Error:Activation failed: CBS Server Error: CBS failed to communicate
    with some other server.( internal code: COMMUNICATION_ERROR)
    Just for your information, we had changed the password for nwdi_cmsadm
    few days back and then followed a note896427 and then had fixed the
    error.
    The NWDI_CMSADM password problem was solved and the transports were
    working very fine till today. But today afternoon when the developer
    tried to activate the request in NWDS, he got this error. Can you
    please let me know the problem.
    We are stuck and not able to go ahead.
    Thanks in advance.
    Warm Regards,
    Rajeet

    Hello,
    I am getting this error :
    CBS Server Error: CBS failed to communicate with some other server( internal code: COMMUNICATION_ERROR)
    while importing ESS into Dev. I have a user created called cmsadmin and has all the permissions/roles assigned. other files are already imported (epbuildt, pcuigp,epbuildt,sap-jtechs, sap-jee). Only this file is failing.
    I have seen the Notes about user/password upgrade. But we are on 04s sp14. and i have this user cmsadmin .
    Please advise.
    Thanks,
    Anil.

  • MCTS 70-466 Implementing Data Models and Reports with Microsoft SQL Server 2012

    I am searching for training kit for Exam 70-466 (Implementing Data Models and Reports with Microsoft SQL Server 2012) but I think is not published yet. I was expecting its release in Jan or Feb 2014. Would any one can tell me its release date or any place
    where I can find this book.
    Thanks
     

    Hi Azhar lqbal Gondal,
    According to your description, since the issue regards training and certification,
     I suggest you post the question in the Learning forums at
    http://social.technet.microsoft.com/Forums/en-US/home?category=learning. It is appropriate and more experts will assist you. If you have a specific technical question about Microsoft SQL Server,
     you can visit and post your question on  the SQL Server Forum.
    There is some detail about Exam 70-466 Implementing Data Models and Reports with Microsoft SQL Server 2012, you can review the following articles.
    Exam content can be found here:
    http://www.microsoft.com/learning/en-us/exam-70-466.aspx
    http://borntolearn.mslearn.net/certification/database/w/wiki/525.466-implementing-data-models-and-reports-with-microsoft-sql-server-2012.aspx#fbid=Mn-t6aRhs-H
    Regards,
    Sofiya Li
    Sofiya Li
    TechNet Community Support

  • How can I write VISA in labview to communicate with instrument using RS485

    my instrument has a Modbus communication procotol, how can I use VISA write or read to communicate with the instrument? Thanks!

    RS485 is simply a physical-layer protocol defining pinouts, signal levels and the like. To make the connection you need either an RS232-RS485 converter (check with BlackBox) or an RS485 serial IO card (check with NI). Either way, there should be no changes required to you Modbus drivers or other software.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Right way to communicate with a socket server (TCP/IP)

    Hi,
    I used to write data from my J2ME socket client to a J2EE socket server with writeUTF(). In this way I can send (and receive) directly Strings.
    When I need an XML file I ask the server with something like os.writeUTF(GIVE_ME_XML_FILE) and I use an XML parser with this socket InputStream.
    I was wondering if it's the right way to proceed ....?
    How do you guys communicate with a server when you need "to talk" a lot ? Do you use only HTTP requests or (if you are allowed to) do you use Socket with writeUTF ?
    Just to know if I'm completely wrong....and if I gonna have unsolicited issues ...
    Thanks..

    AdrienD wrote:
    When I need an XML file I ask the server with something like os.writeUTF(GIVE_ME_XML_FILE) and I use an XML parser with this socket InputStream.
    I was wondering if it's the right way to proceed ....?No, it is not. Read the writeUTF api docs, and you'll know why!
    How do you guys communicate with a server when you need "to talk" a lot ? Do you use only HTTP requests or (if you are allowed to) do you use Socket with writeUTF ?There is answer to this question. it al depends on what data gets send where, how often, and how large..

  • Error 1101 - Cannot communicate with Experion OPC Server

    Hello,
    I am having an issue whereby I cannot Read/Write to an Experion OPC Server through Labview and Datasocket, and get Error 1101.
    The Program is below.
    - I have been able to connect to Experion with another OPC Client (INAT) without any issues.
    - The error says I lack the privaleges, but if I follow the instructions and change these priviledges via Datasocket Server Manager, it makes no difference.
    - We are trying to run this program on a Labview 2011 and Windows 7 system.
    - I have tried running this same program on a WinXP computer with Labview 2009. I had to save it for previous versions, but when I run it, it comes back with a 'Generic Error', whatever that means.
    Can anyone help me solve this problem and steer me in the right direction.
    Kind Regards,

    Have any users found a remedy for this issue?
    I am having the same problem.  I have a very simple network set up where I want to use DS in LabView on one computer (192.168.1.101) to read from an OPC server on another computer (192.168.1.1).  The OPC server, DCOM permissions, etc. are all correctly configured, as I can use a third party OPC client to view the server tags and values on the remote PC from my LabView PC. 
    I am using the "Monitor OPC Items with DataSocket.vi" example VI, just specifying a tag from my existing remote OPC server as an initial test.  I can browse to and select the tag on the remote computer that I wish to read in LabView using the "DataSocket Select URL.vi".  However, after selecting the tag and passing the URL to the "DataSocket Open" block, I receive Error 1101.  (Same occurs if I just directly pass the URL string to the DS Open block.)
    I have added "localhost", "everyhost" and "192.168.1.1" to "DefaultReaders", "DefaultWriters", and "Creators" groups in the DataSocket Server Manager.  I have stopped and re-started the DataSocket Server, and even rebooted the entire PC, but the error persists.
    The specific error text is:
    Error 1101 occurred at DataSocket Open
    LabVIEW: (Hex 0x44D) Insufficient privileges to read, write, or create an item in the DataSocket Server.  Use the DataSocket Server Manager to configure these privileges.
    It seems as though this should be an easy fix, given that the OPC server is readily readable by an OPC client.  I would appreceate any help, as would mkenneday, if they haven't already solved their issue.
    Thanks,
    -Brandon

  • Tunneling and problem with unknown host exception

    hello! i've got a problem with https. i use jdk 1.5.0, jboss-4.0.4.ga-patch1, soap.
    and i'm going crasy.. i've testet my client code at our network and it works fine. but if i want to get jobs from the server of our customer, my client throw an "unknown host exception: firm".
    i wonder why it hasn't the full host. the url may look like this: https://firm.sub.com:443/ and while the client connects to the server, i depugged it and the host is correct: firm.sub.
    but after the connection, when the client want to get something from the server (when it wants to communicate with the server over soap) it crashs.
    my client code looks like this:
    private ClientInterfaceEndpoint getClientInterface() throws ServiceException {
    QName serviceQName = new QName(DOCSERVER_NAMESPACE, CLIENT_INTERFACE_SERVICENAME);
    URL wsdlUrl = getClientInterfaceWsdlUrl();
    log.info("*******WSDLURL host: " + wsdlUrl.getHost()); // out: firm.sub
    log.info("*******WSDLURL port: " + wsdlUrl.getPort()); // out: 443
    URL mapping = getClass().getClassLoader().getResource("META-INF/DocumentServer_Mapping.xml");
    log.info("*******MappingURL path: " + mapping.getPath());
    if (wsdlUrl.toString().toLowerCase().contains("https")) {
    if (null == getConfig().getTruststore() || getConfig().getTruststore().equalsIgnoreCase("")) {
    throw new RuntimeException("No or incorrect TruststorePath in the docclient-config");
    File tmp = new File(getConfig().getTruststore());
    if (!tmp.isFile() || !tmp.canRead()) {
    throw new RuntimeException("The truststore at the 'TruststorePath' isn't a file or can't be read.");
    System.setProperty(SYS_PROPERTY_KEY_TRUST, getConfig().getTruststore());
    System.setProperty(SYS_PROPERTY_KEY_TRUST_PW, config.getTruststorePass());
    ServiceFactoryImpl factory = null;
    factory = (ServiceFactoryImpl) ServiceFactory.newInstance();
    Service clientInterfaceService = null;
    try {// create the service for the ClientInterface
    clientInterfaceService = factory.createService(wsdlUrl, serviceQName, mapping, new URL(config.getServerURL())); //, new URL(config.getServerURL())
    log.info("*******ClientInterFaceService WSDL URL Host: " + clientInterfaceService.getWSDLDocumentLocation().getHost()); // out:firm.sub
    log.info("*******ClientInterFaceService WSDL URL Port: " + clientInterfaceService.getWSDLDocumentLocation().getPort()); // out: 443
    } catch (ServiceException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (MalformedURLException e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    } catch (Exception e) {
    log.error(e.getMessage());
    throw new RuntimeException(e.getMessage());
    }// getting the ClientInterfaceEndpoint
    ClientInterfaceEndpoint clientInterface = (ClientInterfaceEndpoint) clientInterfaceService.getPort(ClientInterfaceEndpoint.class);
    return clientInterface;
    protected URL getClientInterfaceWsdlUrl() {
    URL url = null;
    String urlString = getConfig().getServerURL() + CLIENT_INTERFACE_URI + "?wsdl";
    Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
    Properties properties = System.getProperties();
    String handlers = System.getProperty(SYS_PROPERTY_KEY_PKGS);
    if (handlers == null) {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS);
    else {
    properties.put(SYS_PROPERTY_KEY_PKGS, SYS_PROPERTY_VALUE_PKGS.concat("|").concat(handlers));
    try {
    url = new URL(urlString);
    log.info("*******URL host: " + url.getHost());
    log.info("*******URL port: " + url.getPort());
    log.info("*******URL path: " + url.getPath());
    } catch (MalformedURLException e) {
    log.fatal("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString);
    throw new RuntimeException("DocumentProvider SOAP configured incorrectly. DocServer URL malformed: " + urlString, e);
    System.setProperties(properties);
    return url;
    }if it's usefull: the customer use a apache server (not tomcat) where a the server is and the client at another system the jboss.
    The customer told me: if i want to connect the client via http i have to tunnel.. maybe i have to tunnel using https too?
    have i to generate the endpoint classes a second time, extra for https?
    or doesn't soap like host like "firm.sub"?
    can anyone help me please?!
    sorry, my english isn't very well...

    sorry, it's not the same error. The output is: Unable to connect to any host due to exception: java.net.socket.exception: java.net.socket.exception: Unregcognized windows socket error: 10106: create.

Maybe you are looking for

  • Changing header in report painter

    Hi All, I have a requirement to change the header(column). I am using the global variable &5PY(Period/Year) in the characterictics value. So it displays an output like 06.2008. But the client needs this to be displayed as June 2008. Kindly help me ou

  • New Condition Table not working in Sales order

    Dear All, I am facing problem in pricing procedure. I have created new condition table(LIFNR & ROUTE), included Vendor(Fwd Agent) and Route in condition table with sales area. I have added that condition table in access sequence and assigned access s

  • Communication channel not present in Communication channel monitoring

    Hi All, We have the communication channel in Integration builder and it is active state. but we are not able to see it in C.C monitoring. and we are not sure whether the channels are started. how can we check whether the channels are started? and why

  • How to import sms and mms data from 6600 to N73

    Hi to all, I'm trying to import all my old data on my nokia 6600, to my new N73 ME, fw rel V 3.0368.0.0.30, because I don't like the idea to lose all my sms and mms from the old phone. I encountered a lot of problems. First thing, the transfer apps o

  • My EMAC G4 has a very loud fan.

    I recently bought my first apple machine - a used emac - running OSX 10.5.8 But the fan is LOUD - not noisy - I mean it's sounding like an air-conditioning unit on medium and makes listening to any music uncomfortable. I've read that if I installed O