[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Using .Net SOAP service

Hasham

8/1/2007 4:59:00 AM

Hi,

I am getting this error while trying to access .NET based SOAP Web
service

#<SOAP::Mapping::Object:0xb7c86218>:
System.Web.Services.Protocols.SoapException: Server was unable to
process request. ---> System.NullReferenceException: Object reference
not set to an instance of an object. (SOAP::FaultError)

My code to access this service is:

require 'soap/wsdlDriver'
wsdl = 'http://www.dotnetsite.com/MyService/Service...
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
puts driver.GetVals('136')

I have tried many things but still i am not able to get this code
working. Please tell what should i do to get this working

4 Answers

Ben Burkert

8/1/2007 5:26:00 AM

0

Try putting the '136' in a SOAP::SOAPString or SOAP::SOAPInt:

p driver.GetVals(SOAP::SOAPString.new("136"))
or
p driver.GetVals(SOAP::SOAPInt.new(136))

If that doesn't work, i try using the wsdl2ruby generator to create
the class stubs. It will create a class for each parameter. In your
case, it will be something like:

p driver.GetVals( GetVals.new(SOAPString.new("136")))

-Ben

On Aug 1, 2007, at 12:00 AM, Hasham wrote:

> Hi,
>
> I am getting this error while trying to access .NET based SOAP Web
> service
>
> #<SOAP::Mapping::Object:0xb7c86218>:
> System.Web.Services.Protocols.SoapException: Server was unable to
> process request. ---> System.NullReferenceException: Object reference
> not set to an instance of an object. (SOAP::FaultError)
>
> My code to access this service is:
>
> require 'soap/wsdlDriver'
> wsdl = 'http://www.dotnetsite.com/MyService/Service...
> driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
> puts driver.GetVals('136')
>
> I have tried many things but still i am not able to get this code
> working. Please tell what should i do to get this working
>
>


Hasham

8/1/2007 12:35:00 PM

0

Thanks Ben,

I finally figured out the problem i had to pass arguments as hash like
this:

puts driver.GetVals(:parameter => "136")


On Aug 1, 10:25 am, Ben Burkert <b...@benburkert.com> wrote:
> Try putting the '136' in a SOAP::SOAPString or SOAP::SOAPInt:
>
> p driver.GetVals(SOAP::SOAPString.new("136"))
> or
> p driver.GetVals(SOAP::SOAPInt.new(136))
>
> If that doesn't work, i try using the wsdl2ruby generator to create
> the class stubs. It will create a class for each parameter. In your
> case, it will be something like:
>
> p driver.GetVals( GetVals.new(SOAPString.new("136")))
>
> -Ben
>
> On Aug 1, 2007, at 12:00 AM, Hasham wrote:
>
> > Hi,
>
> > I am getting this error while trying to access .NET based SOAP Web
> > service
>
> > #<SOAP::Mapping::Object:0xb7c86218>:
> > System.Web.Services.Protocols.SoapException: Server was unable to
> > process request. ---> System.NullReferenceException: Object reference
> > not set to an instance of an object. (SOAP::FaultError)
>
> > My code to access this service is:
>
> > require 'soap/wsdlDriver'
> > wsdl = 'http://www.dotnetsite.com/MyService/Service...
> > driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_driver
> > puts driver.GetVals('136')
>
> > I have tried many things but still i am not able to get this code
> > working. Please tell what should i do to get this working


NAKAMURA, Hiroshi

8/2/2007 1:22:00 AM

0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Thanks Ben for answering.

Hasham wrote:
> I finally figured out the problem i had to pass arguments as hash like
> this:
>
> puts driver.GetVals(:parameter => "136")

FYI: Generating stub files with wsdl2ruby.rb against a WSDL could help
to understand what arguments you should pass.

% wsdl2ruby.rb --wsdl Foo.wsdl --type client --force

Regards,
// NaHi

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.1 (Cygwin)

iQEVAwUBRrExqR9L2jg5EEGlAQJD5wf/RLB3kaPq115QqrkXGA/UoQy+0tF3s0u6
BaWDjyhOomXHwpbG01Xap4Hrn4Lj76RH5IM7gsnghAIdnmVUOarkIESiRMroGHnn
SLYivk18+BP9E5aC4/P9HhqgY2ENDyLbtEuZdwT03eeC8Ud9DcUUiyDwQJpCT+ot
M10KcWddGKZqutS2BBaoCfsVVPwm7ro8DybxHTu12Np9JDw8+/bs4dDNiWbElXH1
7R+clOEHHhx9mb03IWzo34tsVwFffWdEbl/Eo3XM57892wiTfZfRUvFvchqSLugo
7QOHMzN8TpSsd0b5JkhqcPl0wXn61p2waYFB7C4k78ubUj5V8jZudQ==
=7UJV
-----END PGP SIGNATURE-----

Ronnie Raygun And The Rayonets

2/12/2011 3:44:00 PM

0



"Phlip" wrote in message
news:903f8d9a-abc1-4826-8580-cdae2ae74f2c@q40g2000prh.googlegroups.com...

On Feb 11, 4:45 pm, "Yankee Doodle Dandy" <4...@may.net> wrote:

>> I have placed FOX under parental ban in my home so it's blacked-out
>> through
>> the remote and tuner.

>If you had a pair, you'd tell your cable provider to drop it. Your
>parental blocker can't stop you from subsidizing hate speech.

Fox is practically given away to every tv provider. That's why it is
included in even the most basic of packages.