473,324 Members | 2,535 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,324 software developers and data experts.

Newbie: XML HTTP Request

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.companieshouse.gov.uk
Content-Type: text/xml
Content-Length: 1417

<GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"
xmlns:dsig="http://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:schemaLocation="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>CompanyDetails</Class>
<Qualifier>request</Qualifier>
<TransactionID>14456553</TransactionID>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>My_SenderID</SenderID>
<Authentication>
<Method>CHMD5</Method>
<Value>e999e113407884fa410fa2f53bc23952</Value>
</Authentication>
</IDAuthentication>
<EmailAddress>sometest@some.email.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetailsRequest xmlns="http://xmlgw.companieshouse.gov.uk/v1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlgw.companieshouse.gov.uk/v1-0/schema/CoDets.xsd">
<CompanyNumber>01002361</CompanyNumber>
<GiveMortTotals>1</GiveMortTotals>
</CompanyDetailsRequest>
</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

<GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"
xmlns:dsig="http://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:schemaLocation="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>CompanyDetails</Class>
<Qualifier>response</Qualifier>
<TransactionID>14456553</TransactionID>
<GatewayTimestamp>2002-07-01T18:56:43-00:00</GatewayTimestamp>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>My_SenderID</SenderID>
<Authentication>
<Method></Method>
<Value></Value>
</Authentication>
</IDAuthentication>
<EmailAddress>sometest@some.email.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetails xmlns="http://xmlgw.companieshouse.gov.uk/v1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xmlgw.companieshouse.gov.uk/v1-0/schema/CompanyDetails.xsd">
<CompanyNumber>03176906</CompanyNumber>
<CompanyName>MILLENNIUM STADIUM PLC</CompanyName>
<RegAddress>
<AddressLine>ST DAVID'S HOUSE</AddressLine>
<AddressLine>WEST WING</AddressLine>
<AddressLine>WOOD STREET</AddressLine>
<AddressLine>CARDIFF CF10 1ES</AddressLine>
</RegAddress>
<CompanyCategory>Public Limited Company</CompanyCategory>
<CompanyStatus>Active</CompanyStatus>
<CountryOfOrigin>United Kingdom</CountryOfOrigin>
<IncorporationDate>1996-03-25</IncorporationDate>
<Accounts>
<AccountRefDate>0000-30-04</AccountRefDate>
<NextDueDate>2002-11-30</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate>2001-04-30</LastMadeUpDate>
<AccountCategory>FULL</AccountCategory>
<FicheAvailable>0</FicheAvailable>
</Accounts>
<Returns>
<NextDueDate>2003-04-22</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate>2002-03-25</LastMadeUpDate>
<FicheAvailable>0</FicheAvailable>
</Returns>
<Mortgages>
<MortgageInd>LT300</MortgageInd>
<NumMortCharges>7</NumMortCharges>
<NumMortOutstanding>7</NumMortOutstanding>
<NumMortPartSatisfied>0</NumMortPartSatisfied>
<NumMortSatisfied>0</NumMortSatisfied>
</Mortgages>
<SICCodes>
<SicText>9261 - operate sports arenas & stadiums</SicText>
</SICCodes>
<HasBranchInfo>0</HasBranchInfo>
<HasAppointments>1</HasAppointments>
<InLiquidation>1</InLiquidation>
</CompanyDetails>
</Body>
</GovTalkMessage>



Many thanks

Ash
Aug 15 '05 #1
3 5377
I found the answer at the above url

Ash
Aug 16 '05 #2
Larryt
1
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.companieshouse.gov.uk
Content-Type: text/xml
Content-Length: 1417

<GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"
xmlns:dsig="http://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:schemaLocation="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>CompanyDetails</Class>
<Qualifier>request</Qualifier>
<TransactionID>14456553</TransactionID>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>My_SenderID</SenderID>
<Authentication>
<Method>CHMD5</Method>
<Value>e999e113407884fa410fa2f53bc23952</Value>
</Authentication>
</IDAuthentication>
<EmailAddress>sometest@some.email.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetailsRequest xmlns="http://xmlgw.companieshouse.gov.uk/v1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlgw.companieshouse.gov.uk/v1-0/schema/CoDets.xsd">
<CompanyNumber>01002361</CompanyNumber>
<GiveMortTotals>1</GiveMortTotals>
</CompanyDetailsRequest>
</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

<GovTalkMessage xmlns="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"
xmlns:dsig="http://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:schemaLocation="http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>CompanyDetails</Class>
<Qualifier>response</Qualifier>
<TransactionID>14456553</TransactionID>
<GatewayTimestamp>2002-07-01T18:56:43-00:00</GatewayTimestamp>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>My_SenderID</SenderID>
<Authentication>
<Method></Method>
<Value></Value>
</Authentication>
</IDAuthentication>
<EmailAddress>sometest@some.email.address</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails>
<Keys/>
</GovTalkDetails>
<Body>
<CompanyDetails xmlns="http://xmlgw.companieshouse.gov.uk/v1-0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="xmlgw.companieshouse.gov.uk/v1-0/schema/CompanyDetails.xsd">
<CompanyNumber>03176906</CompanyNumber>
<CompanyName>MILLENNIUM STADIUM PLC</CompanyName>
<RegAddress>
<AddressLine>ST DAVID'S HOUSE</AddressLine>
<AddressLine>WEST WING</AddressLine>
<AddressLine>WOOD STREET</AddressLine>
<AddressLine>CARDIFF CF10 1ES</AddressLine>
</RegAddress>
<CompanyCategory>Public Limited Company</CompanyCategory>
<CompanyStatus>Active</CompanyStatus>
<CountryOfOrigin>United Kingdom</CountryOfOrigin>
<IncorporationDate>1996-03-25</IncorporationDate>
<Accounts>
<AccountRefDate>0000-30-04</AccountRefDate>
<NextDueDate>2002-11-30</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate>2001-04-30</LastMadeUpDate>
<AccountCategory>FULL</AccountCategory>
<FicheAvailable>0</FicheAvailable>
</Accounts>
<Returns>
<NextDueDate>2003-04-22</NextDueDate>
<Overdue>1</Overdue>
<LastMadeUpDate>2002-03-25</LastMadeUpDate>
<FicheAvailable>0</FicheAvailable>
</Returns>
<Mortgages>
<MortgageInd>LT300</MortgageInd>
<NumMortCharges>7</NumMortCharges>
<NumMortOutstanding>7</NumMortOutstanding>
<NumMortPartSatisfied>0</NumMortPartSatisfied>
<NumMortSatisfied>0</NumMortSatisfied>
</Mortgages>
<SICCodes>
<SicText>9261 - operate sports arenas & stadiums</SicText>
</SICCodes>
<HasBranchInfo>0</HasBranchInfo>
<HasAppointments>1</HasAppointments>
<InLiquidation>1</InLiquidation>
</CompanyDetails>
</Body>
</GovTalkMessage>



Many thanks

Ash
Aug 10 '06 #3
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
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...
1
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
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...
3
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...
9
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...
2
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...
4
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...
5
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...
3
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.