XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 20th, 2003, 07:57 AM
imranlink imranlink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Wazirabad Pakistan
Posts: 41 imranlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 9 sec
Reputation Power: 6
Send a message via Yahoo to imranlink
Question connect to other server

Hi,

We want to get online data of products from supplier web site. The supplier site has sent us XML API reference to connect to there DB server and to download the latest products. Can you please let me know how can i connect to the other server with XML? what playform i needed or any guideline? How can i pass the query to other Db server from XML and catch the Db server response? How can then i save the Db server response in my local DB

Many Thanks,
Imran Khalid
imranlink@hotmail.com

Reply With Quote
  #2  
Old September 20th, 2003, 08:30 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Go ask your supplier the questions about connecting to their service then post their responses here. They're probably running some sort of web service, in which case they may have provided a .wsdl file that you'll be able to use.

What language are you using for this? If it a web service pretty much every major language has libraries that will let you communicate with it.

Reply With Quote
  #3  
Old September 22nd, 2003, 05:16 AM
imranlink imranlink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Wazirabad Pakistan
Posts: 41 imranlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 9 sec
Reputation Power: 6
Send a message via Yahoo to imranlink
Question re: connect to other server

Hi,

I have asked the supplier, and they forward me a guide_imran.pdf file. I am attaching the file with this post. You may also view the online this xml file at

http://www.techbuys.com/imran/guide_imran.pdf

I am not able to understand this api reference sent by the supplier. Can you please help me how to use it to send and receive the request to supplier server?

Many Thanks,
Imran Khalid
imranlink@hotmail.com
Attached Files
File Type: pdf guide_imran.pdf (477.6 KB, 325 views)

Reply With Quote
  #4  
Old September 22nd, 2003, 05:08 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Ok, there a few thing you're going to need to know. First, some basics about http post requests. Each http request is made of up of a header and a body. The format looks something like this:
Code:
POST http://url.to/server HTTP/1.1
Some-header: header value
other-header: header value

this=the&body=of&the=request

The http response is something similar. What you're going to need to do is replace the "this=the&body=of&the=request" with some xml. The response you get back will be similar. Now, as to how you actually submit an http post request with an xml body, that's going to depend on what language you're using. Pick your language, search the forums and google, and if you still need help post a message to the forum that covers the language you're using. If you need any help formatting the xml go ahead and post to this forum.

Reply With Quote
  #5  
Old September 23rd, 2003, 12:12 AM
imranlink imranlink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Wazirabad Pakistan
Posts: 41 imranlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 9 sec
Reputation Power: 6
Send a message via Yahoo to imranlink
Question re: connect to other server

Hi,

We are using PHP 4.x on Windows 2000/IIS server. Please let me know how i have to send the request/response in XML body by using PHP as server side scripting language.

Many Thanks,
Imran Khalid
imranlink@hotmail.com

Reply With Quote
  #6  
Old September 23rd, 2003, 01:12 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
Best bet there is to ask in the php forum. It'll probably involve the curl functions, if you'd like to read the manual. In fact, check the manual first. I'm willing to bet there's an example of what you need somewhere in the comments.

Reply With Quote
  #7  
Old September 23rd, 2003, 01:54 AM
imranlink imranlink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Wazirabad Pakistan
Posts: 41 imranlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 9 sec
Reputation Power: 6
Send a message via Yahoo to imranlink
Hi,

I have worked with curl functions in PHP. We pass them URL and they sent us the response from the site in a variable etc. But in our case we are working with XML and we are not posting URL and some form data to the other server. If you look on the guide_imran.pdf above attached file on the page 14, you will see a programme written to pass the data to the server in XML.

<?XML >
<XML_availability_submit>
<Header>
<UserName>ID</UserName>
...etc

My question is that how i have to do this posting to the server? Where i have to save the above page and how to run it? Is the above page is a header that we have to sent to the other server while using CURL functions?

$LOGINURL = "http://www.domain.com/pagex.php;

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$LOGINURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($ch, CURLOPT_COOKIEJAR, "cookie");
curl_setopt($ch, CURLOPT_COOKIEFILE, "cookie");

$str_page = curl_exec ($ch);
curl_close ($ch);

Reply With Quote
  #8  
Old September 23rd, 2003, 02:57 AM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
I think these two lines should do it:
PHP Code:
 curl_setopt($chCURLOPT_POST,1);
curl_setopt($chCURLOPT_POSTFIELDS,$params); 

where $params is equal the xml you want to send to the server.

Reply With Quote
  #9  
Old September 23rd, 2003, 11:23 PM
imranlink imranlink is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Wazirabad Pakistan
Posts: 41 imranlink User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 9 sec
Reputation Power: 6
Send a message via Yahoo to imranlink
Question re: connect to other server

Hi,

So you mean that i have to post the XML written page in guide_imran.pdf above attached file on the page 14 to the server in the variable $params but what shoud be the value of the URL to send this request?

$LOGINURL = "http://www.domain.com;

Is that will be
$LOGINURL = "https://tdxml.techdata.com:443/xmlservlet;
in our case or any other URL?

On thing more by the property
curl_setopt($ch, CURLOPT_POST,1);
we set the property that we are posting HTML FROM data to the server but in our case i think we are not posting any FORM fields. If we are using CURL fucntions, this mean we can also connect to other server from typing manually URL in our browser. If Yes then what should be the URL we have to type in the browser to send request to the server?

Hi,

We are using PHP 4.x on Windows 2000/IIS server. Please let me know how i have to send the request/response in XML body by using PHP as server side scripting language.

Many Thanks,
Imran Khalid
imranlink@hotmail.com

Reply With Quote
  #10  
Old September 23rd, 2003, 11:34 PM
bricker42 bricker42 is offline
Moderator =(8^(|)
Dev Shed Intermediate (1500 - 1999 posts)
 
Join Date: Feb 2002
Location: Sacramento, CA
Posts: 1,710 bricker42 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 20 m 38 sec
Reputation Power: 8
Send a message via AIM to bricker42
It looks like you have the right url. As for the post, no you're not sending form fields, you're sending xml. However, the curl module "thinks" you're sending form fields, since that's usually the only reason you would POST data to a server. In this case, though, you're POSTing xml. $params should be the xml from page 14.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > connect to other server


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway
Stay green...Green IT