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