473,394 Members | 2,048 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Querystring to call XML ? Please help!

I have been pulling XML data the past year on PHP using SOAP. NOw I
have another server to pull from with someone else but their server
seems to be different.

Currently I would do something like the following:

$client = new
soapclient('http://www.site.com/websvs/PubServices.asmx?WSDL', true,
'', '', '', '');
$param = array('webID' => $WEB_ID, 'RecordsIN' => $numrecin);
$resultinit = $client->call('GetRecords', array('parameters' =>
$param), '', '', false, true);
$result = GetXMLTree ($resultinit);

It works great.

This new servers doesn't seem to have any WSDL. they just gave me a
URL with a querystring format to retrieve data along with some sample
asp code.

i.e:
'Creates HTTP Connection Object
Set XMLHTTP = CreateObject("microsoft.XMLHTTP")
'Creates XML Request string to send to xml servers
qstr = "http://xml.traveltoday.net/xmlhotel.jsp?xml="
qstr = qstr &
"<GeoRqst%20method=""runGeoRqst""><Type>3</Type><SC><Type>2</Type><Value>"
& country& "</Value></SC></GeoReqst>"
'Opens and sends request
XMLHTTP.Open "GET", qstr, false
xmlhttp.send
xml=replace(xmlhttp.responsetext,"<?xml version=""1.0""
encoding=""ISO-8859-1""?>","")
'Load XML Response into DOM Object
Set XML1 = server.CreateObject("MSXML2.DOMDocument.3.0")
....and so on...
What am I missing? I am a novice at this at best but the SOAP stuff
was no problem.. Can someone help?

Apr 11 '06 #1
3 1877
Sorry I left out that I want to get data from this server using
PHP/SOAP...

Thanks

Apr 11 '06 #2


jo**@munsey.net wrote:

This new servers doesn't seem to have any WSDL. they just gave me a
URL with a querystring format to retrieve data along with some sample
asp code.

i.e:
'Creates HTTP Connection Object
Set XMLHTTP = CreateObject("microsoft.XMLHTTP")
'Creates XML Request string to send to xml servers
qstr = "http://xml.traveltoday.net/xmlhotel.jsp?xml="
qstr = qstr &
"<GeoRqst%20method=""runGeoRqst""><Type>3</Type><SC><Type>2</Type><Value>"
& country& "</Value></SC></GeoReqst>"
'Opens and sends request
XMLHTTP.Open "GET", qstr, false
xmlhttp.send


Well they only expect you to make a HTTP GET request with a query string
(so do nothing more that load a URL with a query string) where the
response is supposed to be parsed as XML.

So with PHP 5 you could e.g.

$country = 'USA';
$xmlDocument =
DOMDocument::load('http://xml.traveltoday.net/xmlhotel.jsp?xml=' .
rawurlencode(
'<GeoRqst method="runGeoRqst"><Type>3</Type><SC><Type>2</Type><Value>' .
$country . "</Value></SC></GeoReqst>"
));
if ($xmlDocument != FALSE) {
header('Content-Type: text/plain');
echo $xmlDocument->saveXML();
}

Obviously you don't want to echo the XML but extract some contents using
the DOM API but the above allows you to see the XML as returned from the
server.

I tried to find information on xml.traveltoday.net on exactly what
protocol they use (it might be XMLRPC) but I can't find anything there.

And the example request above results in

<?xml version="1.0"?>
<Exception>
<message>Bad XML Request. Can Not Route.</message>
<fullText>java.lang.Exception: Bad XML Request. Can Not
Route.</fullText>
</Exception>

so somehow the sent XML is not what they want. Ask for a
documentation/specification on what kind of query string that JSP
expects as valid requests.
--

Martin Honnen
http://JavaScript.FAQTs.com/
Apr 11 '06 #3
Thanks, they sent instructions on the querystring format. I don't have
PHP 5 installed rather php 4. I suppose I could update to PHP 5 but I
have an Ensim box and don't like to update unless absolutely necessary.

Does PHP 5 offer equivalent XML support to SOAP ? Is that a valid
question?

Thanks again.

Apr 12 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Max | last post by:
Hello. This is the first time I've posted to a newsgroup, and I do this because I'm in desperate need of help. I'm working a user management system, and when I activate a user that has registered...
0
by: Matt Howeson | last post by:
Some time ago I posted a request for help with a problem I was having sometime ago whereby a 404 error would result if any access to the Querystring had been made before the Context.Rewritepath is...
3
by: Jon | last post by:
Hi, I have hyperlink objects in a datagrid that redirect the user back to the current page with this syntax: <a href="mypage.aspx?id=foo"> When the page reloads, code in Page_Load then takes...
1
by: Lara Grillo | last post by:
In an Asp.Net application on an chinese operative system, the string (in chinese characters) returned by querystring function is truncated. example: in querystring I set Title= ?? C# code:...
6
by: Joe | last post by:
Hello All: I have a webform (WebForm1.aspx) that retrieves a value from a database (_formSessionId) the first time that it is posted. After the user filles in the form, he/she clicks a Button...
6
by: Helter Skelter | last post by:
hi, i want to have a querystring in a webpage. i dont mind what it does (i just want to experiment with it). how do i get the asp.net page to do something when i type in a querystring? if you...
9
by: VancouverMike | last post by:
Hi there, I run into a very strange problem. I got the following url and am passing information via query string. The problem when the "sin" key in query string is blank, shown as in the...
2
by: sudhaMurugesan | last post by:
Hi please help me. I call a pop up window that send deptid in query string. Now i have to get this deptid from the querystring and fetch dept data based on this id to fill the parent's text...
3
by: pingsheng | last post by:
Dear all, I have a form with dynamically created input fields. These fields go to next page for submitting into SQL database. The thing is all fields are the same but 4 fields. So each record...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.