473,387 Members | 1,561 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,387 software developers and data experts.

webservice and method decoration

hi there,

i'm a newbie in this field and i hope i'm not asking a very stupid
question, but googling i didn't find my way out of here.

what i want to do is to write a method, export it through a webservice
in such a way that the result is sent back to the caller in a
compressed way (the soap header remains uncompressed, but the body of
the soap message is compressed). so i followed the instructions here:

http://www.mastercsharp.com/article....D=86&TopicID=7

and it's easy to understand what it does. at least i think so. the
problem is a step further. let's say i export the webmethod:

[WebMethod,CompressionExtension]
public string foo_method(...)
{
....
}

at the address http://localhost/mywebservice.asmx . now, if i try to
create a proxy for my webservice through the:

c:\wsdl http://localhost/mywebservice.asmx?wsdl

command, what i get is a (auto-generated) class containing a (auto-
generated) method:

[WebMethod]
public string foo_method(...)
{
....
}

this means that invokin the foo_method() from my proxy, i get an error
because the result is compressed while proxy expects it to be
uncompressed. so what i do is to modify the proxy method manually
adding the CompressionExtension.

the question is: how can i do in order to let wsdl to auto-generate
also the [CompressionExtension] decoration? in this way i can make
faster (and "batchable") my development and deployment phases. i hope
i was able to explain my trouble.

thank you in advantage for any hint you can give to me :)

have a nice day

francesco

May 10 '07 #1
3 2209
"Francesco Spegni" <fr**************@gmail.comwrote in message
news:11*********************@e51g2000hsg.googlegro ups.com...
hi there,

i'm a newbie in this field and i hope i'm not asking a very stupid
question, but googling i didn't find my way out of here.

what i want to do is to write a method, export it through a webservice
in such a way that the result is sent back to the caller in a
compressed way (the soap header remains uncompressed, but the body of
the soap message is compressed). so i followed the instructions here:

http://www.mastercsharp.com/article....D=86&TopicID=7

and it's easy to understand what it does. at least i think so. the
problem is a step further. let's say i export the webmethod:

[WebMethod,CompressionExtension]
public string foo_method(...)
{
...
}

at the address http://localhost/mywebservice.asmx . now, if i try to
create a proxy for my webservice through the:

c:\wsdl http://localhost/mywebservice.asmx?wsdl

command, what i get is a (auto-generated) class containing a (auto-
generated) method:

[WebMethod]
public string foo_method(...)
{
...
}
You should not be getting a [WebMethod] attribute on your proxy methods.
What command line did you use in the WSDL command?
--
John Saunders [MVP]
May 10 '07 #2
You should not be getting a [WebMethod] attribute on your proxy methods.
What command line did you use in the WSDL command?
oops, you're right i said a wrong thing: what i really get is
something like:

/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://
attiweb/Autentica", RequestNamespace="http://attiweb/",
ResponseNamespace="http://attiweb/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,

ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public CoppiaOfInt32String[] Autentica(string strUserCredentials)
{
object[] results = this.Invoke("Autentica", new object[] {
strUserCredentials});
return ((CoppiaOfInt32String[])(results[0]));
}

where "Autentica" is the name of my webmethod and "http://attiweb" is
the namespace of my webservice. it remains the problem: i would like
to prepose the method signature with something like:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(...),CompressionExtension]
.... rest of the method signature...

is that possible in some way?

to answer your question: the command i use is:

c:\wsdl http://localhost/mywebservice.asmx?wsdl

(as i specified in my first message).

thanx

May 11 '07 #3
"Francesco Spegni" <fr**************@gmail.comwrote in message
news:11**********************@e65g2000hsc.googlegr oups.com...
>
>You should not be getting a [WebMethod] attribute on your proxy methods.
What command line did you use in the WSDL command?

oops, you're right i said a wrong thing: what i really get is
something like:

/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAt tribute("http://
attiweb/Autentica", RequestNamespace="http://attiweb/",
ResponseNamespace="http://attiweb/",
Use=System.Web.Services.Description.SoapBindingUse .Literal,

ParameterStyle=System.Web.Services.Protocols.SoapP arameterStyle.Wrapped)]
public CoppiaOfInt32String[] Autentica(string strUserCredentials)
{
object[] results = this.Invoke("Autentica", new object[] {
strUserCredentials});
return ((CoppiaOfInt32String[])(results[0]));
}

where "Autentica" is the name of my webmethod and "http://attiweb" is
the namespace of my webservice. it remains the problem: i would like
to prepose the method signature with something like:

[System.Web.Services.Protocols.SoapDocumentMethodAt tribute(...),CompressionExtension]
... rest of the method signature...
Francesco,

I haven't tried this, but I believe that you can configure SOAP extensions
in the configuration file of your client application, the same way you can
for a web service application.

There is a more general mechanism, which will work for .NET clients, but is
more involved. See "Walkthrough: Customizing the Generation of Service
Descriptions and Proxy Classes" at
http://msdn2.microsoft.com/en-us/lib...yc(vs.80).aspx.
--
John Saunders [MVP]
May 11 '07 #4

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

Similar topics

11
by: Andy | last post by:
Make the story short, I have a VB.NET client interface calling .NET webservice, written in VB.NET as well. I am trying to make the client as thin as possible so I let the webservice part to...
7
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...
5
by: mtv | last post by:
Hi all, I have the following code: ================================ Webservice side: public class MyWS: WebService { private myLib.DataObject curDataObject;
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
0
by: batista | last post by:
Hi, I'm using webservice.htc to call a non-secure(without https) webservice method from a webpage. Now, if the webpage is not under https then everything works fine. But, when enable ssl in...
1
by: Paul | last post by:
I have simple web method like the following: public Person GetPerson() { return CreatePerson(); } When I compile the web service, it generates the following WSDL snippet:
3
by: Pebble | last post by:
Hi folks, I have a WebService that simply acts as a thin wrapper to a .Net dll. Literally almost zero code in the WebService. Parameters passed to the WebService are simply used as...
4
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.