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

Object reference not set to an instance of an object. #8

Closed
cambridgemike opened this issue Dec 13, 2009 · 9 comments
Closed

Object reference not set to an instance of an object. #8

cambridgemike opened this issue Dec 13, 2009 · 9 comments

Comments

@cambridgemike
Copy link

I'm not convinced this is an issue with Savon, but rather my struggling with the Soap in general. Maybe you will have a suggestion though.

I set up the XML and made the request using Savon. The request returned a SOAPFault, server error 500 with an error message "Object reference not set to an instance of an object." I had seen this before when i was missing required fields in the XML, so I copy and pasted the entire soap envelope into SoapUI and made the request. it worked perfectly from SoapUI though. Why would the request work in SoapUI but not through Savon? What other variables are there besides the contents of the envelope that I can use to debug this?

thanks in advance

mike

@rubiii
Copy link
Contributor

rubiii commented Dec 13, 2009

sounds weird. you could also compare if the http header generated by savon and soapUI are the same. if you can't find the problem, you could send me the logs from a soap call request and response as well as your soap-call-code (incl. your wsdl endpoint) and i'll have a look.

@cambridgemike
Copy link
Author

Hi, I sent you a message with some snippets of the log files (seemed a little long to post here).

Cheers,
mike

@rubiii
Copy link
Contributor

rubiii commented Dec 15, 2009

saw it, but it looks ok to me. so i really don't know where to continue here. access to make a successful soap request might be helpful. don't know if that's possible though.

@subakva
Copy link

subakva commented Dec 18, 2009

I just saw the same error while trying to access a .Net web service. I noticed that SoapUI defined a namespace for the service and used it for every element. Savon adds a namespace called "wsdl" to the request that I needed to use on each element in my request.

client = Savon::Client.new "http://example.com/danceparty?wsdl"
response = client.get_down do |soap|
  soap.body = {
    'wsdl:battle' => {
      'wsdl:style' => 'krump'
    }
  }
end

@rubiii
Copy link
Contributor

rubiii commented Dec 18, 2009

that's correct. up until now savon does not set namespaces automatically. that's why you can use string keys to make it work.

@cambridgemike
Copy link
Author

I think I might have found a clue to get this working for me. I followed this code snippet to make the SOAP request from ruby http://broadcast.oreilly.com/2008/12/creating-custom-soap-requests.html (it just makes the net-http request), and it failed in the same way that savon was failing. I think copied over to my manual approach everything that was in the header of the SOAP UI request, and it worked! It turned out having the 'user-agent' set was important.

Would it be possible to open the http header to the end user?

thanks,
mike

@rubiii
Copy link
Contributor

rubiii commented Jan 9, 2010

hey mike,

the http object will be made public in the upcoming release. so you'll be able to set timeouts and everything else directly on the net::http instance. going to release it this weekend.

cheers,
daniel

@rubiii
Copy link
Contributor

rubiii commented Jan 9, 2010

just released version 0.7.0. please refer to the changelog and wiki for information about how to access the http object and let me know if this works for you.

@rubiii
Copy link
Contributor

rubiii commented Jan 16, 2010

closing the issue. please reopen if this does not work.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants