472,790 Members | 1,312 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,790 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 8422
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: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.