falc410 / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

soap12 client bad namespace #96

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to make a soap12 call to SEFAZ (Secretaria da Fazenda - Brazil)
2. The server responds that the namespace is unknown

What is the expected output? What do you see instead?
It was supposed to comunicate without problems

What version of the product are you using? On what operating system?
The client 'trunk' version 1.08a

Please provide any additional information below.
To fix it I've changed line 58 from:
    soap12="http://www.w3.org/2003/05/soap-env",
to
    soap12="http://www.w3.org/2003/05/soap-envelope",

It seems to me like the problem is a typo in the namespace definition.

By the way, and totally off-topic, it worked fine after the fix. I was able to 
communicate with Brazilian SEFAZ to send the NFe (Nota Fiscal Eletronica) file. 
Take a look at this sample code if you are trying to achieve the same.

client = SoapClient(soap_ns="soap12", namespace="https://www.nfp.sp.gov.br/ws",
                    location="https://www.nfp.fazenda.sp.gov.br/ws/arquivocf.asmx",
                    action="https://www.nfp.fazenda.sp.gov.br/ws/arquivocf.asmx", trace=True)
client['Autenticacao'] = SimpleXMLElement('<Autenticacao Usuario="%s" 
Senha="%s" CNPJ="%s" CategoriaUsuario="%d" xmlns="https://www.nfp.sp.gov.br/ws" 
/>'%(user, password, fed_tax_num, category))
params = dict(NomeArquivo=file_name, ConteudoArquivo=content, 
EnvioNormal="true", Observacoes="")
response = client.call("Enviar", **params)
result = str(response.EnviarResult).split("|")

Original issue reported on code.google.com by fvice...@gmail.com on 14 Apr 2013 at 11:22

GoogleCodeExporter commented 9 years ago
Thanks! I'll review this ASAP

Original comment by reingart@gmail.com on 5 May 2013 at 6:40

GoogleCodeExporter commented 9 years ago
This seems to be working with latest changes in trunk (revision 43d061b1f77).

Attached is a simple test / example

fvicente: it would be great if you could test it or provide more information 
(test credentials, input file, etc.)

Original comment by reingart@gmail.com on 29 Aug 2013 at 9:00

Attachments:

GoogleCodeExporter commented 9 years ago
Atached a better test/example.
It returns: {'EnviarResult': u'206|CNPJ informado inv\xe1lido'}

Original comment by reingart@gmail.com on 29 Aug 2013 at 9:03

Attachments:

GoogleCodeExporter commented 9 years ago
test added
it seems to be working ok

Original comment by reingart@gmail.com on 13 Sep 2013 at 3:20