473,749 Members | 2,356 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.getParamet er("wsUserName" );
password = hReq.getParamet er("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 8472
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 SoapHttpClientP rotocol.
4) In the constructor, add following code, below the existing Url setting
code:

Uri uri = new Uri(this.Url);
System.Net.WebR equest req =this.GetWebReq uest(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.co m> wrote in message
news:el******** ******@TK2MSFTN GP10.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.getParamet er("wsUserName" );
password = hReq.getParamet er("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
800
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: ----------------------------------------------------------------------------------------------------------------- Unable to make the session state request to the session state server. Please ensure that the ASP.NET State service is started and that the client and server ports are the same. If the server is on a...
4
5136
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 worked ok till I installed .Net v1.1 on the citrix, now I get an error when I get the app to use .NET v1.1. If the app uses .NET v1.0 (with .NET v1.1 stalled), then its ok, however I must use v1.1 for other reasons. Has somebody come across...
1
41716
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 to this test machine it wasnt working at the begining. Created a virtual website for the web service project doesnt work initially and I found solution as I should put HttpGet and HttpPost in webconfig and its perfect.
8
14101
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 exceptions - completes fine. Their web service url was added as a web reference to our project with no problem. The following was generated as part of the proxy class: /// <remarks/> public DueDateAvailabilityResponse...
13
12412
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 accessing the page, I ran into the security problem with making a cross domain request. I have been reading that with JSON a cross domain request can be accomplished, but have not been able to find any examples on how to use it or how to get the return...
3
1684
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 client all the input parameters arrive as null, empty string or 0. I wonder if the Delphi components are producing invalid XML, but I need to view the request...
0
2197
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 debugger when I check the properties - 'domain', 'user name' and 'password' set in the ReportingService.Credentials; they are blank!!!
6
3579
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
34239
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 following error occurrs: System.Web.Services.Protocols.SoapException was unhandled Actor="" Lang="" Message="System.Web.Services.Protocols.SoapException: There was an
0
8996
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9566
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9388
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9254
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 choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8256
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6800
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6078
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2791
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.