Skip to content

Update rnc.py #462

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update rnc.py #462

wants to merge 1 commit into from

Conversation

kvillar93
Copy link

@kvillar93
Copy link
Author

Hello @arthurdejong, kind reminder.

@raulovallet
Copy link

Hellow, @kvillar93 thanks!!!!

@raulovallet
Copy link

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

@Yepecpp
Copy link

Yepecpp commented Feb 5, 2025

@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
Copy link

Yepecpp commented Feb 5, 2025

@arthurdejong
Copy link
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
Copy link

ctactuk commented Mar 24, 2025

does it was merged to master?

@arthurdejong
Copy link
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