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

Set request parameters for web services


My .net application is to consume a Java web services exposed using
AXIS.
The web service will extract the user name and password to perform some
custom authentication.
/** Java **/
userId = hReq.getParameter("wsUserName");
password = hReq.getParameter("wsPassword");

So my ASP.net application will need to set the user id and password to
be passed as a HTTP request parameters
upon calling the java web service.

I have added a web refernce to this web service inside my .net
application.
But i can't seems to find any methods or parameters to set the request
parameters.

I have search the web for issues similar to this but don't seems to get
any related help.
Does someone encounter this before???? Any help will be greatly
appreciated.

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #1
1 8451
I am not familiar with java web services. But what do you mean by
parameters?

Usually web service consist of using HTTP post method by setting SOAPAction
http header with a value of web service method url. The post contents would
be SoapEnvelope xml.

If you are saying that the wsUserName and wsPassword need to be http header
name and value pairs, then you are out side of SoapEnvelope. The Add Web
Reference feature does not help you. However you can manually edit the proxy
code that was generated with add web reference feature as shown below:

1) In the solution explorer, click on Show All Files.
2) Expand the Web References node all the way until you see Reference.cs
file (assuming you are writing C# code).
3) You should see a class (say TestService, whatever your webservice name
is) that derives from SoapHttpClientProtocol.
4) In the constructor, add following code, below the existing Url setting
code:

Uri uri = new Uri(this.Url);
System.Net.WebRequest req =this.GetWebRequest(uri);

req.Headers["wsUserName"] = "myuser";

req.Headers["wsPassword"] = "mypassword";

5) You can even modify the constructor signature to accept user name and
password and use those values to set headers.

If the above does not work for you, then you may need to use Web Service
Enahancements from micrsoft. You can search the MSDN for it.

Hope this helps.
Raghu/..
"wawa_piggy" <an**@anon.com> wrote in message
news:el**************@TK2MSFTNGP10.phx.gbl...

My .net application is to consume a Java web services exposed using
AXIS.
The web service will extract the user name and password to perform some
custom authentication.
/** Java **/
userId = hReq.getParameter("wsUserName");
password = hReq.getParameter("wsPassword");

So my ASP.net application will need to set the user id and password to
be passed as a HTTP request parameters
upon calling the java web service.

I have added a web refernce to this web service inside my .net
application.
But i can't seems to find any methods or parameters to set the request
parameters.

I have search the web for issues similar to this but don't seems to get
any related help.
Does someone encounter this before???? Any help will be greatly
appreciated.

Thanks.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Nov 12 '05 #2

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

Similar topics

0
by: Maciek | last post by:
Hi When I set Session state mode to StateServer (IIS 6.0; windows2003; .NET 2.0) in my application, I have recived this message:...
4
by: Jit Prasad | last post by:
I have a working client-side Vb.Net (.net v1.0) app that talks to a Webspere webservice on a windows 2000 server. The client side app runs on a citrix server, also a Windows 2000 server. The app...
1
by: jctwguy | last post by:
G'day all My pc is on a domain and I have a test server in a work group. all the web application and the web service are working fine locally, but when I copy the project using service extension...
8
by: Tim Reynolds | last post by:
Our .Net application calls a web method of aplpication 2 that resides on their Apache server. When I as a developer C#, Studios 2003, make the call to their web method from my desktop, I receive no...
13
by: trpost | last post by:
I am looking to make a small web app that will return the status of a website from the client browser. I tried this with AJAX and it worked great locally, but did not work for remote users...
3
by: Stuart Irving | last post by:
Hi, I've written a web service in C#/ .NET that is called by clients written in Delphi (we don't do Delphi any more) Using a .NET test harness the service works, but when called by a Delphi...
0
by: Shree | last post by:
While invoking the web service from client, I am setting the credentitals using the following code... ReportingService.Credentials = System.Net.CredentialCache.DefaultCredentials; But in...
6
by: Håkan | last post by:
Hi! I get HTTP/1.1 400 Bad Request when I try to access a aspx-page running on server 2003 SP1 from internet explorer 6 running on the same machine. Here is the URL I am using: ...
3
by: =?Utf-8?B?UGV0ZXIgU2NobWl0eg==?= | last post by:
HI, in one of my webservices I need to provide a string to the consuming application that can become really large (depending on user input). Unfortunately, if the string becomes too long, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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...
0
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,...

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.