Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Using .Net SOAP service

Reply
Thread Tools

Using .Net SOAP service

 
 
Hasham
Guest
Posts: n/a
 
      08-01-2007
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.asmx?WSDL
driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_drive r
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

 
Reply With Quote
 
 
 
 
Ben Burkert
Guest
Posts: n/a
 
      08-01-2007
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.asmx?WSDL
> driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_drive r
> 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
>
>



 
Reply With Quote
 
 
 
 
Hasham
Guest
Posts: n/a
 
      08-01-2007
Thanks Ben,

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

puts driver.GetVals(arameter => "136")


On Aug 1, 10:25 am, Ben Burkert <(E-Mail Removed)> 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.asmx?WSDL
> > driver = SOAP::WSDLDriverFactory.new(wsdl).create_rpc_drive r
> > 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



 
Reply With Quote
 
NAKAMURA, Hiroshi
Guest
Posts: n/a
 
      08-02-2007
-----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(arameter => "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
BaWDjyhOomXHwpbG01Xap4Hrn4Lj76RH5IM7gsnghAIdnmVUOa rkIESiRMroGHnn
SLYivk18+BP9E5aC4/P9HhqgY2ENDyLbtEuZdwT03eeC8Ud9DcUUiyDwQJpCT+ot
M10KcWddGKZqutS2BBaoCfsVVPwm7ro8DybxHTu12Np9JDw8+/bs4dDNiWbElXH1
7R+clOEHHhx9mb03IWzo34tsVwFffWdEbl/Eo3XM57892wiTfZfRUvFvchqSLugo
7QOHMzN8TpSsd0b5JkhqcPl0wXn61p2waYFB7C4k78ubUj5V8j ZudQ==
=7UJV
-----END PGP SIGNATURE-----

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SOAP Header in a Dot Net 2.0 Web Service Client Consuming a WCF 3.0 service. Curt K ASP .Net Web Services 3 06-15-2007 10:19 PM
soap using remoting vs soap using web services B. Deepak ASP .Net Web Services 2 06-21-2006 07:14 AM
Problem of using apache soap to consume WSE 2.0 soap attachment Mullin Yu ASP .Net Web Services 0 10-08-2003 08:09 AM
To SOAP or Not To SOAP? mooseshoes XML 3 09-21-2003 04:38 PM
SOAP Client creation in ASP.NET using MS SOAP Toolkit Sham Ramakrishnan ASP .Net 2 07-01-2003 11:29 AM



Advertisments