Skip to content

Update rnc.py#462

Open
kvillar93 wants to merge 1 commit into
arthurdejong:masterfrom
kvillar93:patch-1
Open

Update rnc.py#462
kvillar93 wants to merge 1 commit into
arthurdejong:masterfrom
kvillar93:patch-1

Conversation

@kvillar93

Copy link
Copy Markdown

@kvillar93

Copy link
Copy Markdown
Author

Hello @arthurdejong, kind reminder.

@raulovallet

Copy link
Copy Markdown

Hellow, @kvillar93 thanks!!!!

@raulovallet

Copy link
Copy Markdown

I'm tried this new link and do not working :(

@Yepecpp

Yepecpp commented Feb 5, 2025

Copy link
Copy Markdown

@raulovallet, @kvillar93 it seems that dgii changed the structure and gatekeeps rnc validation with basic auth (username, password)

<s:element name="BuscaRnc">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="pUsuario" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="pPassword" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="pNumero_Documento" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>
 <s:element name="VerificaRnc">
        <s:complexType>
          <s:sequence>
            <s:element minOccurs="0" maxOccurs="1" name="pUsuario" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="pPassword" type="s:string" />
            <s:element minOccurs="0" maxOccurs="1" name="pRnc" type="s:string" />
          </s:sequence>
        </s:complexType>
      </s:element>

@Yepecpp

Yepecpp commented Feb 5, 2025

Copy link
Copy Markdown

@arthurdejong

Copy link
Copy Markdown
Owner

Hi @kvillar93,

Thanks for the notification. Can you update the PR to fix the problem with the changed API? You can run the tests for this with ONLINE_TESTS=1 pytest --no-cov -k rnc (by default the online tests are not run to not overload online services).

The tests currently fail with:

E           AttributeError: Service has no operation 'GetContribuyentes'

@ctactuk

ctactuk commented Mar 24, 2025

Copy link
Copy Markdown

does it was merged to master?

@arthurdejong

Copy link
Copy Markdown
Owner

A fix for the problem has not been merged because there is no solution available yet that works.

I've had a look at the WSDL provided at https://www.dgii.gov.do/ventanillaunica/ventanillaunica.asmx?WSDL and it seems that authentication may be enforced (the API states that username and password are optional but I have not been able to make a successful call yet).

<s:element name="VerificaRnc">
  <s:complexType>
    <s:sequence>
      <s:element minOccurs="0" maxOccurs="1" name="pUsuario" type="s:string"/>
      <s:element minOccurs="0" maxOccurs="1" name="pPassword" type="s:string"/>
      <s:element minOccurs="0" maxOccurs="1" name="pRnc" type="s:string"/>
    </s:sequence>
  </s:complexType>
</s:element>

I always seem to get some variation of:

>>> from stdnum.util import get_soap_client
>>> client = get_soap_client('https://www.dgii.gov.do/ventanillaunica/ventanillaunica.asmx?WSDL', timeout=30, verify=True)
Forcing soap:address location to HTTPS
Forcing soap:address location to HTTPS
>>> client.VerificaRnc(pRnc='131098193')
{
    'CodigoMensaje': 7,
    'DescripcionMensaje': 'Error: Error Interno del Webservice! Extendido:Object reference not set to an instance of an object.',
    'RNC_Cedula': None,
    'NombreRazonSocial': None,
    'Estatus': 'Inactivo'
}

Does anyone have a pointer to the documentation?

@arthurdejong arthurdejong linked an issue Mar 27, 2025 that may be closed by this pull request
arthurdejong added a commit that referenced this pull request Mar 27, 2025
There was a change in the SOAP service and there is a new URL. However,
the API has changed and seems to require authentication.

We ignore test failures for now but unless a solution is found the DGII
validation will be removed.

See: #462
See: #461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DO rnc search_dgii returning 404

5 participants