473,803 Members | 3,095 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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('htt p://www.site.com/websvs/PubServices.asm x?WSDL', true,
'', '', '', '');
$param = array('webID' => $WEB_ID, 'RecordsIN' => $numrecin);
$resultinit = $client->call('GetRecor ds', array('paramete rs' =>
$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("m icrosoft.XMLHTT P")
'Creates XML Request string to send to xml servers
qstr = "http://xml.traveltoday .net/xmlhotel.jsp?xm l="
qstr = qstr &
"<GeoRqst%20met hod=""runGeoRqs t""><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(xml http.responsete xt,"<?xml version=""1.0""
encoding=""ISO-8859-1""?>","")
'Load XML Response into DOM Object
Set XML1 = server.CreateOb ject("MSXML2.DO MDocument.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 1890
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("m icrosoft.XMLHTT P")
'Creates XML Request string to send to xml servers
qstr = "http://xml.traveltoday .net/xmlhotel.jsp?xm l="
qstr = qstr &
"<GeoRqst%20met hod=""runGeoRqs t""><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::lo ad('http://xml.traveltoday .net/xmlhotel.jsp?xm l=' .
rawurlencode(
'<GeoRqst method="runGeoR qst"><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
2742
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 to my system, the current admin user logged in gets logged out. I can't seem to work out how - I can't even trace back where some of the variables are coming from (for example, the "ref" part of the Request.QueryString method). Could someone...
0
2268
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 called. (http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=66a19 d98.0212240627.3f123293%40posting.google.com) I have recently received a number of emails from people asking if I ever found a solution, so I thought I'd post...
3
12682
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 the appropriate action based on finding the 'id' name/value pair in the URL querystring. This works well.
1
1961
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: a = HttpContext.Current.Request.QueryString;
6
1793
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 server control that ultimately redirects him/her to WebForm2.aspx . I need to persist the value of _formSessionId between the initial post and the postback (after the Button control is clicked). I would like to add the value to the QueryString...
6
351
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 dont undertsand the question, dont hesitate to ask. thanks in advance -- Look Out!
9
1594
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 following querystring, I got an error message saying "Unterminated string constant" from IE 6.0 and asking me if I want to debug. When I click Yes button, nothing happened and the page just shows up. When I put anything as a value for "sin" key, IE...
2
2278
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 boxes. I did the fetching in code behind but page is getting reloaded. To avoid this i need to do the querystring processing in client side. can anyone tell me how it is? or will the modal window works here
3
2161
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 must be submitted with a unique key, while everything is the same, these 4 fields must be different.... Idealy, these are the codes. please teach me how to do it. objConn.Open(sConnection) sRowNum = request.querystring("row_num")
0
9565
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10295
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9125
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7604
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6844
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5633
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3799
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2972
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.