I'm creating a web service using C#, and wondering if it is possible to capture the parameter passed in from the URL?
e.g. http://www.abc.com/webservice/service.asmx?para1=one¶2=two
Is there a function or something that can obtain the parameters like the normal Request.QueryString?
The nearest to a QueryString is when you are testing you can get a string like http://localhost:4740/WebSvcCS/Service.asmx?op=FilterAlphaNumeric.
If you want to monitor the traffic, your can install WSE and trace the traffic to a file.
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
is there any code sample to obtain the parameter value in c# (im coding the web service with c#)
i see there's a function called UrlParameterReader, but not much information on the usage of it on websites.
is it the function to obtain the parameter value?
what i'm actually trying to do is to create a web service data source for a drop-down list of infopath form,
i'm hoping that by using
http://www.abc.com/webservice/service.asmx?entityname=tableA&attributename=attrA as the web service url, the web service can make use of the parameter and returns the set of values for the picklist.
Having look at http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.urlparameterreader.aspx, you could do it that way but why not program web services a more conventional way?
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
hi thanks for your replies, really appreciate.
just realised i've been thinking too far off. could simply set the web method to take in a parameter, and the value can be passed in from infopath settings..
>I have the same question. Could you please share your code how you did?
What exactly do you need?
Click "Mark as Answer" on the post that helped you.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
olivevege
0 Points
4 Posts
Passing parameter into Web Service
Sep 22, 2007 08:23 AM|LINK
Hi,
I'm creating a web service using C#, and wondering if it is possible to capture the parameter passed in from the URL?
e.g. http://www.abc.com/webservice/service.asmx?para1=one¶2=two
Is there a function or something that can obtain the parameters like the normal Request.QueryString?
Thanks in advance!
Rgds
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: Passing parameter into Web Service
Sep 22, 2007 01:19 PM|LINK
The nearest to a QueryString is when you are testing you can get a string like http://localhost:4740/WebSvcCS/Service.asmx?op=FilterAlphaNumeric.
If you want to monitor the traffic, your can install WSE and trace the traffic to a file.
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
olivevege
0 Points
4 Posts
Re: Passing parameter into Web Service
Sep 22, 2007 02:05 PM|LINK
hi, really appreciate your reply :)
is there any code sample to obtain the parameter value in c# (im coding the web service with c#)
i see there's a function called UrlParameterReader, but not much information on the usage of it on websites.
is it the function to obtain the parameter value?
what i'm actually trying to do is to create a web service data source for a drop-down list of infopath form,
i'm hoping that by using http://www.abc.com/webservice/service.asmx?entityname=tableA&attributename=attrA as the web service url, the web service can make use of the parameter and returns the set of values for the picklist.
am I hoping for the impossible or...?
TIA!
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: Passing parameter into Web Service
Sep 22, 2007 06:59 PM|LINK
Having look at http://msdn2.microsoft.com/en-us/library/system.web.services.protocols.urlparameterreader.aspx, you could do it that way but why not program web services a more conventional way?
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
olivevege
0 Points
4 Posts
Re: Passing parameter into Web Service
Sep 22, 2007 07:38 PM|LINK
thanks for your advice, mind telling me how does the conventional way goes?
sorry, this is the first time i'm working on web service..
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: Passing parameter into Web Service
Sep 22, 2007 08:27 PM|LINK
Have a look at the following:
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
olivevege
0 Points
4 Posts
Re: Passing parameter into Web Service
Sep 23, 2007 06:48 AM|LINK
hi thanks for your replies, really appreciate.
just realised i've been thinking too far off. could simply set the web method to take in a parameter, and the value can be passed in from infopath settings..
thanks!
imei
Member
18 Points
17 Posts
Re: Passing parameter into Web Service
Jan 11, 2008 07:08 PM|LINK
I have the same question. Could you please share your code how you did?
Thanks!
imay
TATWORTH
All-Star
72415 Points
14017 Posts
MVP
Re: Passing parameter into Web Service
Jan 11, 2008 07:28 PM|LINK
>I have the same question. Could you please share your code how you did?
What exactly do you need?
This earns you a point and marks your thread as Resolved so we will all know you have been helped.
FAQ on the correct forum http://forums.asp.net/p/1337412/2699239.aspx#2699239
imei
Member
18 Points
17 Posts
Re: Passing parameter into Web Service
Jan 12, 2008 01:30 PM|LINK
Question:
How do I modify the above URL to take parameters? I tried something like below, all failed:
http://localhost:4740/WebSvcCS/Service.asmx?op=FilterAlphaNumeric&13&"xxx"
http://localhost:4740/WebSvcCS/Service.asmx?op=FilterAlphaNumeric¶1=13¶2="x"
Thanks!
ima