Skip to content
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

Problem when send nfe #7

Closed
lucasgomide opened this issue Aug 5, 2015 · 12 comments
Closed

Problem when send nfe #7

lucasgomide opened this issue Aug 5, 2015 · 12 comments

Comments

@lucasgomide
Copy link

When I send nfe, i have this return

_SOAP response (status 500)_

<?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:VersionMismatch</faultcode><faultstring>Possible SOAP version mismatch: Envelope namespace http://www.w3.org/2003/05/soap-envelope was unexpected. Expecting http://schemas.xmlsoap.org/soap/envelope/.</faultstring><detail /></soap:Fault></soap:Body></soap:Envelope>

some ideas ?

@lucasgomide
Copy link
Author

I have this return too,

Connection reset by peer - SSL_connect

@phlcastro
Copy link

I got this error too.
If I change the xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" I got the error bellow:

SOAP response (status 415):
The server cannot service the request because the media type is unsupported.

@phlcastro
Copy link

@lucasgomide feel free to reach me if you want to combine efforts to solve it

@castillonicolasdaniel
Copy link
Contributor

I had the same problem. I'm using a forked version of the gem. The solution I found was changing the SOAP version of the Savon client inside nfe-paulistana to the default (1.1 instead of 1.2).

@phlcastro
Copy link

@castillonicolasdaniel I changed the line
https://github.com/iugu/nfe-paulistana/blob/master/lib/nfe-paulistana.rb#L24
to
version: 1
but now Im getting the error bellow:

SOAP response (status 415):
The server cannot service the request because the media type is unsupported.

this was what you did?
which version of savon are you using?

best regards

@castillonicolasdaniel
Copy link
Contributor

Hi @phlcastro .What I did was removing soap_version: 2 from this line. That way Savon uses the default version (1.1).

@phlcastro
Copy link

thanks @castillonicolasdaniel !!
actually I also needed to force Savon http client to use the following http header:

http.headers["Content-Type"] = "text/xml; charset=UTF-8"

and now it's working :)

but this is probably because Im using an old Savon gem version (1.1)

@pnegri
Copy link
Contributor

pnegri commented Aug 5, 2015

If you guys can fix it in the new version please submit pull request.

Best!
Patrick

2015-08-05 19:29 GMT-03:00 Paulo Henrique Castro notifications@github.com:

thanks @castillonicolasdaniel https://github.com/castillonicolasdaniel
!!
actually I also needed to force Savon http client to use the following
http header:

http.headers["Content-Type"] = "text/xml; charset=UTF-8"

and now it's working :)

but this is probably because Im using an old Savon gem version (1.1)


Reply to this email directly or view it on GitHub
#7 (comment).

Att
Patrick Negri - CEO
iugu.com
https://mailtrack.io/trace/link/dd086ace0ec6c2e67e450e34a75d74c6d34fbe3d?url=http%3A%2F%2Fiugu.com&signature=7f6c96ffc23bd8ce

  • Recebimentos e Assinaturas para a sua empresa

@lucasgomide
Copy link
Author

@castillonicolasdaniel nice !!!!

i am waiting the release (:

@pnegri
Copy link
Contributor

pnegri commented Aug 6, 2015

Are you guys sure it cant be fixed in 2.0?

I am saying that because lots of large rails application use that version.

2015-08-05 22:04 GMT-03:00 Lucas Gomide notifications@github.com:

@castillonicolasdaniel https://github.com/castillonicolasdaniel nice
!!!!

i am waiting the release (:


Reply to this email directly or view it on GitHub
#7 (comment).

Att
Patrick Negri - CEO
iugu.com
https://mailtrack.io/trace/link/52ae22532aa9cbb306a86533574dc5300e90aae5?url=http%3A%2F%2Fiugu.com&signature=7dbafe4231bf1fcf

  • Recebimentos e Assinaturas para a sua empresa

@castillonicolasdaniel
Copy link
Contributor

@pnegri do you mean to fix the error without changing the soap version? I
don't know to version 2.0 of what are you referring, I'm sorry.

2015-08-05 22:29 GMT-03:00 Patrick Negri notifications@github.com:

Are you guys sure it cant be fixed in 2.0?

I am saying that because lots of large rails application use that version.

2015-08-05 22:04 GMT-03:00 Lucas Gomide notifications@github.com:

@castillonicolasdaniel https://github.com/castillonicolasdaniel nice
!!!!

i am waiting the release (:


Reply to this email directly or view it on GitHub
<#7 (comment)
.

Att
Patrick Negri - CEO
iugu.com
<
https://mailtrack.io/trace/link/52ae22532aa9cbb306a86533574dc5300e90aae5?url=http%3A%2F%2Fiugu.com&signature=7dbafe4231bf1fcf

  • Recebimentos e Assinaturas para a sua empresa


Reply to this email directly or view it on GitHub
#7 (comment).

@phlcastro
Copy link

@pnegri it seems the problem is related to this:

https://github.com/savonrb/savon/blob/2f82b7dcb8643deae937c2bfd2b78c9da6477ebf/lib/savon/builder.rb#L15-L18

nfe.prefeitura.sp.gov.br used to accept the SOAP header http://www.w3.org/2003/05/soap-envelope, used by Savon when you set soap_version: 2

For no reason it started to raise an error:

Possible SOAP version mismatch: Envelope namespace http://www.w3.org/2003/05/soap-envelope was unexpected. 
Expecting http://schemas.xmlsoap.org/soap/envelope/.

So, if you use the default soap_version (or manually set it to 1), Savon will use the SOAP header value that nfe.prefeitura.sp.gov.br is asking for.

But who knows if tomorrow, nfe.prefeitura.sp.gov.br will change it again.. 😛

@alepaez alepaez closed this as completed in 0bcac64 Aug 7, 2015
alepaez added a commit that referenced this issue Aug 7, 2015
Changed Savon client SOAP version to 1.1, fixes #7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants