Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Problems with XML HTTP POST requests etc

From: "Howard Myers" <hmyersREMOVETHISBIT@----------.--->
To: 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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>We get a response which includes "XML =
failed schema=20
validation: XML error: Invalid document structure&nbsp; 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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>submission.XML sample instance&nbsp;is =
as=20
follows:</FONT></DIV>
<DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2><EM>&lt;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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=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>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;&nbsp;&nbsp;&nbsp;=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>"&gt;<BR>&nbsp;=20
&lt;EnvelopeVersion&gt;1.0&lt;/EnvelopeVersion&gt;<BR>&nbsp;=20
&lt;Header&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;MessageDetails&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;Class&gt;Accounts&lt;/Class&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;Qualifier&gt;request&lt;/Qualifier&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;=20
&lt;TransactionID&gt;14456554&lt;/TransactionID&gt;<BR>&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;=20
&lt;GatewayTest&gt;1&lt;/GatewayTest&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;/MessageDetails&gt;<BR>&nbsp;&nbsp;&nbsp;=20
&lt;SenderDetails&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;IDAuthentication&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;SenderID&gt;XXXXXXX&lt;/SenderID&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;=20
&lt;Authentication&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;=20
&lt;Method&gt;clear&lt;/Method&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp=
;&nbsp;&nbsp;&nbsp;=20
&lt;Value&gt;XXXXXXXX&lt;/Value&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;=20
&lt;/Authentication&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;/IDAuthentication&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=20
&lt;EmailAddress&gt;someone@s...&lt;/EmailAddress&gt;<BR>&nbsp;&=
nbsp;&nbsp;=20
&lt;/SenderDetails&gt;<BR>&nbsp; &lt;/Header&gt;<BR>&nbsp;=20
&lt;GovTalkDetails&gt;<BR>&nbsp; &lt;/GovTalkDetails&gt;<BR>&nbsp;=20
&lt;Body&gt;<BR>&nbsp; <BR>&nbsp; &lt;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>"&gt;<BR>&nbsp;&lt;CompanyNumber&gt;01234567&lt;/CompanyNumb=
er&gt;<BR>&lt;CompanyAuthenticationCode&gt;ABCDEF&lt;/CompanyAuthenticati=
onCode&gt;<BR>&lt;MadeUpDate&gt;2008-05-13&lt;/MadeUpDate&gt;<BR>&lt;/Com=
panyDataRequest&gt;&nbsp;=20
<BR>&nbsp; &lt;/Body&gt;<BR>&nbsp; =
&lt;/GovTalkMessage&gt;</EM></FONT></DIV>
<DIV><FONT face=3DArial size=3D2><EM></EM></FONT>&nbsp;</DIV>
<DIV><FONT face=3DArial size=3D2>&nbsp;</DIV>
<DIV><EM><BR></EM></DIV></FONT></BODY></HTML>

------=_NextPart_000_000D_01C8E13D.11F80260--



transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent