473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Is there a simlpe SOAP -> method call example that doesn't use any transports, etc.?

I have not had any luck searching for a simple, simple example that
calls a method on an object given a SOAP string. Here's what I'm
looking for (in pseudocode):

string SOAPCall = "bla bla bla"; // SOAP method invocation XML
string SOAPResponse;
MyObject x = new MyObject();
// and here's where I don't know what to do
/* call the method on x as specified in SOAPCall and
get the output into SOAPResponse. */

Can anyone be of any assistance?

Thank you!
Nov 12 '05 #1
3 4862
"Nimai Malle" <ni*********@yahoo.com> wrote in message news:7a**************************@posting.google.c om...
I have not had any luck searching for a simple, simple example that
calls a method on an object given a SOAP string.
That's probably because it's impractical. What's the point of
SOAP without any transport? If I wanted to call a method on
an object I'm holding in my hand, creating a SOAP envelope
is the last thing I want to do.

SOAP's usefulness is when I want to call a method on the
object in Billy Jean's hand, over there. Or an object in
Heather's hand, in San Diego. Or an object in Dieter's
warehouse in Cologne, Germany, that's running on an
AS/400 midrange machine requiring me to digitally sign
the method call so Dieter knows it came from me and
not Heather.
string SOAPCall = "bla bla bla"; // SOAP method invocation XML
string SOAPResponse;
MyObject x = new MyObject();
Why not get rid of SOAPCall and SOAPResponse and just
say x.MyMethod( blah, blah)? It's both easier, and much
more efficient. :-)
Can anyone be of any assistance?


For the particular three objects you have in your example,
you could parse the SOAPCall string as XML and interpret
it to route to the correct method of MyObject using a number
of System.Reflection methods, call the method and then
return a value that you'd have to format as SOAP to store
in SOAPResponse.
Derek Harmon
Nov 12 '05 #2
Thank you Derek. I guess, this being the usenet and all, I forgot to
mention that:

I AM NOT A TOTAL IDIOT!

In the interest of keeping my original post brief, I did not include
the entire context surrounding my interest in acquiring such an
example. I would have thought it obvious that I wasn't trying write a
stand-alone application using SOAP calls.
That said, what I am interested in is what .NET Framework methods are
available (and possible used internally) for implementing the
functionality in HttpRuntime.ProcessRequest, for example.

Anyway, I understand your reply. Thank you.
Nov 12 '05 #3
"Nimai Malle" <ni*********@yahoo.com> wrote in message news:7a**************************@posting.google.c om...
That said, what I am interested in is what .NET Framework methods are
available (and possible used internally) for implementing the
functionality in HttpRuntime.ProcessRequest, for example.
From your first post and subject line, I would never have guessed you
were interested in the implementation of HttpRuntime.ProcessRequest( );
what it dealing with HTTP transport, and largely unrelated to SOAP? ;-)

ProcessRequest handles incoming HTTP requests (not necessarily SOAP,
but you know that) for ASP.NET. The file extension of the requested
resource is mapped to an HttpHandler implementation that knows how
to process and respond to that particular request. The handler is created,
and responsibility for driving the response is turned over to it.

If you look in the machine.config file, you will see an <httpHandlers> section
which associates types with various paths (often file extensions). When you
look at path="*.vb" for instance, you see it associated with the type: System.
Web.HttpForbiddenHandler. ASP.NET does not want IIS to answer requests
for source files that may exist in the web applications' folders, so this class will
construct a response that gets sent back to the end user saying "Forbidden."

One of those HttpHandlers, of course, is for the path="*.asmx", which is
a ASP.NET web service document. It's type is System.Web.Services.
Protocols.WebServiceHandlerFactory. That's about as soapy as Process-
Request itself gets.

If you want to see what .NET Framework methods HttpRuntime.Process-
Request uses internally, I suggest running ILDASM -- it's included in the
FrameworkSDK /bin folder (or the popular Reflector tool by Lutz Roeder)
-- on the System.Web assembly. It's not necessary to be fluent in MSIL
to read the disassembly, all of the .NET Framework method calls will jump
right out at you.

: : Anyway, I understand your reply. Thank you.

"Derek Harmon" <lo*******@msn.com> wrote in message news:uP*************@TK2MSFTNGP10.phx.gbl...

: :
For the particular three objects you have in your example,
you could parse the SOAPCall string as XML and interpret
it to route to the correct method of MyObject using a number
of System.Reflection methods, call the method and then
return a value that you'd have to format as SOAP to store
in SOAPResponse.


Let me elaborate, you may not have seen how this applies.

Use the System.Xml.* classes to interpret the SOAP envelope that
you're (it sounds like to me) posting from your SimpleWorkerRequest
subclass. The .NET Framework also uses System.Xml.Serialization
and the System.Runtime.Serialization.Formatters.Soap; but were I
writing it, I'd avoid using those if possible.

Use the classes in the System.Reflection namespace to instantiate an
instance of your object (e.g., ConstructorInfo or the CreateInstance( )
method of Type or AppDomain if you prefer) and invoke the right
method (e.g., MethodInfo or PropertyInfo; Invoke( ) or SetValue( )
methods).

Go back to the System.Xml.* classes to create the response containing
the method's return value; or to create a fault for any Exception you've
caught.

The actual WebService handler ASP.NET uses will look for (using
reflection) all sorts of Attributes adorning MyObject's metadata to
drive through certain parts of it's deserialization, processing, and
serialization of the response.
Derek Harmon
Nov 12 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Russell | last post by:
Using Python 2.3 and ZSI 1.2 I am having problems getting information back from a test web service running on a PC on our LAN. The SOAP request details (from the .asmxfile) are as follows: ...
0
by: Doug Farrell | last post by:
Hi everyone, I'm trying to build a program to interface to a SOAP/XML interface provided by one of our vendors. This interface is built with MS SOAP Toolkit 3.0, so I'm guessig they are running...
0
by: chr | last post by:
Hi, I'm trying to integrate a webservice into a c#-program, creating proxy classes from a wsdl-file with wsdl.exe. All works fine, except if containers are returned. Although I can see in the...
8
by: xmail123 | last post by:
Hi, As was pointed out whatever you return from a WebMethod needs to be serializable to SOAP. An ArrayList is not serializable. I will be needing to return other data types from web methods. ...
0
by: Daniel | last post by:
Hi, I need help signing SOAP/XML. Have been stuck with this for a couple of days now. I get the following error message from the server: "The security token could not be authenticated or...
7
by: beachdog | last post by:
I'm using Visual Studio 2005/C# to build a web client. The web server is something I've written in a different framework, which does not support generating wsdl, so I have hand-built a wsdl file,...
0
by: Michael_R_Banks | last post by:
All, I'm trying to use SOAP to pass a serialized object from a VB.net application to a PHP application. Is this at all possible? Any help will be appreciated. I have included a copy of the...
1
by: gcmartijn | last post by:
H! When I use php code nusoap everything works but with python I get everytime "Your session key does not exist or has expired" I use this code below: test =...
1
by: akumar8k | last post by:
when i am excusing the below code i am getting the error. Error 1 − <SOAP-ENV:Envelope SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> − <SOAP-ENV:Body> −
0
by: Philluminati | last post by:
I have a Perl SOAP Server which returns this SOAP Message when invoked: <?xml version="1.0" encoding="UTF-8"?><soap:Envelope xmlns:xsi="http:// www.w3.org/2001/XMLSchema-instance"...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.