Hope someone can help. We are just starting to test some interaction with Companies House using the XML gateway. I have received a presenter ID and authentication value from CH and we are now attempting to write some Node/Javascript code to connect with the gateway to eventually incorporate and file documents. Would someone have an example of some working code which we can start with? Also for the usage of the authentication value (10 alphanumeric code) should we use a cryptographic hashing function on this before we send over the XML gateway?
Both the Presenter ID and Password/Auth code should be a lower case MD5 hash. You should also populate the <GatewayTest> tag with the value that they gave you.
We do not have a workable example for the current incorporation schema unfortunately as it is being retired on 29th June, as a direct result of the new Small Business Act requirements. New schemas will be in place from 30th June, and relevant working examples can be found here:
Thanks for your reply. I think I am having trouble getting the correct URLs to make the XML requests against… I got a 404 response from the address I was using… here is our test XML request:
You appear to be testing “name search” which is a feature of our XML GATEWAY product (basically a data and image retrieval service).
The information I sent to you via the forum this morning relates to our XML FILING service, which requires completely different testing criteria and credentials.
Can you please confirm what you are actually trying to develop at the moment, and advise what test credentials we have given you to date.?
Thanks for your reply. Actually our requirements are that we need to both be able to incorporate companies on behalf of our clients and then also conduct some filing actions (change of directors, allotment/transfer of shares, etc). Perhaps you could help to elaborate on which gateways should be used for the different types of tasks we need to undertake?
I have now checked and see that you have opened a test account for XML INPUT (software filing) - if I may, I would suggest you concentrate on developing this first before moving onto the name search facility (which is a function of XML OUTPUT).
Thanks for the confirmation. If I understand things correctly then Software Filing (XML Input) should encompass both incorporations and subsequent filings? The only feature that we wanted to put into our platform before the incorporation was for a way for our clients to check the availability of a name for a new company. But I have already managed to connect with the new JSON API for name search so I assume that we can use that for now?
Thanks for that Simon… So now my next task is to get a working incorporation tested. Can you provide an example of a simple incorporation that I can start from. Specifically if there are any particular XML gateway URLs/authentication codes/etc that I need then please do let me know.
I tried to submit a copy of the example incorporation via a POST request from our application but the response I got back seemed to indicate a failed attempt. Also I couldn’t see in example links where the presenter ID and authentication values would be added to the XML Request message? Here is the response I received when posting to the URL “http://xmlalpha.companieshouse.gov.uk/v1-0/schema/forms/FormSubmission-v2-9.xsd”
<xs:schema xmlns="http://xmlgw.companieshouse.gov.uk/Header" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:bs="http://xmlgw.companieshouse.gov.uk/Header" targetNamespace="http://xmlgw.companieshouse.gov.uk/Header" elementFormDefault="qualified" attributeFormDefault="unqualified" version="2.9" id="FormSubmission">
<xs:element name="FormSubmission">
<xs:complexType>
<xs:sequence>
<xs:element name="FormHeader">
<xs:complexType>
<xs:sequence>
<xs:element name="CompanyNumber" type="xs:integer" minOccurs="0">
<xs:annotation>
<xs:documentation>The Company number, digits only</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="CompanyType" minOccurs="0">
<xs:annotation>
<xs:documentation>
The country of incorporation and company type classification. If the filing is for a Northern Ireland LLP, you must submit 'NC' in the CompanyType element
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="EW"/>
<xs:enumeration value="SC"/>
<xs:enumeration value="NI"/>
<xs:enumeration value="R"/>
<xs:enumeration value="OC"/>
<xs:enumeration value="SO"/>
<xs:enumeration value="NC"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CompanyName">
<xs:annotation>
<xs:documentation>
The content of the CompanyName element will be converted to upper case on receipt at Companies House for Incorporation submissions
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="nonEmptyNameAddressString">
<xs:minLength value="3"/>
<xs:maxLength value="160"/>
<xs:whiteSpace value="collapse"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="CompanyAuthenticationCode" minOccurs="0">
<xs:annotation>
<xs:documentation>
Authentication Code of the Company for which the submission relates
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:minLength value="6"/>
<xs:maxLength value="8"/>
<xs:whiteSpace value="preserve"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="PackageReference" type="xs:string">
<xs:annotation>
<xs:documentation>
Software Package reference allocated to Software Vendor by Companies House
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="Language" minOccurs="0">
<xs:annotation>
<xs:documentation>
The language used in the submission. Currently only EN (English) and CY (Welsh) are supported
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="EN"/>
<xs:enumeration value="CY"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="FormIdentifier" type="xs:string">
<xs:annotation>
<xs:documentation>
Identifier of the attached form, such as 'OfficerAppointment'
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="SubmissionNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="6"/>
<xs:whiteSpace value="collapse"/>
<xs:minLength value="6"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:sequence minOccurs="0">
<xs:element name="ContactName" type="nameAddressString"/>
<xs:element name="ContactNumber">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="25"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
<xs:element name="CustomerReference" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="25"/>
<xs:minLength value="0"/>
<xs:pattern value="[A-Za-z0-9]*"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="DateSigned" type="xs:date"/>
<xs:element name="Form">
<xs:complexType>
<xs:sequence>
<xs:any namespace="##any" minOccurs="0">
<xs:annotation>
<xs:documentation>
Contains the XML document of the form to be submitted. E.g. OfficerAppointment or AnnualReturn
</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="AdditionalInformation" minOccurs="0">
<xs:complexType>
<xs:sequence>
<xs:any namespace="##any">
<xs:annotation>
<xs:documentation>
Contains the XML document of the additional information e.g. Corporate Tax Information for an Incorporation
</xs:documentation>
</xs:annotation>
</xs:any>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="Document" minOccurs="0" maxOccurs="3">
<xs:annotation>
<xs:documentation>May contain an optional document attachment</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element name="Data">
<xs:simpleType>
<xs:restriction base="xs:base64Binary">
<xs:maxLength value="15000000"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Date" type="xs:date" minOccurs="0"/>
<xs:element name="Filename" minOccurs="0">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="32"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="ContentType">
<xs:annotation>
<xs:documentation>Mime content type of supplied data</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="application/vnd.hp-pcl"/>
<xs:enumeration value="application/xml"/>
<xs:enumeration value="application/pdf"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="Category">
<xs:annotation>
<xs:documentation>Identify the category of document supplied</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:enumeration value="MEMARTS"/>
<xs:enumeration value="SUPPNAMEAUTH"/>
<xs:enumeration value="ACCOUNTS"/>
<xs:enumeration value="SUPPEXISTNAME"/>
<xs:enumeration value="DEED"/>
<xs:enumeration value="DEEDSUPP"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:simpleType name="nameAddressString">
<xs:restriction base="xs:string">
<xs:pattern value="[-,.:; 0-9A-Z&@$£¥€'"«»‘’“”?!/\\()\[\]{}<>*=#%+ÀÁÂÃÄÅĀĂĄÆǼÇĆĈĊČÞĎÐÈÉÊËĒĔĖĘĚĜĞĠĢĤĦÌÍÎÏĨĪĬĮİĴĶĹĻĽĿŁÑŃŅŇŊÒÓÔÕÖØŌŎŐǾŒŔŖŘŚŜŞŠŢŤŦÙÚÛÜŨŪŬŮŰŲŴẀẂẄỲÝŶŸŹŻŽa-zÀÖØſƒǺǿẀẅỲỳ]*"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="nonEmptyNameAddressString">
<xs:restriction base="nameAddressString">
<xs:minLength value="1"/>
<xs:pattern value="\S+.*"/>
</xs:restriction>
</xs:simpleType>
</xs:schema>
Can you advise? Hopefully we’re getting somewhere (soon)!
Thanks @steveb, I think you helped! Looks like I wasn’t creating the header part correctly. Now that I have fixed that I think I am getting much further and currently my error is
XML failed schema validation: Invalid XML: Datatype error: Type:InvalidDatatypeValueException, Message:Value ‘ABCDEFGHIJKLMNOPQRSTUVWXYZ’ is not encoded in Base64 . line 1 column 6758
I was just faking my data file for testing with the following XML:
I assume you posted this before i went back to you privately confirming your exact presenter ID / authentication MD5# values?
The Base 64 coding is only required for the various attachments (i.e. Memorandum of Association / Articles of Association / evidence to support “sensitive” and “same as” name applications).