473,657 Members | 3,021 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Newbie: XML HTTP Request

2 New Member
Hi All,

I am very new to php and even newer to XML. Can anyone please shed some light on how to post XML requests via HTTP.

I have been searching high and low and have come across many examples and snippets, but none work nor make sense to me.

Below is an example of what it is I need to send as a request and the typical example I should receive. I just don't know how to send the request!!!

A Request

POST /v1-0/xmlgw/Gateway HTTP/1.1
Host: xmlgw.companies house.gov.uk
Content-Type: text/xml
Content-Length: 1417

<GovTalkMessa ge xmlns="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader"
xmlns:dsig="htt p://www.w3.org/2000/09/xmldsig#"
xmlns:gt="http://www.govtalk.gov .uk/schemas/govtalk/core"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader">
<EnvelopeVersio n>1.0</EnvelopeVersion >
<Header>
<MessageDetails >
<Class>CompanyD etails</Class>
<Qualifier>requ est</Qualifier>
<TransactionID> 14456553</TransactionID>
</MessageDetails>
<SenderDetail s>
<IDAuthenticati on>
<SenderID>My_Se nderID</SenderID>
<Authentication >
<Method>CHMD5 </Method>
<Value>e999e113 407884fa410fa2f 53bc23952</Value>
</Authentication>
</IDAuthenticatio n>
<EmailAddress>s ometest@some.em ail.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails >
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetails Request xmlns="http://xmlgw.companies house.gov.uk/v1-0"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://xmlgw.companies house.gov.uk/v1-0/schema/CoDets.xsd">
<CompanyNumber> 01002361</CompanyNumber>
<GiveMortTotals >1</GiveMortTotals>
</CompanyDetailsR equest>
</Body>
</GovTalkMessage>


A Response

HTTP/1.1 200 OK
Date: Mon, 01 Jul 2002 18:56:42 GMT
Server: Apache/1.3.22 (Unix) (Red-Hat/Linux) mod_perl/1.26
Last-Modified: Mon, 01 Jul 2002 16:14:51 GMT
ETag: "13ec0e-2e8-3d207ffb"
Accept-Ranges: bytes
Connection: close
Content-Type: text/xml
Content-Length: 2899
X-CH-Gateway: CH_XML_GW/0.1

<GovTalkMessa ge xmlns="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader"
xmlns:dsig="htt p://www.w3.org/2000/09/xmldsig#"
xmlns:gt="http://www.govtalk.gov .uk/schemas/govtalk/core"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader">
<EnvelopeVersio n>1.0</EnvelopeVersion >
<Header>
<MessageDetails >
<Class>CompanyD etails</Class>
<Qualifier>resp onse</Qualifier>
<TransactionID> 14456553</TransactionID>
<GatewayTimesta mp>2002-07-01T18:56:43-00:00</GatewayTimestam p>
</MessageDetails>
<SenderDetail s>
<IDAuthenticati on>
<SenderID>My_Se nderID</SenderID>
<Authentication >
<Method></Method>
<Value></Value>
</Authentication>
</IDAuthenticatio n>
<EmailAddress>s ometest@some.em ail.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails >
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetai ls xmlns="http://xmlgw.companies house.gov.uk/v1-0"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="xmlgw.comp anieshouse.gov. uk/v1-0/schema/CompanyDetails. xsd">
<CompanyNumber> 03176906</CompanyNumber>
<CompanyName>MI LLENNIUM STADIUM PLC</CompanyName>
<RegAddress>
<AddressLine> ST DAVID'S HOUSE</AddressLine>
<AddressLine>WE ST WING</AddressLine>
<AddressLine>WO OD STREET</AddressLine>
<AddressLine>CA RDIFF CF10 1ES</AddressLine>
</RegAddress>
<CompanyCategor y>Public Limited Company</CompanyCategory >
<CompanyStatus> Active</CompanyStatus>
<CountryOfOrigi n>United Kingdom</CountryOfOrigin >
<IncorporationD ate>1996-03-25</IncorporationDa te>
<Accounts>
<AccountRefDate >0000-30-04</AccountRefDate>
<NextDueDate>20 02-11-30</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate >2001-04-30</LastMadeUpDate>
<AccountCategor y>FULL</AccountCategory >
<FicheAvailable >0</FicheAvailable>
</Accounts>
<Returns>
<NextDueDate>20 03-04-22</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate >2002-03-25</LastMadeUpDate>
<FicheAvailable >0</FicheAvailable>
</Returns>
<Mortgages>
<MortgageInd>LT 300</MortgageInd>
<NumMortCharges >7</NumMortCharges>
<NumMortOutstan ding>7</NumMortOutstand ing>
<NumMortPartSat isfied>0</NumMortPartSati sfied>
<NumMortSatisfi ed>0</NumMortSatisfie d>
</Mortgages>
<SICCodes>
<SicText>9261 - operate sports arenas & stadiums</SicText>
</SICCodes>
<HasBranchInfo> 0</HasBranchInfo>
<HasAppointment s>1</HasAppointments >
<InLiquidation> 1</InLiquidation>
</CompanyDetails>
</Body>
</GovTalkMessage>



Many thanks

Ash
Aug 15 '05 #1
3 5398
ashesdesign
2 New Member
I found the answer at the above url

Ash
Aug 16 '05 #2
Larryt
1 New Member
Hi

Did you ever get an answer to your question, I have the same question as you, if so please forward answer to me?

Thanks.

Larry

Hi All,

I am very new to php and even newer to XML. Can anyone please shed some light on how to post XML requests via HTTP.

I have been searching high and low and have come across many examples and snippets, but none work nor make sense to me.

Below is an example of what it is I need to send as a request and the typical example I should receive. I just don't know how to send the request!!!

A Request

POST /v1-0/xmlgw/Gateway HTTP/1.1
Host: xmlgw.companies house.gov.uk
Content-Type: text/xml
Content-Length: 1417

<GovTalkMessa ge xmlns="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader"
xmlns:dsig="htt p://www.w3.org/2000/09/xmldsig#"
xmlns:gt="http://www.govtalk.gov .uk/schemas/govtalk/core"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader">
<EnvelopeVersio n>1.0</EnvelopeVersion >
<Header>
<MessageDetails >
<Class>CompanyD etails</Class>
<Qualifier>requ est</Qualifier>
<TransactionID> 14456553</TransactionID>
</MessageDetails>
<SenderDetail s>
<IDAuthenticati on>
<SenderID>My_Se nderID</SenderID>
<Authentication >
<Method>CHMD5 </Method>
<Value>e999e113 407884fa410fa2f 53bc23952</Value>
</Authentication>
</IDAuthenticatio n>
<EmailAddress>s ometest@some.em ail.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails >
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetails Request xmlns="http://xmlgw.companies house.gov.uk/v1-0"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://xmlgw.companies house.gov.uk/v1-0/schema/CoDets.xsd">
<CompanyNumber> 01002361</CompanyNumber>
<GiveMortTotals >1</GiveMortTotals>
</CompanyDetailsR equest>
</Body>
</GovTalkMessage>


A Response

HTTP/1.1 200 OK
Date: Mon, 01 Jul 2002 18:56:42 GMT
Server: Apache/1.3.22 (Unix) (Red-Hat/Linux) mod_perl/1.26
Last-Modified: Mon, 01 Jul 2002 16:14:51 GMT
ETag: "13ec0e-2e8-3d207ffb"
Accept-Ranges: bytes
Connection: close
Content-Type: text/xml
Content-Length: 2899
X-CH-Gateway: CH_XML_GW/0.1

<GovTalkMessa ge xmlns="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader"
xmlns:dsig="htt p://www.w3.org/2000/09/xmldsig#"
xmlns:gt="http://www.govtalk.gov .uk/schemas/govtalk/core"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="http://www.govtalk.gov .uk/schemas/govtalk/govtalkheader">
<EnvelopeVersio n>1.0</EnvelopeVersion >
<Header>
<MessageDetails >
<Class>CompanyD etails</Class>
<Qualifier>resp onse</Qualifier>
<TransactionID> 14456553</TransactionID>
<GatewayTimesta mp>2002-07-01T18:56:43-00:00</GatewayTimestam p>
</MessageDetails>
<SenderDetail s>
<IDAuthenticati on>
<SenderID>My_Se nderID</SenderID>
<Authentication >
<Method></Method>
<Value></Value>
</Authentication>
</IDAuthenticatio n>
<EmailAddress>s ometest@some.em ail.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails >
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetai ls xmlns="http://xmlgw.companies house.gov.uk/v1-0"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocat ion="xmlgw.comp anieshouse.gov. uk/v1-0/schema/CompanyDetails. xsd">
<CompanyNumber> 03176906</CompanyNumber>
<CompanyName>MI LLENNIUM STADIUM PLC</CompanyName>
<RegAddress>
<AddressLine> ST DAVID'S HOUSE</AddressLine>
<AddressLine>WE ST WING</AddressLine>
<AddressLine>WO OD STREET</AddressLine>
<AddressLine>CA RDIFF CF10 1ES</AddressLine>
</RegAddress>
<CompanyCategor y>Public Limited Company</CompanyCategory >
<CompanyStatus> Active</CompanyStatus>
<CountryOfOrigi n>United Kingdom</CountryOfOrigin >
<IncorporationD ate>1996-03-25</IncorporationDa te>
<Accounts>
<AccountRefDate >0000-30-04</AccountRefDate>
<NextDueDate>20 02-11-30</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate >2001-04-30</LastMadeUpDate>
<AccountCategor y>FULL</AccountCategory >
<FicheAvailable >0</FicheAvailable>
</Accounts>
<Returns>
<NextDueDate>20 03-04-22</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate >2002-03-25</LastMadeUpDate>
<FicheAvailable >0</FicheAvailable>
</Returns>
<Mortgages>
<MortgageInd>LT 300</MortgageInd>
<NumMortCharges >7</NumMortCharges>
<NumMortOutstan ding>7</NumMortOutstand ing>
<NumMortPartSat isfied>0</NumMortPartSati sfied>
<NumMortSatisfi ed>0</NumMortSatisfie d>
</Mortgages>
<SICCodes>
<SicText>9261 - operate sports arenas & stadiums</SicText>
</SICCodes>
<HasBranchInfo> 0</HasBranchInfo>
<HasAppointment s>1</HasAppointments >
<InLiquidation> 1</InLiquidation>
</CompanyDetails>
</Body>
</GovTalkMessage>



