Java techlogies versus PHP

Hello,
we will have big web project. And now I must choise techlogies. All projects were create with PHP.
Now I think change technology, because I think PHP will small for this project. This project can have more that 1000 users one time. This site will have chat system, and users will often make requests.
Can I say, what Java will be better decision in this project?
Can you give examples where Java better in big projects?
I think about servlets and EJB.
I will be grateful for answers.

PHP or Java?
The basic difference between Java and PHP is that with Java you can have actual object model underneath - n-tier application. That comes handfull when you handle a lot of users and various datasources.
Another thing is that with use of object models like EJB or COM+, .NET you can use transaction framework already built into the system or object pooling (Here maybe I can mention connection pooling - in PHP I think each page opens its own connection (In java the same connection can be used by many clients)). I won't mention the separation od data and business logic in this level.
In general you also can test the whole application, which I'm not sure if you can with PHP.

Similar Messages

  • Java Front End, PHP Back End

    Hi all, I am trying to create a java front end with a php back end. Using a tip from Core Java Technologies Tech Tips (http://java.sun.com/developer/JDCTechTips/2004/tt0210.html#2). I tried to convert their code from a command line to a GUI and have gotten preaty far but it is only allowing me to get one row of data from the php file. Here is my code so far:
    package test;
    import java.net.URL;
    import java.net.MalformedURLException;
    import java.net.URLConnection;
    import java.io.IOException;
    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    * @author bdeonline
    public class test extends javax.swing.JFrame {
    private static URLConnection connection;
    private String inputLine;
    private static void connect( String urlString ) {
    try {
    URL url = new URL(urlString);
    connection = url.openConnection();
    } catch (MalformedURLException e){
    } catch (IOException e) {
    private String readContents() {
    BufferedReader in = null;
    try {
    in = new BufferedReader(
    new InputStreamReader(
    connection.getInputStream()));
    String inputLine;
    while (
    (inputLine = in.readLine()) != null) {
    return(inputLine);
    } catch (IOException e) {
    return inputLine;
    /** Creates new form test */
    public test() {
    initComponents();
    /** This method is called from within the constructor to
    * initialize the form.
    * WARNING: Do NOT modify this code. The content of this method is
    * always regenerated by the Form Editor.
    private void initComponents() {
    jButton1 = new javax.swing.JButton();
    jScrollPane1 = new javax.swing.JScrollPane();
    jTextArea1 = new javax.swing.JTextArea();
    addWindowListener(new java.awt.event.WindowAdapter() {
    public void windowClosing(java.awt.event.WindowEvent evt) {
    exitForm(evt);
    jButton1.setText("jButton1");
    jButton1.addActionListener(new java.awt.event.ActionListener() {
    public void actionPerformed(java.awt.event.ActionEvent evt) {
    jButton1ActionPerformed(evt);
    getContentPane().add(jButton1, java.awt.BorderLayout.SOUTH);
    jScrollPane1.setViewportView(jTextArea1);
    getContentPane().add(jScrollPane1, java.awt.BorderLayout.CENTER);
    pack();
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
    connect("http://localhost/test.php");
    jTextArea1.setText(readContents());
    /** Exit the Application */
    private void exitForm(java.awt.event.WindowEvent evt) {
    System.exit(0);
    * @param args the command line arguments
    public static void main(String args[]) {
    new test().show();
    // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea jTextArea1;
    // End of variables declaration
    I am preaty new at java, I know PHP preaty well though so something like this could help me out alot. Most of this code was generated with the help of Netbeans.

    I dont see why it would unles it has something to do with your URLConnection being static. setText() is only going to give you one line as well. try
    jTextArea.append(inputLine);
    and make only one declairation of inputLine.
    The only thing that should be static in your code is the main method.

  • Java sha1 and PHP sha1

    Hello to everyone.
    When encoding with PHP using sha1 i do not get the same result as Java's sha1 encoding.
    For example encoding letter 'e' in PHP produces:
    58e6b3a414a1e0[b]90dfc6029add0f3555ccba127f
    whereas in Java it produces:
    58e6b3a414a1e0[b]3fdfc6029add0f3555ccba127f
    Below is the code i am using for both Java and PHP
    String password=pass;
              java.security.MessageDigest d =null;
              try {
                   d = java.security.MessageDigest.getInstance("SHA-1");
              } catch (NoSuchAlgorithmException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              d.reset();
              d.update(password.getBytes());
              String secret = new String (d.digest());
              secret.getBytes();
              StringBuffer sb = new StringBuffer(secret.getBytes().length * 2);
            for (int i = 0; i < secret.getBytes().length; i++) {
                 int b = secret.getBytes() & 0xFF;
    sb.append(HEX_DIGITS.charAt(b >>> 4)).append(HEX_DIGITS.charAt(b & 0xF));
    return sb.toString();     
    PHP Code:
    $str = 'e';
    $str2=sha1($str2);
    echo $str2;Anyone had similar problems and found a solution to them? I cannot see any mistake in the code so any help would be much appreciated.
    P.S: I am running Java 1.4 and PHP 5.1.6 configuration
    Kind Regards
    Christophoros

    Hi,
    I found your reply regarding "Java sha1 and PHP sha1" on the forum and would like to ask another related question.
    I use the following statement to insert username/password to the database:
    INSERT INTO [db_Report].[dbo].[tblLogin]
    ([USERNAME]
    ,[PASSWORD])
    VALUES
    ('test'
    ,HashBytes('MD5', 'password'))
    GO
    In my Java code, however, the following method always return false. I noticed that in the database
    HashBytes('MD5', 'password') returns "0x5F4DCC3B5AA765D61D8327DEB882CF99"
    while
    The the encrypted login password is "[B@13d93f4" in the Java code.
    In this case, how should I check the password, using MessageDigest or not ?
    Many thanks.
    ===============
         {code}private static boolean authenticateUser(String username, String loginPassword){
              boolean authenticate = false;
              Connection con = getDatabaseConnection();
              if (con != null){
                   StringBuffer select = new StringBuffer("");
                   select.append("SELECT password from [db_MobileDetectorReport].[dbo].[tblUserLogin] where username = '"+username+"'");
                   String strSelect = select.toString();
                   try {
                        PreparedStatement ps=con.prepareStatement(strSelect, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
                        ResultSet rsResult = ps.executeQuery();
                        byte[] passBytes = loginPassword.getBytes();                    
                        MessageDigest md = MessageDigest.getInstance("MD5");               
                        byte[] encryptedLoginPWD = md.digest(passBytes);
                        System.out.println("encryptedLoginPWD="+encryptedLoginPWD.toString());
                        if (rsResult.next()) {
                             byte[] databasePWD=rsResult.getBytes(1);
                             authenticate=MessageDigest.isEqual(encryptedLoginPWD,databasePWD);
                   } catch (Exception e) {
                        //TBD
              } else {
                   //TBD
              return authenticate;
         }{code}
    Edited by: happy_coding on Dec 21, 2009 1:39 PM{code}{code}
    Edited by: happy_coding on Dec 21, 2009 1:40 PM

  • Error when using java class in php

    dear all
    when i am using my java class in php page
    i am getting below error
    Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
    Edited by: arun240 on Jul 25, 2008 8:47 AM

    arun240 wrote:
    dear all
    when i am using my java class in php page
    i am getting below error
    Fatal error: Uncaught [[o:Exception]:"java.lang.Exception: Invoke failed: [[o:e24PaymentPipe]]->performPaymentInitialization. Cause: java.lang.NullPointerException Responsible VM: 1.6.0_01@http://java.sun.com/" at: #-9 e24PaymentPipe.performPaymentInitialization(e24PaymentPipe.java:341) #-8 sun.reflect.GeneratedMethodAccessor17.invoke(Unknown Source) #-7 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) #0 [internal function]: Java->__call('performPaymentI...', Array) #1 /home/comhtdocs/hdfcpay/HostedPaymentBuy.php(31): Java->performPaymentInitialization() #2 {main}] thrown in /home/comhtdocs/hdfcpay/HostedPaymentBuy.php on line 31
    Edited by: arun240 on Jul 25, 2008 8:47 AMWell, it seems there's an object (perhaps a PaymentPipe?) pointing to null which you're trying to invoke a method (performPaymentInitialization()?) on. Needles to say: you can do that.
    SomeObject so = null;
    // ... some more code ...
    so.someMethod(); // No can do! A NPE will be thrown!

  • EJB+JSP versus PHP

    What is the advantage of using EJB+JSP for a web ticket selling application instead of using PHP?
    Can Java support more customer hits compare to PHP?
    Is EJB+JSP better than PHP? Why?

    I know both PHP and Java. PHP is a more rapid development tool than Java. Once you know it, it is just easier to make simple pages out of it vs Java. In some ways PHP is easier to develop in and in some ways it is harder.
    There is no real IDE for PHP. There are some tools for real time syntax checking (Komodo) and debugging, but they are not as mature as the pick of current Java IDE's.
    In reverse, there is never a need to restart a server when updating a php file unlike Java. This is not a problem with JSP's, but when you change servlets the server will unload all classes from memory and reload. This is a major pain if you are working on a production server.
    I have created a game clan site with many functions using PHP and an order processing section of someones web site. It is fine for smaller projects and is very fast to develop in, however PHP does not scale as well as Java. A large enterprise system is better suited to using Java.
    Also, PHP is a loosely typed language. This has many nuances that are different from a strongly typed language like java. OOP is definately not as powerful in PHP, as there is no private, protected and public typing of methods and fields. You can make classes and even extend classes, but it is poorly implimented IMO. I did all my PHP OOP style, but did not use any inheritance. The limitations of OOP principles is probably the most restrictive aspect of PHP that I can see.

  • How to upload file from java client to php

    hi
    i am trying to upload/send a file from client using swing/applet
    and receiving it with php code.
    here is the php code which uploads the post file from the client
    $uploaddir = "/home/raghavendra/Documents/";
    $file = basename( $_FILES["uploadedfile"]["name"]);
    echo "file:\n".$file;
    $uploadfile = $uploaddir. $file;
    if (move_uploaded_file($_FILES["uploadedfile"]["tmp_name"],$uploadfile)) {
    echo "File is valid, and was successfully uploaded.\n";
    else {
    echo "File upload failure Possible file upload attack!\n";
    and corresponding different java code which post the
    1)
    public void postmethodTest(String filefrom){
    try{
    String hostname = "localhost";
    int port = 80;
    InetAddress addr = InetAddress.getByName(hostname);
    Socket socket = new Socket(addr, port);
    // Send header
    String path ="/php_prgs/var/www/nsboxng/htdocs/tryupdate.php";
    File theFile = new File(filefrom);
    System.out.println ("size: " + (int) theFile.length());
    DataInputStream fis = new DataInputStream(new BufferedInputStream(new FileInputStream(theFile)));
    byte[] theData = new byte[(int) theFile.length( )];
    fis.readFully(theData);
    fis.close();
    DataOutputStream raw = new DataOutputStream(socket.getOutputStream());
    Writer wr = new OutputStreamWriter(raw);
    String command =
    "POST "+path+" HTTP/1.0\r\n"
    + "Content-type: multipart/form-data, boundary=mango\r\n"
    + "Content-length: " + ((int) theFile.length()) + "\r\n"
    + "\r\n"
    + "--mango\r\n"
    + "content-disposition: name=\"MAX_FILE_SIZE\"\r\n"
    + "\r\n"
    + "\r\n--mango\r\n"
    + "content-disposition: attachment; name=\"datafile\"" ;
    String filename="test.doc\"\r\n"
    + "Content-Type: text/doc\r\n"
    + "Content-Transfer-Encoding: binary\r\n"
    + "\r\n";
    wr.write(command);
    wr.flush();
    raw.write(theData);
    raw.flush( );
    wr.write("\r\n--mango--\r\n");
    wr.flush( );
    BufferedReader rd = new BufferedReader(new
    InputStreamReader(socket.getInputStream()));
    String line;
    while ((line = rd.readLine()) != null) {
    System.out.println("out"+line);
    wr.close();
    raw.close();
    socket.close();
    } catch (Exception e) {System.out.println(e.toString());}
    2)
    public void postMethod(String strURL, String filefrom){
    try {
    String fname = filefrom.substring(filefrom.lastIndexOf("/")+1, filefrom.length());
    File input=new File(filefrom);
    // Prepare HTTP post
    PostMethod post = new PostMethod(strURL);
    // Request content will be retrieved directly
    // from the input stream
    // Per default, the request content needs to be buffered
    // in order to determine its length.
    // Request body buffering can be avoided when
    // content length is explicitly specified
    post.setRequestEntity(new InputStreamRequestEntity(new FileInputStream(input), input.length()));
    // Specify content type and encoding
    // If content encoding is not explicitly specified
    // ISO-8859-1 is assumed
    //post.setRequestHeader("Content-type", "text/xml; charset=ISO-8859-1");
    post.setRequestHeader("Content-Type","multipart/form-data");
    post.setRequestHeader("Content-Disposition", "form-data; name="+fname);
    // Get HTTP client
    HttpClient httpclient = new HttpClient();
    // Execute request
    try {
    int result=httpclient.executeMethod(post);
    // Display status code
    System.out.println("Response status code: " +result);
    // Display response
    System.out.println("Response body: ");
    // System.out.println(post.getResponseBodyAsString());
    BufferedReader console = new BufferedReader(new InputStreamReader(post.getResponseBodyAsStream()));
    String name = null;
    String line = null;
    try {
    while ((line = console.readLine()) != null) {
    System.out.println("output"+line);
    //name = console.readLine();
    catch (IOException e) { name = "<" + e + ">"; }
    // System.out.println("Hello " + name);
    } finally {
    // Release current connection to the connection pool
    // once you are done
    post.releaseConnection();
    catch(IOException e){
    but am getting else condition response from php code
    but if i post with html code it is working fine.
    can anybody help me please where i have to change the code
    please suggest me. am in a big trouble and i have to complete this as soon as possible

    One thread is enough.
    http://forum.java.sun.com/thread.jspa?threadID=5198449
    You could have bumped it instead. Also, you still just posted a junk of unformatted stuff. Furthermore, for HttpClient support ask at an HttpClient mailing list of rorum.

  • Problem in creating a java proxy for PHP web service

    This is a problem in generating a java proxy for a PHP webservice.
    I have a PHP service running on Wamp Server and also a PHP client which is able to call the service.
    The WSDL for the PHP web service is also generated .
    I am trying to create a java proxy using the jdev (10.1.3.0.3) from the wsdl file.
    The wsdl generated by the php program is
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:hellowsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:hellowsdl">
    <types>
    <xsd:schema targetNamespace="urn:hellowsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="urn:hellowsdl#hello" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>After making following changes to the wsdl program, I tried to generate java proxy.
    <definitions name="hellowsdl"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/mywork/hellowsdl.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/mywork/myphpwsdl.wsdll">
    <types>
    <xsd:schema targetNamespace="http://localhost/mywork/hellowsdl.wsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>This is how the java stub file looks like:
    public class HellowsdlBinding_Stub
        extends oracle.j2ee.ws.client.StubBase
        implements demo.mypackage.HellowsdlPortType {
         *  public constructor
        public HellowsdlBinding_Stub(HandlerChain handlerChain) {
            super(handlerChain);
            _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://localhost/mywork/hellowsdl.php");
            setSoapVersion(SOAPVersion.SOAP_11);
            setServiceName( new QName("http://localhost/mywork/hellowsdl","hellowsdl"));
            setPortName( new QName("http://localhost/mywork/hellowsdl","hellowsdlPort"));
         *  implementation of hello
        public java.lang.String hello(java.lang.String name)
            throws java.rmi.RemoteException {
            StreamingSenderState _state = null;
            try {
                _state = _start(_handlerChain);
                if (_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS) != null) {
                    _state.getMessageContext().getMessage().setProperty("DimeEncode",_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
                InternalSOAPMessage _request = _state.getRequest();
                _request.setOperationCode(hello_OPCODE);
                _state.getMessageContext().setProperty("oracle.j2ee.ws.mgmt.interceptor.operation-qname",new QName("","hello"));
                demo.mypackage.runtime.HellowsdlBinding_hello_ReqS _myHellowsdlBinding_hello_ReqS = new demo.mypackage.runtime.HellowsdlBinding_hello_ReqS();
            _myHellowsdlBinding_hello_ReqS.setName(name);
            SOAPBlockInfo _bodyBlock = new SOAPBlockInfo(ns1_hello_hello_QNAME);
            _bodyBlock.setValue(_myHellowsdlBinding_hello_ReqS);
            _bodyBlock.setSerializer(myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer);
            _request.setBody(_bodyBlock);
            _state.getMessageContext().setProperty("http.soap.action", "http://localhost/mywork/hellowsdl");
            _send((String) _getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
            demo.mypackage.runtime.HellowsdlBinding_hello_RespS _myHellowsdlBinding_hello_RespS = null;
            Object _responseObj = _state.getResponse().getBody().getValue();
            if (_responseObj instanceof SOAPDeserializationState) {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)((SOAPDeserializationState)_responseObj).getInstance();
            } else {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)_responseObj;
            return _myHellowsdlBinding_hello_RespS.get_return();
        } catch (RemoteException e) {
            // let this one through unchanged
            throw e;
        } catch (JAXRPCException e) {
            throw new RemoteException(e.getMessage(), e);
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            } else {
                throw new RemoteException(e.getMessage(), e);
    *  this method deserializes the request/response structure in the body
    protected void _readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case hello_OPCODE:
                _deserialize_hello(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SenderException("sender.response.unrecognizedOperation", Integer.toString(opcode));
    * This method deserializes the body of the hello operation.
    private void _deserialize_hello(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
        try {
            Object myHellowsdlBinding_hello_RespSObj =
                myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer.deserialize(ns1_hello_helloResponse_QNAME,
                    bodyReader, deserializationContext);
            SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_hello_helloResponse_QNAME);
            bodyBlock.setValue(myHellowsdlBinding_hello_RespSObj);
            state.getResponse().setBody(bodyBlock);
        } catch (DeserializationException e) {
            if (e.getSoapFaultSubCodeType() == JAXRPCExceptionBase.FAULT_CODE_NONE && e.getSoapFaultCodeType() != JAXRPCExceptionBase.FAULT_CODE_DATA_ENCODING_UNKNOWN) {
                e.setSoapFaultSubCodeType(JAXRPCExceptionBase.FAULT_CODE_BAD_ARGUMENTS);
            throw e;
    public String _getEncodingStyle() {
        return SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding();
    public void _setEncodingStyle(String encodingStyle) {
        throw new UnsupportedOperationException("cannot set encoding style");
    public ClientTransport getClientTransport() {
        return super._getTransport();
    * This method returns an array containing (prefix, nsURI) pairs.
    protected String[] _getNamespaceDeclarations() {
        return myNamespace_declarations;
    * This method returns an array containing the names of the headers we understand.
    public QName[] _getUnderstoodHeaders() {
        return understoodHeaderNames;
    * This method handles the case of an empty SOAP body.
    protected void _handleEmptyBody(XMLReader reader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
    public void _initialize(InternalTypeMappingRegistry registry) throws Exception {
        super._initialize(registry);
        myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_ReqS.class, ns1_hello_TYPE_QNAME);
        myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_RespS.class, ns1_helloResponse_TYPE_QNAME);
    private static final QName _portName = new QName("http://localhost/mywork/hellowsdl", "hellowsdlPort");
    private static final int hello_OPCODE = 0;
    private static final QName ns1_hello_hello_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private static final QName ns1_hello_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private CombinedSerializer myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer;
    private static final QName ns1_hello_helloResponse_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private static final QName ns1_helloResponse_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private CombinedSerializer myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://localhost/mywork/hellowsdl"
    private static final QName[] understoodHeaderNames = new QName[] {  };
    }The errors that are produced are-
    java.rmi.RemoteException: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found
    Kindly help to resolve this.
    Thanks.

    This is a problem in generating a java proxy for a PHP webservice.
    I have a PHP service running on Wamp Server and also a PHP client which is able to call the service.
    The WSDL for the PHP web service is also generated .
    I am trying to create a java proxy using the jdev (10.1.3.0.3) from the wsdl file.
    The wsdl generated by the php program is
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <definitions xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:si="http://soapinterop.org/xsd" xmlns:tns="urn:hellowsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="urn:hellowsdl">
    <types>
    <xsd:schema targetNamespace="urn:hellowsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="urn:hellowsdl#hello" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="urn:hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>After making following changes to the wsdl program, I tried to generate java proxy.
    <definitions name="hellowsdl"
    xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"
    xmlns:si="http://soapinterop.org/xsd" xmlns:tns="http://localhost/mywork/hellowsdl.wsdl" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/" targetNamespace="http://localhost/mywork/myphpwsdl.wsdll">
    <types>
    <xsd:schema targetNamespace="http://localhost/mywork/hellowsdl.wsdl">
      <xsd:import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
      <xsd:import namespace="http://schemas.xmlsoap.org/wsdl/" />
      </xsd:schema>
      </types>
    <message name="helloRequest">
      <part name="name" type="xsd:string" />
      </message>
    <message name="helloResponse">
      <part name="return" type="xsd:string" />
      </message>
    <portType name="hellowsdlPortType">
    <operation name="hello">
      <documentation>Says hello to the caller</documentation>
      <input message="tns:helloRequest" />
      <output message="tns:helloResponse" />
      </operation>
      </portType>
    <binding name="hellowsdlBinding" type="tns:hellowsdlPortType">
      <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http" />
    <operation name="hello">
      <soap:operation soapAction="" style="rpc" />
    <input>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </input>
    <output>
      <soap:body use="encoded" namespace="http://localhost/mywork/hellowsdl" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
      </output>
      </operation>
      </binding>
    <service name="hellowsdl">
    <port name="hellowsdlPort" binding="tns:hellowsdlBinding">
      <soap:address location="http://localhost/mywork/myphp.php" />
      </port>
      </service>
      </definitions>This is how the java stub file looks like:
    public class HellowsdlBinding_Stub
        extends oracle.j2ee.ws.client.StubBase
        implements demo.mypackage.HellowsdlPortType {
         *  public constructor
        public HellowsdlBinding_Stub(HandlerChain handlerChain) {
            super(handlerChain);
            _setProperty(ENDPOINT_ADDRESS_PROPERTY, "http://localhost/mywork/hellowsdl.php");
            setSoapVersion(SOAPVersion.SOAP_11);
            setServiceName( new QName("http://localhost/mywork/hellowsdl","hellowsdl"));
            setPortName( new QName("http://localhost/mywork/hellowsdl","hellowsdlPort"));
         *  implementation of hello
        public java.lang.String hello(java.lang.String name)
            throws java.rmi.RemoteException {
            StreamingSenderState _state = null;
            try {
                _state = _start(_handlerChain);
                if (_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS) != null) {
                    _state.getMessageContext().getMessage().setProperty("DimeEncode",_getProperty(ClientConstants.DIME_ENCODE_MESSAGES_WITH_ATTACHMENTS));
                InternalSOAPMessage _request = _state.getRequest();
                _request.setOperationCode(hello_OPCODE);
                _state.getMessageContext().setProperty("oracle.j2ee.ws.mgmt.interceptor.operation-qname",new QName("","hello"));
                demo.mypackage.runtime.HellowsdlBinding_hello_ReqS _myHellowsdlBinding_hello_ReqS = new demo.mypackage.runtime.HellowsdlBinding_hello_ReqS();
            _myHellowsdlBinding_hello_ReqS.setName(name);
            SOAPBlockInfo _bodyBlock = new SOAPBlockInfo(ns1_hello_hello_QNAME);
            _bodyBlock.setValue(_myHellowsdlBinding_hello_ReqS);
            _bodyBlock.setSerializer(myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer);
            _request.setBody(_bodyBlock);
            _state.getMessageContext().setProperty("http.soap.action", "http://localhost/mywork/hellowsdl");
            _send((String) _getProperty(ENDPOINT_ADDRESS_PROPERTY), _state);
            demo.mypackage.runtime.HellowsdlBinding_hello_RespS _myHellowsdlBinding_hello_RespS = null;
            Object _responseObj = _state.getResponse().getBody().getValue();
            if (_responseObj instanceof SOAPDeserializationState) {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)((SOAPDeserializationState)_responseObj).getInstance();
            } else {
                _myHellowsdlBinding_hello_RespS =
                    (demo.mypackage.runtime.HellowsdlBinding_hello_RespS)_responseObj;
            return _myHellowsdlBinding_hello_RespS.get_return();
        } catch (RemoteException e) {
            // let this one through unchanged
            throw e;
        } catch (JAXRPCException e) {
            throw new RemoteException(e.getMessage(), e);
        } catch (Exception e) {
            if (e instanceof RuntimeException) {
                throw (RuntimeException)e;
            } else {
                throw new RemoteException(e.getMessage(), e);
    *  this method deserializes the request/response structure in the body
    protected void _readFirstBodyElement(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState  state) throws Exception {
        int opcode = state.getRequest().getOperationCode();
        switch (opcode) {
            case hello_OPCODE:
                _deserialize_hello(bodyReader, deserializationContext, state);
                break;
            default:
                throw new SenderException("sender.response.unrecognizedOperation", Integer.toString(opcode));
    * This method deserializes the body of the hello operation.
    private void _deserialize_hello(XMLReader bodyReader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
        try {
            Object myHellowsdlBinding_hello_RespSObj =
                myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer.deserialize(ns1_hello_helloResponse_QNAME,
                    bodyReader, deserializationContext);
            SOAPBlockInfo bodyBlock = new SOAPBlockInfo(ns1_hello_helloResponse_QNAME);
            bodyBlock.setValue(myHellowsdlBinding_hello_RespSObj);
            state.getResponse().setBody(bodyBlock);
        } catch (DeserializationException e) {
            if (e.getSoapFaultSubCodeType() == JAXRPCExceptionBase.FAULT_CODE_NONE && e.getSoapFaultCodeType() != JAXRPCExceptionBase.FAULT_CODE_DATA_ENCODING_UNKNOWN) {
                e.setSoapFaultSubCodeType(JAXRPCExceptionBase.FAULT_CODE_BAD_ARGUMENTS);
            throw e;
    public String _getEncodingStyle() {
        return SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding();
    public void _setEncodingStyle(String encodingStyle) {
        throw new UnsupportedOperationException("cannot set encoding style");
    public ClientTransport getClientTransport() {
        return super._getTransport();
    * This method returns an array containing (prefix, nsURI) pairs.
    protected String[] _getNamespaceDeclarations() {
        return myNamespace_declarations;
    * This method returns an array containing the names of the headers we understand.
    public QName[] _getUnderstoodHeaders() {
        return understoodHeaderNames;
    * This method handles the case of an empty SOAP body.
    protected void _handleEmptyBody(XMLReader reader, SOAPDeserializationContext deserializationContext, StreamingSenderState state) throws Exception {
    public void _initialize(InternalTypeMappingRegistry registry) throws Exception {
        super._initialize(registry);
        myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_ReqS.class, ns1_hello_TYPE_QNAME);
        myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer = (CombinedSerializer)registry.getSerializer(SOAPEncodingConstants.getSOAPEncodingConstants(soapVersion).getURIEncoding(), demo.mypackage.runtime.HellowsdlBinding_hello_RespS.class, ns1_helloResponse_TYPE_QNAME);
    private static final QName _portName = new QName("http://localhost/mywork/hellowsdl", "hellowsdlPort");
    private static final int hello_OPCODE = 0;
    private static final QName ns1_hello_hello_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private static final QName ns1_hello_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "hello");
    private CombinedSerializer myns1_hello__HellowsdlBinding_hello_ReqS_SOAPSerializer;
    private static final QName ns1_hello_helloResponse_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private static final QName ns1_helloResponse_TYPE_QNAME = new QName("http://localhost/mywork/hellowsdl", "helloResponse");
    private CombinedSerializer myns1_helloResponse__HellowsdlBinding_hello_RespS_SOAPSerializer;
    private static final String[] myNamespace_declarations =
                                        new String[] {
                                            "ns0", "http://localhost/mywork/hellowsdl"
    private static final QName[] understoodHeaderNames = new QName[] {  };
    }The errors that are produced are-
    java.rmi.RemoteException: HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found; nested exception is:
         HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 404 Not Found
    Kindly help to resolve this.
    Thanks.

  • Java httpservlet and php

    Hi.
    I'm trying to work out an interface in php for a java http servlet. But i have some problems when i try to redirect my response to the php page.
    Any idea how i can do this (or if i can do this)?

    You cannot redirect the response once output has been
    written to it.
    You may need to redirect client side, with meta
    refresh or javascript.I haven't written anything in the output.
    My servlet is quite simple: it takes some params from the user, does some work with them, and then encapsulate them as attributtes/params for the response. Normally I would write this:
    this.getServletContext().getRequestDispatcher("/gate.jsp").forward(sreq, sres);after i'm done with my processing.
    I was wondering what must I do/use to have the "response" redirected to another address like:
      http://second_server/index.php.As far as I read, I cannot do this with the code line written above. I haven't found any example on how to do this, and, as I have said, I think it's possible (basically it's just working arround the HTTP), but I don't know how to do it....

  • Java SOAP and PHP server

    HI all, I have the follow problem:
    I have created a SOAP server with PHP. The client connection with PHP and with generated local classes for Java, with java.apache.axis.wsdl.WSDL2Java, is working very well and I don't have problems with this.
    But now I try to use my API with the normal calls from JAVA with the direct Call without local classes:
    Here are any sniplets:
    My Method in the wsdl file:
    - <xsd:complexType name="MyMethodRequest">
    - <xsd:all>
    <xsd:element name="username" type="xsd:string" />
    <xsd:element name="password" type="xsd:string" />
    <xsd:element name="partnerid" type="xsd:int" />
    <xsd:element name="signkey" type="xsd:string" />
    </xsd:all>
    </xsd:complexType>
    - <operation name="MyMethod">
    <soap:operation soapAction="urn:MyURN#MyMethod" style="rpc" />
    - <input>
    <soap:body use="encoded" namespace="urn:MyURN" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </input>
    - <output>
    <soap:body use="encoded" namespace="urn:MyURN" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" />
    </output>
    </operation>
    The definition in the PHP file look like this:
    $server->wsdl->addComplexType(
    'MyMethodRequest',
    'complexType',
    'struct',
    'all',
    array(
    'username' => array('name' => 'username', 'type' => 'xsd:string'),
              'password' => array('name' => 'password', 'type' => 'xsd:string'),
              'partnerid' => array('name' => 'partnerid', 'type' => 'xsd:int'),
    'signkey' => array('name' => 'signkey', 'type' => 'xsd:string')
    The server function is recieving an array with all this paramethers:
    function MyFunktion($member)
    // do anything
    Also the Java code:
    String method = "MyMethod";
    Object[] member = new Object[] {username, password, partnerid, signkey};
    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( new java.net.URL(endpoint) );
    call.setOperationName(new QName("urn:MyURN", method));
    call.setSOAPActionURI("urn:MyURN#MyMethod");
    call.setUseSOAPAction(true);
    call.addParameter( "member", XMLType.SOAP_ARRAY, ParameterMode.IN );
    call.setReturnType( XMLType.XSD_BOOLEAN );
    Object[] params = new Object[] {member};
    Boolean ret = (Boolean) call.invoke(params);
    System.err.print(" " + ret);
    System.err.println();
    I compile the class and when I start it, I don't send any data to the server, but why??? What do I made false? The server don't gives an error, but he dont recieve any data from me!
    Thanks for every help:-)
    Best Regards
    Nik

    Hi is there really noone who can help me? I need this so much:-)
    Please help me here:-)
    Thanks!
    Regards
    Nik

  • Is Java better than PHP ?

    Hi
    I see that many large companies on the web which have large websites with a lot of traffic are choosing to use application servers for their sites. Usually the ones they are choosing are j2ee based application servers. I almost never see any large website with a PHP solution, it usually uses servlet/JSP. When i look at smaller sites its usually PHP. What i am wondering is why the large companies choose to use a complex setup of application servers when they could just set up a CMS in PHP which they could just buy from some place, install easily and then they could just start writing articles for example. Why does large companies use this complex solution of application servers instead of PHP which would be a much simpler setup... is it because PHP doesnt scale as well as java or what is it ?
    Could someone please comment on this...

    What i am wondering is why the large companies choose to use a complex setup of application servers when they could just set up a CMS in PHP which they could just buy from some place, install easily and then they could just start writing articles for example.Not all "large" websites are mere CMSs. Of the CMS solutions, the best ones do not run under PHP, thus not all CMS based websites choose PHP.
    Why does large companies use this complex solution of application servers instead of PHP which would be a much simpler setup... is it because PHP doesnt scale as well as java or what is it ?The advantages of PHP are that it is free, easy to understand for beginners, and simple for small applications. It's a natural choice for inexperienced developers.
    The advantages of Java/J2EE are that it is well supported, very structured, and has a massive library of standard and external libraries to support it.
    What's PHP's answer to messaging solutions? To linear programming? To integration with legacy systems? It may well be that PHP doesn't scale, but that's the least of its problems in the enterprise world.
    Your questions sounds suspiciously like "I like PHP, why is Java so complicated?" and the answer is "The complexity exists because sometimes we need it."
    (Edited ambiguity in opening para).

  • Accessing Java HttpServer from PHP;

    Hello all,
    I have created an httpserver using 'com.sun.net.httpserver'. Everything works fine except one thing.
    When i make this simple call from PHP (http://localhost:8081/something outputs an XML file):-
    $url = 'http://localhost:8081/something'; 
    $xml = simplexml_load_file($url); 
    print_r($xml); Nothing appears and it times out after sometime.
    However, while the browser is 'trying' to get the result (from PHP file) if i 'stop' my HttpServer (Java) the result suddenly appears. I am very sure i close all the streams i opened. Does anyone have any idea?
    Thanks
    Neville

    So on doing some debugging i realized that the http thread that started executing may have not exited correctly. That may explain the fact that when i shut the java server down explicitly while the 'php' code waits for some response, the response suddenly appears.
    While creating the server i am using:-
    server.setExecutor(Executors.newCachedThreadPool());In ThreadPoolExecutor.class
    Runnable getTask() { ....
    if (state == SHUTDOWN)  // Help drain queue
        r = workQueue.poll();
    else if (poolSize > corePoolSize || allowCoreThreadTimeOut)
        r = workQueue.poll(keepAliveTime, TimeUnit.NANOSECONDS);
    else
       r = workQueue.take();
    if (r != null)
        return r;
    if (workerCanExit()) {
    ...Using the debugger tool took me to the class ThreadPoolExecutor.class which seems to be the bottleneck; This condition is true (poolSize > corePoolSize || allowCoreThreadTimeOut(=false)) and it starts polling. I think maybe this is causing the problem and if it exited maybe the result would appear. Even if the corePoolSize is more than poolsize it seems to be getting stuck in r = workQueue.take();.
    I dont know how it works ok with a browser but hangs when PHP request comes into the picture. Strange...
    Thanks
    Neville

  • Java Desktop versus Enterprise client

    What is the difference between Java Desktop Application versus Enterprise Applciation client?

    Desktop Applicatoin is local to your computer, it may have connections to the network, such as MS-Word will connect to the internet for updates and help files.
    An Enterprise Application is developed on multiple tiers--local clients, web servers, data servers, and etc. Processing done in an enterprise Applicatoin is distributed amoungst the different tiers.

  • Java Script and PHP Issue

    I am using a JS date picker and it works great all by itself. However when I link it to a  MySQL db the JS no longer works.  Here is my source code below any help would be appreciated.
    Thanks
    Joe
    <?php require_once('Connections/Runin_db.php'); ?>
    <?php
    if (!function_exists("GetSQLValueString")) {
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
      if (PHP_VERSION < 6) {
        $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
      $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;   
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      return $theValue;
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {
      $insertSQL = sprintf("INSERT INTO `time` (`Time 1`, `Time 2`) VALUES (%s, %s)",
                           GetSQLValueString($_POST['Time_1'], "text"),
                           GetSQLValueString($_POST['Time_2'], "text"));
      mysql_select_db($database_Runin_db, $Runin_db);
      $Result1 = mysql_query($insertSQL, $Runin_db) or die(mysql_error());
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Time 1:</td>
          <td><input name="Time 1" type="text" id="Time 1" value="" />
          <a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp" /></a></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Time 2:</td>
          <td><input name="Time 2" type="text" id="Time 2" value="" />
          <a href="javascript:show_calendar('document.tstest.timestamp', document.tstest.timestamp.value);"><img src="images/cal.gif" width="16" height="16" border="0" alt="Click Here to Pick up the timestamp" /></a></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right"> </td>
          <td><input type="submit" value="Insert record" /></td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p> </p>
    <p> </p>
    <p> </p>
    </body>
    </html>

    I would like to know how to do this process.  I would like my students to complete the module and then enter there name in the certificate line.  Then have them enter their email address so that the certificate can be emailed to them and they can print it off.  I would like to have the certificate be a PDF file so they cannot alter the name of the person who took the course.

  • Java BluePrints versus Jakarta

    I created a new Visual Web Pack Application, for source structure I chose Jakarta (the other option is Java BluePrints), because I am going to deploy my application in Tomcat 5.5.17. For server I obviously chose Tomcat 5.5.17.
    Also, I added the BluePrints AJAX components 0.1.1 to the component libraries of my project.
    However when I wanted to drag an Auto Complete Text Field on one of my project's page this turned out to be impossible. I guess because I chose Jarkarta as source structure instead of Java BluePrints.
    Does anyone know how to solve this problem?
    What are the consequences of choosing Java BluePrints as source structure when you want to deploy in Tomcat?
    Thanks,
    Annet.

    Well, the String.replaceAll(String, String) method uses the Java regexp internally, and I'm not sure there's a way to change that. So that at least is one place that will use it. I don't know for sure, but Jakarta's ORO is supposed to be fully compatible with Perl 5, and also supports other regexp types as well, so if you need that aspect of it, then go with Jakarta. I heard some of Java's are a little limited in some capabilities. I can't find any particular pages that refer to any comparisons of them at to compare runtime performance.

  • JSP versus PHP

    Is there anything JSP does better than PHP?

    PHP is a good scripting language, probably the best one. It does the same job as ASP only much better. I would suggest that JSP can actually do a whole lot more than that because you have the full functionality of the programming language behind it rather than being purely designed for web scripting. This gives flexibility and the jsp/servlet/bean architecture also offers far greater options for re-use and extension than php offers.

Maybe you are looking for

  • How to adjust the page size

    I have an indd file with a magazine, 44 pages, format 210 mm. x 275 mm. My problem is that from the beginning I made it in A4 format. This is not a problem for the printing workshop, but it is a problem when I make a pdf file, because it comes out wi

  • Error in Shoppping cart

    Hello SDNers, When I test the service bbpsc02 in SICF, (http://eccserver:8000/sap/bc/gui/sap/its/bbpsc02?sap-client=001) I'm getting the below error: System Messages: Attribute for user BASIS contains errors. Inform system admin. Also for another ser

  • Magic iPad - sound not working, almost

    Hallo - believe it or not. I found a magic iPad (first generation). One day, that iPad did not have sound over the internal speaker, even then knob on the slider disappeared. Only when the headphone were plugged in, it appeared (the knob) and also th

  • Single schema or multiple schemas

    Hello A few years ago I worked on a greenfield project where we were building a system to serve 20 or so different departments with 1200+ users. The approach the existing DBA had taken was to use a single schema for all objects and for all apps. The

  • SCCM 2012 patch compliance issue

    Hi All, In my organization we are facing patch compliance issue. in my clients all patches are installed and sent the state messages to MP.however most of the clients are having 0% compliance are showing in report. in overall compliance report it is