473,804 Members | 3,399 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

using the [WebMethod(Messa geName="...")] attribute

Hi,

I have discovered that if I use this syntax:

[WebMethod(Messa geName="foo")]
public string bar() {
return "hello, world";
}

then it is not possible to call the web service using the MS soap toolkit.
Trying to invoke the service with either the name foo or bar gives an error.

I'm afraid I'm not much of an expert on SOAP and WSDL (I was rather hoping
that using 2 microsoft implementations of the same standard would give me a
good chance of interoperabilit y without having to delve into the innards of
the standard)

Could someone explain whether this is a deficiency in the SOAP toolkit, or
is this feature (the ability to have the operation name different from the
SOAP action) an unofficial .Net extension of the web services standards?

TIA

Andy
Mar 16 '06 #1
2 3527
Hi Andy,

All that changes is the name of the element that wraps the parameters
(none in your case) and the SOAP Action header.

Without MessageName:

POST /Temp/AspNet20SandPit/Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/bar"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/">
<soap:Body>
<bar xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>

With MessageName="fo o":

POST /Temp/AspNet20SandPit/Service.asmx HTTP/1.1
Host: localhost
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/foo"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelop e xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:soap="htt p://schemas.xmlsoap .org/soap/envelope/">
<soap:Body>
<foo xmlns="http://tempuri.org/" />
</soap:Body>
</soap:Envelope>

It's been a while since I've used the Soap Toolkit but from memory this
should be pretty easy to do. Maybe you can post a snippet of how you're
creating the soap toolkit message.

Josh
http://www.thejoyofcode.com/

Mar 16 '06 #2
Josh Twist wrote:
<snip>

It's been a while since I've used the Soap Toolkit but from memory this
should be pretty easy to do. Maybe you can post a snippet of how you're
creating the soap toolkit message.


well, I'm calling it from VB, so my code just looks like this:

Dim Connection As new SoapClient30
Connection.MSSo apInit wsdlFile
Connection.foo
Connection.bar

this works by the MSSOAP dynamically creating a IDispatch interface
when the WSDL file is parsed. I guess what you're saying is that I have
to hook in at a lower level to impact the XML that gets sent?

Mar 16 '06 #3

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

Similar topics

0
295
by: Chris Leffer | last post by:
Hi. I created a web service with two overloaded methods, and used the MessageName attribute to differentiate them: <WebMethod(MessageName:="GetItemString")> _ Public Function GetItem(ByVal localItem As String) As String End Function <WebMethod(MessageName:="GetItemInteger")> _
2
3391
by: Doug | last post by:
Hello, For a long time we've been told that you can't overload web service calls but recently we found a way to do it using the WebMethod attribute as in the example below. This will allow us as you can see to have two web service methods of the same name and will show them as such in intellisense. I am wondering if there is any concern in doing this? Is there any documentation anywhere that explains what might be happening with SOAP...
10
2454
by: john bailo | last post by:
Can a web method be overloaded? To support varying numbers of input parameters?
12
5343
by: Noel | last post by:
Hello, I'm currently developing a web service that retrieves data from an employee table. I would like to send and retrieve a custom employee class to/from the webservice. I have currently coded the custom employee class and have built it as a separate library (employee.dll). This employee.dll is being referenced by both the web service and the windows application. I face the following problem when I send this class to the webservice.
1
4329
by: Simon Hart | last post by:
Hi, I thought I'd just open a thread in an attempt to get peoples feelers with regards to multithreading vs Async Web Service processing. Of course Web Services makes it easy to do Async method calling, but what if you are already in a worker thread in a Windows Forms application when doing the web service call. In this case there is no need to use Async Begin..End features that .NET kindly presents us with.
0
1021
by: goteti | last post by:
Hello, I have a method with these attributes: public GetCardsResponse GetCards(GetCardsRequest getCardsRequest) {
0
1849
by: urban011 | last post by:
I need to use XmlInclude to generate a description in the wsdl for a subtype for a given web method. I alos need to include the SoapRpcMethod directive and the use=literal attribute in order to conform to WS-I 1.1 for interop. When I do not include the public Person GetPerson(int ID) { Manager manager = new Manager(); return manager.GetPerson(ID); } But when I add the SoapRpcMethod, it does not generate the "Employee" class and...
1
20862
by: Glenn | last post by:
I am writing a Web Service in C# ASP.NET 2.0 that takes two optional parameters. One is an int and the other is a string. Below is the definition of the Web Method: public List<ModelFamilyModelFamilySearch(Nullable<intid, string name) { MyBusinessObject mbo = new MyBusinessObject(); return mbo.Search(id, name);
4
2158
by: bwrobo | last post by:
I've had a good run of help on this site when I get to an issue I struggle to think through. I have set-up a database through ASP that allows the site's owner to login into an Admin section and using a WYSIWYG editor dynamically change content on the site. The Editor I am using is TinyMCE. Where I have an issue is, when the editor uses ' or " within their text blob, I get a MySQL error... Which I assume is because the first time an...
0
9705
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9576
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10567
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10074
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9138
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6847
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5515
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5647
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2983
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.