473,549 Members | 2,346 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

webservice method with attribute asp.net

1 New Member
hello,

this has been asked before but no answers yet.. I need help!

how can write a webservice method with attribute ?

like this xml :
Expand|Select|Wrap|Line Numbers
  1. <soap:Envelope
  2. xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
  3. <soap:Body>
  4. <CalcArea xmlns="http://example.org/geometry/" unite="radian"
  5. floor="3">
  6. <length>2.3</length>
  7. <width>1.2</width>
  8. </CalcArea>
  9. </soap:Body>
  10. </soap:Envelope>
  11.  
what is the cs class / method for corresponding with this soap call ?
(with "unite" and "floor" attribute !)


thanks!
Dec 13 '08 #1
2 2092
Frinavale
9,735 Recognized Expert Moderator Expert
Hi there,

I don't fully understand your question.
You have posted some SOAP which is used to transfer information between a Web Service method and a client that is consuming the web service.

There is no cs class method that corresponds to it that I can see based on the details of your problem.

First you need to create a Web Service application and create a web method that does whatever you need to do.

Then you need to consume this Web Service in your application.

Please see this article on Consuming XML Web Service for more information.

-Frinny
Dec 15 '08 #2
balabaster
797 Recognized Expert Contributor
Decorate your CalcArea properties accordingly:
VB
Expand|Select|Wrap|Line Numbers
  1. Imports System.Xml.Serialization
  2. Class CalcArea
  3.  
  4.     <SoapAttribute(), XmlAttribute()> _
  5.     Public Property unit() as String...
  6.  
  7.     <SoapElement(), XmlElement()> _
  8.     Public Property Length As Single...
  9.  
  10. End Class
C#
Expand|Select|Wrap|Line Numbers
  1. using System.Xml.Serialization;
  2. Class CalcArea{
  3.  
  4.   [SoapAttribute(), XmlAttribute()]
  5.   public string unite() { get; set; }
  6.  
  7.   [SoapElement(), XmlElement()]
  8.   public single Length() { get; set; }
  9.  
  10. }

There's a reasonably comprehensive document on the MSDN website about this:
XML Serialization with XML Web Services
Dec 15 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

12
4106
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport) {
3
4204
by: Eric van der Niet | last post by:
I have thuis webservice. Used to get account information out of microsoft crm. But is reply's an error! can someone see whats the error in this code???? Help! using System; using System.Collections; using System.ComponentModel;
7
5378
by: stephan querengaesser | last post by:
hi ng, i try to invoke a webservice-method with an filter-object, that contains value types. if i don´t want to filter the return value of the method, i have to pass a new instance of the filter-object without setting any properties. but the value type-properties can´t be null and the filter is set to 0 (int) or false (bool). therefore i...
7
4967
by: Christian Wilhelm | last post by:
Hi! I'm trying to call a Java WebService out of a .net Client. There are two Methods, one Method requires one Parameter of type Parameter, the other Method requires one Parameter of type Parameter. I can call the first Method without Problems, the Parameter can be deserialized by the WebService. But if I want to call the second Method and...
2
2742
by: yqlu | last post by:
I hava developed a client in C# that is connected to a 3-party XML Web Services developed in Java based on the AXIS 1.1. Most methods call are successful except for one method named "findObjects" and return a complex type "FieldSearchResult". The error message as following : "Cannot assign object of type System.String to an object of type...
1
1665
by: hawkeye.parker | last post by:
using .net 1.1 i think i might want to replace the xml serializer which my .Net webservice uses with a custom serializer. anyone know: a) is this possible? b) if so, is it terribly difficult (to create a proper webservice compliant serializer and override the .net "default" webservice xml serializer)?
1
4023
by: jens Jensen | last post by:
Hello , i'm calling a webservice generated with oracle webservice java tools. I'm not able to add a web reference to a .net client the usual way with visual studio 2005. I was therefore provided with a set of Dll that implement the proxy needed to consume this web service. I'm now wrapping these dlls in a .Net webservice that can be...
0
1394
by: Nogusta123 | last post by:
My web service has a single method called "CheckEligibility". This method can be used to check a person's eligibility for multiple products. Each product has different data requiements so each product has its own Data transfer Object that inherits from the base DTO used by the "CheckEligibility" method. I am using the attribute to make...
4
7130
by: Jonathan | last post by:
I have a SQL stored procedure for adding a new record in a transactions table. It also has two return values: CounterID and IDKey. I want to create a webservice that accepts the 10 input parameters and returns the two return values. My C# programmer here says that webservice methods can only return 1 value per method. Is that right?...
0
7471
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...
0
7740
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. ...
1
7503
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7830
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...
1
5387
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5111
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...
0
3517
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...
1
1962
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1082
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.