Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

A newbie query about Soap4R and dot net web services

3 views
Skip to first unread message

David Moore

unread,
Nov 18, 2003, 9:08:02 AM11/18/03
to
Can anyone help me with this Soap4r problem?

I have created a simple web service in dot net using Visual studio and
have modified a sample program from the Soap4r distribution to access
it.

Here's the program:

require 'soap/rpc/driver'

class Exchange
ForeignServer = "http://dmoorexp/calcwebservice/service1.asmx"
MyServiceNamespace = 'http://dlogic.com/dmwebservices'

def initialize
@drv = SOAP::RPC::Driver.new(ForeignServer, MyServiceNamespace)
@drv.add_method("Mul", "x", "y")
end

def mul(x, y)
@drv.call(Mul)
return @drv.Mul(x, y)
end
end

e = Exchange.new()
e.mul(10,20)

when run I get the message:

#<SOAP::Mapping::Object:0x2dd5d90>: Server did not recognize the value
of HTTP Header
SOAPAction: . (SOAP::FaultError)

Here is the soap header that the visual studio diagnostic program says
is expected.

POST /calcwebservice/service1.asmx HTTP/1.1
Host: dmoorexp
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://dlogic.com/dmwebservices/Mul"

Any suggestions as to how I can diagnose what is going wrong? I am a
newcomer to Soap and Soap4r. Is there any good tutorial material
covering how to access dot net webservices?

Thanks for anything!
David Moore

NAKAMURA, Hiroshi

unread,
Nov 18, 2003, 9:44:54 AM11/18/03
to
Hi,

> From: "David Moore" <dave...@yahoo.com>
> Sent: Tuesday, November 18, 2003 11:12 PM

> @drv = SOAP::RPC::Driver.new(ForeignServer, MyServiceNamespace)
> @drv.add_method("Mul", "x", "y")

Try this;
@drv.add_method_with_soapaction("Mul", "http://dlogic.com/dmwebservices/Mul", "x", "y")

Regards,
// NaHi


Schm...@t-systems.com

unread,
Nov 18, 2003, 9:48:49 AM11/18/03
to
Hi,

last week I encountered the same problem.
I modified a sample program in the soap4r distribution.
Hope i helps.

Roland

-------------------------------
###file: service.rb

require "soap/rpc/driver"
require "RechnerServiceModule"
include RechnerServiceModule

server = 'http://localhost:8080/WSSE_Service/RechnerService.asmx'

wiredump_dev=STDERR

service = SOAP::RPC::Driver.new(server, RechnerServiceModule::InterfaceNS)
service.wiredump_dev=wiredump_dev

service.default_encodingstyle = SOAP::EncodingStyle::ASPDotNetHandler::Namespace
RechnerServiceModule::add_method(service)

result = service.mul(2,2)

print("Result: ", result)


###file:servicemodule.rb
module RechnerServiceModule
InterfaceNS = 'http://schemas.t-systems.com/wse/RechnerService'
Methods=[['mul', 'a','b'],['minus', 'a','b'],['plus', 'a','b'],['hello']]

def RechnerServiceModule.add_method(drv)
Methods.each do |method, *param|
drv.add_method_with_soapaction(method, InterfaceNS+"/#{ method }", *param)
end
end
end

NAKAMURA, Hiroshi

unread,
Nov 18, 2003, 9:54:55 AM11/18/03
to
Hi,

> From: <Schm...@t-systems.com>
> Sent: Tuesday, November 18, 2003 11:48 PM

> last week I encountered the same problem.
> I modified a sample program in the soap4r distribution.
> Hope i helps.

[snip]

This is far better than my answer. Thanks.

Regards,
// NaHi


Schm...@t-systems.com

unread,
Nov 18, 2003, 10:07:56 AM11/18/03
to
No,

your examples/answers are really helpful, i just copy and paste!

-----Ursprüngliche Nachricht-----
Von: NAKAMURA, Hiroshi [mailto:naka...@sarion.co.jp]
Gesendet: Dienstag, 18. November 2003 15:55
An: ruby...@ruby-lang.org
Betreff: Re: A newbie query about Soap4R and dot net web services

David Moore

unread,
Nov 24, 2003, 9:08:36 AM11/24/03
to
Roland,
thanks for replying. I have eventually read your message sufficiently
carefully to clear up a few items. I now have a test program
apparently identical in all important respects to yours. It generates
the following message

<?xml version="1.0" encoding="us-ascii" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:mul xmlns:n1="http://dlogic.com/dmwebservices">
<n1:a>2</n1:a>
<n1:b>2</n1:b>
</n1:mul>
</env:Body>
</env:Envelope>

However when the parameters of this function hit the ASP.NET web
service function they are changed to 0. Can you help me to find a
reason for this?

David Moore


Schm...@t-systems.com wrote in message news:<7858A15CC1C78E4CAC0E...@G8PJ4.blf01.telekom.de>...

0 new messages