Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: Problems with XML HTTP POST requests etc Problems with XML HTTP POST requests etcTo: NULL Date: 7/8/2008 8:56:00 PM
This is a multi-part message in MIME format.
------=_NextPart_000_000D_01C8E13D.11F80260
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Our MS Access application currently sends XML documents and data =
requests to a Govt department as email attachments.
There is now a requirement to use HTTP Post to the recipient via the Gov =
gateway service and deal with responses accordingly.=20
Using a sample request XML instance (see below) we have been struggling =
to get the process up and running.=20
We are calling HTTP Post as follows:
Dim objHttp As MSXML2.XMLHTTP30, response As String, req As String
Set objHttp =3D New MSXML2.XMLHTTP30
objHttp.Open "POST", =
"https://xmlgw.companieshouse.gov.uk/v1-0/xmlgw/Gateway", False, "", ""
objHttp.setRequestHeader "Content-Type", "text/xml"
objHttp.setRequestHeader "Host", "xmlgw.companieshouse.gov.uk"
req =3D "C:\scripts\submission.XML"
objHttp.send (req)
Me.responsebox =3D objHttp.responseText
We get a response which includes "XML failed schema validation: XML =
error: Invalid document structure line 1 column 1"
Any help to resolve this would be greatly appreciated.
HM. (a relative novice on the subject of HTTP)
submission.XML sample instance is as follows:
<GovTalkMessage =
xmlns=3D"http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"
xmlns:dsig=3D"http://www.w3.org/2000/09/xmldsig#"=20
=
xmlns:gt=3D"http://www.govtalk.gov.uk/schemas/govtalk/core"=20
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"=20
=
xsi:schemaLocation=3D"http://www.govtalk.gov.uk/schemas/govtalk/govtalkhe=
ader">
<EnvelopeVersion>1.0</EnvelopeVersion>
<Header>
<MessageDetails>
<Class>Accounts</Class>
<Qualifier>request</Qualifier>
<TransactionID>14456554</TransactionID>
<GatewayTest>1</GatewayTest>
</MessageDetails>
<SenderDetails>
<IDAuthentication>
<SenderID>XXXXXXX</SenderID>
<Authentication>
<Method>clear</Method>
<Value>XXXXXXXX</Value>
</Authentication>
</IDAuthentication>
<EmailAddress>someone@s...</EmailAddress>
</SenderDetails>
</Header>
<GovTalkDetails>
</GovTalkDetails>
<Body>
=20
<CompanyDataRequest xmlns=3D"http://xmlgw.companieshouse.gov.uk" =
xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance" =
xsi:schemaLocation=3D"http://xmlgw.companieshouse.gov.uk =
http://xmlgw.companieshouse.gov.uk/v1-1/schema/forms/CompanyData-v1-1.xsd=
">
<CompanyNumber>01234567</CompanyNumber>
<CompanyAuthenticationCode>ABCDEF</CompanyAuthenticationCode>
<MadeUpDate>2008-05-13</MadeUpDate>
</CompanyDataRequest> =20
</Body>
</GovTalkMessage>
------=_NextPart_000_000D_01C8E13D.11F80260
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.6000.16674" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT face=3DArial size=3D2>Our MS Access application currently =
sends XML=20
documents and data requests to a Govt department as email =
attachments.<BR>There=20
is now a requirement to use HTTP Post to the recipient via the Gov =
gateway=20
service and deal with responses accordingly. <BR>Using a sample request =
XML=20
instance (see below) we have been struggling to get the process up and =
running.=20
<BR>We are calling HTTP Post as follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><EM>Dim objHttp As MSXML2.XMLHTTP30, =
response As=20
String, req As String<BR>Set objHttp =3D New =
MSXML2.XMLHTTP30<BR>objHttp.Open=20
"POST", "</EM></FONT><A=20
href=3D"https://xmlgw.companieshouse.gov.uk/v1-0/xmlgw/Gateway"><FONT =
face=3DArial=20
size=3D2><EM>https://xmlgw.companieshouse.gov.uk/v1-0/xmlgw/Gateway</EM><=
/FONT></A><FONT=20
face=3DArial size=3D2><EM>", False, "", ""<BR>objHttp.setRequestHeader=20
"Content-Type", "text/xml"<BR>objHttp.setRequestHeader "Host",=20
"xmlgw.companieshouse.gov.uk"<BR>req =3D=20
"C:\scripts\submission.XML"<BR>objHttp.send (req)<BR>Me.responsebox =3D=20
objHttp.responseText</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>We get a response which includes "XML =
failed schema=20
validation: XML error: Invalid document structure line 1 column=20
1"</FONT></DIV>
<DIV><FONT face=3DArial size=3D2>Any help to resolve this would be =
greatly=20
appreciated.</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>HM. (a relative novice on the subject =
of=20
HTTP)</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2>submission.XML sample instance is =
as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2><EM><GovTalkMessage =
xmlns=3D"</EM></FONT><A=20
href=3D"http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"><FONT =
face=3DArial=20
size=3D2><EM>http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader</EM>=
</FONT></A><FONT=20
face=3DArial=20
size=3D2><EM>"<BR> &=
nbsp; =20
xmlns:dsig=3D"</EM></FONT><A =
href=3D"http://www.w3.org/2000/09/xmldsig"><FONT=20
face=3DArial =
size=3D2><EM>http://www.w3.org/2000/09/xmldsig</EM></FONT></A><FONT=20
face=3DArial size=3D2><EM>#"=20
<BR> &nb=
sp; =20
xmlns:gt=3D"</EM></FONT><A=20
href=3D"http://www.govtalk.gov.uk/schemas/govtalk/core"><FONT =
face=3DArial=20
size=3D2><EM>http://www.govtalk.gov.uk/schemas/govtalk/core</EM></FONT></=
A><FONT=20
face=3DArial size=3D2><EM>"=20
<BR> &nb=
sp; =20
xmlns:xsi=3D"</EM></FONT><A =
href=3D"http://www.w3.org/2001/XMLSchema-instance"><FONT=20
face=3DArial=20
size=3D2><EM>http://www.w3.org/2001/XMLSchema-instance</EM></FONT></A><FO=
NT=20
face=3DArial size=3D2><EM>"=20
<BR> &nb=
sp; =20
xsi:schemaLocation=3D"</EM></FONT><A=20
href=3D"http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader"><FONT =
face=3DArial=20
size=3D2><EM>http://www.govtalk.gov.uk/schemas/govtalk/govtalkheader</EM>=
</FONT></A><FONT=20
face=3DArial size=3D2><EM>"><BR> =20
<EnvelopeVersion>1.0</EnvelopeVersion><BR> =20
<Header><BR> =20
<MessageDetails><BR> =20
<Class>Accounts</Class><BR> =20
<Qualifier>request</Qualifier><BR> &nb=
sp;=20
<TransactionID>14456554</TransactionID><BR> =
=20
<GatewayTest>1</GatewayTest><BR> =20
</MessageDetails><BR> =20
<SenderDetails><BR> =20
<IDAuthentication><BR> =20
<SenderID>XXXXXXX</SenderID><BR>  =
; =20
<Authentication><BR>  =
; =20
<Method>clear</Method><BR>  =
; =20
<Value>XXXXXXXX</Value><BR> &nbs=
p; =20
</Authentication><BR> =20
</IDAuthentication><BR> =20
<EmailAddress>someone@s...</EmailAddress><BR> &=
nbsp; =20
</SenderDetails><BR> </Header><BR> =20
<GovTalkDetails><BR> </GovTalkDetails><BR> =20
<Body><BR> <BR> <CompanyDataRequest =
xmlns=3D"</EM></FONT><A=20
href=3D"http://xmlgw.companieshouse.gov.uk"><FONT face=3DArial=20
size=3D2><EM>http://xmlgw.companieshouse.gov.uk</EM></FONT></A><FONT =
face=3DArial=20
size=3D2><EM>" xmlns:xsi=3D"</EM></FONT><A=20
href=3D"http://www.w3.org/2001/XMLSchema-instance"><FONT face=3DArial=20
size=3D2><EM>http://www.w3.org/2001/XMLSchema-instance</EM></FONT></A><FO=
NT=20
face=3DArial size=3D2><EM>" xsi:schemaLocation=3D"</EM></FONT><A=20
href=3D"http://xmlgw.companieshouse.gov.uk"><FONT face=3DArial=20
size=3D2><EM>http://xmlgw.companieshouse.gov.uk</EM></FONT></A><FONT =
face=3DArial=20
size=3D2><EM> </EM></FONT><A=20
href=3D"http://xmlgw.companieshouse.gov.uk/v1-1/schema/forms/CompanyData-=
v1-1.xsd"><FONT=20
face=3DArial=20
size=3D2><EM>http://xmlgw.companieshouse.gov.uk/v1-1/schema/forms/Company=
Data-v1-1.xsd</EM></FONT></A><FONT=20
face=3DArial=20
size=3D2><EM>"><BR> <CompanyNumber>01234567</CompanyNumb=
er><BR><CompanyAuthenticationCode>ABCDEF</CompanyAuthenticati=
onCode><BR><MadeUpDate>2008-05-13</MadeUpDate><BR></Com=
panyDataRequest> =20
<BR> </Body><BR> =
</GovTalkMessage></EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT> </DIV>
<DIV><FONT face=3DArial size=3D2> </DIV>
<DIV><EM><BR></EM></DIV></FONT></BODY></HTML>
------=_NextPart_000_000D_01C8E13D.11F80260--
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
