| View previous topic :: View next topic |
| Author |
Message |
Chris_B
Joined: 01 Jul 2009 Posts: 2
|
Posted: Wed Jul 01, 2009 2:55 pm Post subject: Electronic Data Interchange and Web Services |
|
|
| Hi, I am willing to develop aweb application using PHP on Netbeans platform for tracking purpose. The application should be able to request and receive data in XML format from a remote application, using EDI or Web Services. Is there any plugin or framework that can help me do this quicker? any link, any howto or any guide you guys can redirect me to? Sorry if this is not the right place to ask, if so just let me know where I should. Thanks |
|
| Back to top |
|
 |
Filip Zamboj Posted via mailing list.
|
Posted: Wed Jul 01, 2009 3:20 pm Post subject: Electronic Data Interchange and Web Services |
|
|
Hi.
I don't know about any but it looks like you don't even need any. I'd
use standart php xml libraries to parse generated xml and your remote
application can create xml file on a request. Or did you mean something
else?
-------------
Filip Zamboj
Sun Microsystems
http://www.netbeans.org/community/issues.html
http://qa.netbeans.org
Chris_B wrote:
| Quote: | Hi, I am willing to develop aweb application using PHP on Netbeans platform for tracking purpose. The application should be able to request and receive data in XML format from a remote application, using EDI or Web Services. Is there any plugin or framework that can help me do this quicker? any link, any howto or any guide you guys can redirect me to? Sorry if this is not the right place to ask, if so just let me know where I should. Thanks
|
|
|
| Back to top |
|
 |
Chris_B
Joined: 01 Jul 2009 Posts: 2
|
Posted: Wed Jul 01, 2009 5:04 pm Post subject: |
|
|
| Thanks for the post Filip. I know I can do http requests to get data from an application using web services and I get the answer in xml format. It is the first time I am playing with that. Is it the same when dealing with EDI standard? So both generate xml files? So my app will receive an xml file after the requests and will use xml parser library integrtaed in the netbeans platform to retrieve the data? Just wanted to have more info on the matter before getting into it. Any starting link so I can dig into and start dvelopping? Any help will be appreciated. |
|
| Back to top |
|
 |
Filip Zamboj Posted via mailing list.
|
Posted: Wed Jul 01, 2009 8:37 pm Post subject: Electronic Data Interchange and Web Services |
|
|
Chris_B wrote:
| Quote: | Thanks for the post Filip. I know I can do http requests to get data from an application using web services and I get the answer in xml format. It is the first time I am playing with that. Is it the same when dealing with EDI standard?
| I don't know almost anything about EDI but if you want you can pick up
topics and ask concrete questions so I'll be able to answer on something.
| Quote: | So both generate xml files?
| You don't need both application to generate XML files if you want to
make one-way transfer via XML. Let's have entity W as webservice and P
as PHP application that is processing data. You have more ways how to
get remote data from W to P. If you need to do it both ways I'd start
with one way transfer and once this works then do the other way.
basically:
P -> send a request to generate XML with data -> W
W -> I generated data -> P
P says: cool, but where are those data??? Depends on implementation
here. Either they are generated as web page with valid header and you
can read that page through web or they are stored as file on the server.
Your decision should consider security risks mainly. You can use almost
whatever you want. For example scp to make it secure.
P says: cool data are stored on public accessible server as xml file
P -> download XML file to local folder -> W
W -> sending data -> P
P -> transfer OK; closing connection -> W
P -> I can parse data because I know the structure of XML file (pay
attention to encoding. use utf-8 if possible)
P -> I'll use php standard libraries to parse data
(http://cz2.php.net/manual/en/book.xml.php)
P -> I parsed data and saved to database or displayed as a web page!!
Wohooou, I can get a beer now!!
| Quote: | So my app will receive an xml file after the requests and will use xml parser library integrtaed in the netbeans platform to retrieve the data?
| Nop! Netbeans are providing just interface that helps you to write. XML
parser is from php or you may look up on the internet if you want
something else (I'd give a try), I'm sure you will find some libraries
that will help you to parse data easily. Or some rpc libraries, maybe
| Quote: | Just wanted to have more info on the matter before getting into it. Any starting link so I can dig into and start dvelopping? Any help will be appreciated.
| http://php.net/manual/en/book.xml.php
http://blogs.sun.com/netbeansphp/
http://wiki.netbeans.org/HowToConfigureXDebug if you want to use php
debugger
http://www.w3.org/XML/ for XML standard
consider this part of simple code to parse xml data in .gz. I definitely
recommend you to read more about that on php.net to get some ideas and
overview and you will be able to create XML that reflect your needs.
function parse() {
$data = '';
$this->parser = xml_parser_create("UTF-8");
xml_set_object($this->parser, $this);
xml_set_element_handler($this->parser, 'startXML', 'endXML');
xml_set_character_data_handler($this->parser, 'charXML');
xml_parser_set_option($this->parser, XML_OPTION_CASE_FOLDING,
false);
if (!($fp = gzopen($this->filename, 'rb'))) {
$this->error("Cannot open file: {$this->filename}");
return;
}
while (($data = fread($fp, 8192))) {
if (!xml_parse($this->parser, $data, feof($fp))) {
//echo($data);
$this->error(sprintf('XML error at line %d column %d',
xml_get_current_line_number($this->parser),
xml_get_current_column_number($this->parser)));
break;
}
}
gzclose($fp);
}
Good luck and write back if something is not clear.
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|
|