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