Many thanks

Ash
Aug 10 '06 #3
hgroper
1 New Member
I found the answer at the above url

Ash
Hi, Can you tell me what the URL is that you refer to

Many Thanks
Jul 4 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1336
by: janetb | last post by:
Brand new to xml and I'm trying to get Scott Mitchell's rss aggregator example working locally. Basically, involves a frameset with the channels(feeds) in the left frame, a list of items in the channel in the lower right, and the single item in the top right based on a selection in the lower right. When the channel within the left frame is clicked, bottom right frame changes with the items for the channel (feed). Taking it step-by-step. Have...
1
1467
by: puafo | last post by:
The following is the code I am using for the addnew and the select clause: <%Option Explicit%> <% IF session("sessionID") = "" THEN Response.Redirect "adminLogin.asp" END IF %> <%
4
2581
by: thecult | last post by:
Hi again, this is my second post. I have a problem with Tmemo object (named as Display1 in my code) program sends post parameters to a php script and stores the response in a string var, then shows this strings in memo object (display1) I can compile program 100% without problems, but when I execute it I can send some messages but sometimes (sometimes yes and sometimes no) it closes suddenly with this error: "ACCESS VIOLATION AT ADDRESS...
3
2127
by: Tom McQ | last post by:
Would somebody please have a look at the following piece of code for me? It is supposed to write a single record to one table in a database and a group of related records to another table. It worked without any problems when I was using Access 97 and a "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & server.mappath("/d1/d101.mdb") connection string. However, since upgrading to Access 2000 it is failing. The error I get is: Microsoft JET...
9
1470
by: John | last post by:
Hello all. I am a PHP newbie and am having an issue using the && in an if statement. here is the code: if ($_REQUEST == "1" && date("Y-m-d") < $rowWork) { die("<h1>The earlybird special has ended.</h1>"); }
2
2776
by: shawnwperkins | last post by:
Hi Folks, I'm new to Javascript and just need a little help. I downloaded a script from Dynamic Drive's Web site and I'm trying to make a simple modification and could use some help. :) The script below fetches data from the web server and displays it in the form as a ticker on the web page. See: http://www.dynamicdrive.com/dynamicindex2/ajaxticker.htm What I would like to do is to have the Ajax ticker periodically go out
4
1854
by: .nLL | last post by:
Hi, im am a classic asp developer and started to learn asp.net but got stuck with a simple problem even before i step in to further. to learn i have started from a simple project (a login system with forms) due to projects platform (a mobile web site) i cant use cookies (cookies arent supported on all phones), anyway because of that i do un/pw check on very page and i have to put Dim MyUn As String =...
5
3859
by: Gilbert | last post by:
Apologies if I'm posting this to the wrong group. I want to know if it possible to emulate Java servlet functionality in C# and .net. What I want to do is to be able to do is create a C# program that sits listens for an HTTP request to a specific URL and then access the C# equivalent of the HTTPServletRequest object so I can access the request parameters directly. I've googled and found out about the WebClient - what I want is the...
3
1883
by: milov | last post by:
Project to do simulation testing (me teacher). Page one writes in real time to page two...both displayed at sam time with frames. Code below. Problem...I want to keep score. Each choice needs a value between (-3 and 3) to be summed for final score. second problem, I want checkbox to be permanent, that is once selected no unselect. Thanks fro your help. also, all on a windows server asp willing to go with php, java etc. Page one...
0
8384
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8820
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8718
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7314
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
6162
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
4150
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1937
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
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.