Page 1 of 1

New to php - need urgent help

Posted: Sun Sep 25, 2011 1:29 am
by san-migel
Hello,
I am trying to make an application -
this is an assignment, and I have to do it as asked -
1) building a user interface on a web server (PHP) which will contain a text box and a submit button.
2) after the user will insert a message and will click the submit - the PHP web server will send the message
text to the backend server by calling a web service
3) the backend server should save or modify an xml file that is located in the backend server with the text message.

q1 - How do I call a web service in PHP?
q2 - In what way is this done? (if someone has an idea)

more ideas, questions and answers will be welcomed, thanks...

Re: New to php - need urgent help

Posted: Sun Sep 25, 2011 5:03 am
by Neilos
You have two servers yes? and you use php to generate a message on the webserver which is sent to the other server using SOAP (or similar)? then the backend server saves the message in an xml file?

Re: New to php - need urgent help

Posted: Sun Sep 25, 2011 1:58 pm
by califdon
What resources has the instructor provided to the class to complete this assignment? Having taught computer classes in college for nearly 10 years, I can't imagine any instructor just throwing out such an assignment without there having either been some classroom work, or material in a textbook, or a list of reading material, or something bearing on the assignment. My best advice is for you to use the resources provided, because if you rely on some other way to complete the assignment, it will almost certainly not be the solution that the instructor is looking for from you. There are always several approaches to a programming task and if the instructor is trying to teach one of them, your coming up with a different one will not satisfy the assignment.

Re: New to php - need urgent help

Posted: Thu Sep 29, 2011 8:09 am
by san-migel
Neilos wrote:You have two servers yes? and you use php to generate a message on the webserver which is sent to the other server using SOAP (or similar)? then the backend server saves the message in an xml file?
FIrst of all I want to say I'm sorry if some of the things will not be right, I'm new to this and not so much in control of the theoretic knowlege.

I'm not sure if I have two servers - in the assignment it's written the php5 web server calls a web service in the tomcat v6 backend server. does this mean that there are two?

I use php to take an input from the user and then call with the script a remore procedure call in the backend server - using xml-rpc.

the backend server should indeed save the message\string in an xml file.

Just to let you know the background. in the end (I guess, it's not written in the assignment) this is going to be a skeleton for a facebook application that asks for a message from the user and then keeps it in an xml file somewhere.

I succeded deploying this tutorial http://d-h-n.de/blog/?p=618, but I can't seem to understand the transformation from building a client in java to building it in php. I guess that eclipse gives some shortcuts that I need to do manually.
like where to put the files and stuff like that, if someone knows how to do this (all the process or relavent parts) or knows of a tutorial which explains this,
please help.
thanks...

Re: New to php - need urgent help

Posted: Fri Sep 30, 2011 4:53 am
by tazee
have you succeeded communicating between the two servers?

Re: New to php - need urgent help

Posted: Sat Oct 01, 2011 7:24 am
by san-migel
tazee wrote:have you succeeded communicating between the two servers?
I did. but only with the help of eclipse. NOw I'm stuck with finding out how to use - getRealPath.
how do I make a servletContext instance, to perform this method?

Re: New to php - need urgent help

Posted: Sat Oct 01, 2011 7:51 am
by Neilos
san-migel wrote: by calling a web service
This says to me that there is not necessarily two physical servers but there is a definite detachment between the processes that occur (so functionally it is as if there is two servers, even if there is not), it says to me that it is not good enough to use http POST, if you are allowed to use POST then this is a very simple problem, but I don't think you are supposed to use POST. It is difficult to say what it is though that you are supposed to do as you do not give us enough information on what you have been told to do.

As califdon says, you need to see what you have been taught to do, or ask fellow students how you should approach the problem, because at the moment there are a million different possible ways to approach this using different techniques and protocols and we do not know which to use?! lol

Currently there are a few inconsistencies in your question too...
san-migel wrote: building a user interface on a web server (PHP) which will contain a text box and a submit button.
isn't very clear, I don't see why you would need php for this (unless the form contains some dynamic content, but you haven't mentioned this functionality), you may need php for handling the submitted message which I think this says...
san-migel wrote: after the user will insert a message and will click the submit - the PHP web server will send the message
And then this...
san-migel wrote: to the backend server by calling a web service
Which web service?

This...
san-migel wrote: the backend server should save or modify an xml file that is located in the backend server with the text message.
Is the only bit I think that I fully understand lol.
san-migel wrote: FIrst of all I want to say I'm sorry if some of the things will not be right, I'm new to this and not so much in control of the theoretic knowlege.
I don't think anyone fully knows how they are going to deal with a programming problem until it has been solved ^^ and even then we wonder how the heck we actually did it! But you do need to be more specific :wink: