|
There can be many reason, one of them can be you have not updated your web reference after making the change. if you can show me a bit of code I can try thinking more
|
|
|
|
|
thanks
here is my class which,c connstructor i cant access on my client side where i am surfing this web service
public class Search
{
#region variables
private string _section;
private string _gender;
private string _uname;
private string _name;
#endregion
#region constructors
//this constructor is not accessed
public Search(string section,string gender,string name, string uname)
{
this.Section =section;
this.Name =name;
this.Gender = gender;
this.UserName =uname;
}
public Search()
{
//
// TODO: Add constructor logic here
//
}
#endregion
#region properties
public string Name
{
get{
if (this._name == null|| this._name ==string.Empty ){return "%";}
return this._name.ToUpper ();}
set{ if( value == null ||value== string.Empty) {this._name ="%";}
else{this._name =value.ToUpper()+"%";}}
}
public string UserName
{
get
{
if (this._uname == null|| this._uname ==string.Empty ){return "%";}
return this._uname.ToUpper();}
set{if (value == null||value == string.Empty){this._uname ="%";}
else{this._uname =value.ToUpper()+"%";} }
}
public string Gender
{
get
{
if (this._gender == null|| this._gender ==string.Empty ){return "%";}
return this._gender;}
set {if (value == null||value == string.Empty){this._gender="%";}
else{this._gender =value;}}
}
public string Section
{
get
{
if (this._section == null|| this._section ==string.Empty ){return "%";}
return this._section.ToUpper ();}
set {if (value == null||value == string.Empty){this._section = "%";}
else{this._section = value;}}
//set{this._section = value;}
}
#endregion
}
//This is my web service method
public class Service1 : System.Web.Services.WebService
{
public Service1()
{
//CODEGEN: This call is required by the ASP.NET Web Services Designer
InitializeComponent();
}
#region Component Designer generated code
//Required by the Web Services Designer
private IContainer components = null;
///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
private void InitializeComponent()
{
}
///
/// Clean up any resources being used.
///
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Dispose();
}
base.Dispose(disposing);
}
#endregion
// WEB SERVICE EXAMPLE
// The HelloWorld() example service returns the string Hello World
// To build, uncomment the following lines then save and build the project
// To test this web service, press F5
///
/// it receives as Search type object and return a
/// data set object containg results, null if no data found
///
/// <param name="search" /> search type object which may contain
/// section, gender,name, user name information
///
/// <returns>
//this is the method being invoked by my client
[WebMethod]
public System.Data.DataSet GetEmployees(Search search)
{
try
{
DataSet ds = new EmployeeHanlder ().GetAllEmployees(search.Section,
search.Gender,search.UserName,search.Name);
if (ds==null||ds.Tables[0].Rows.Count ==0){return null;}
return ds;
}
catch{return null;}
//following is my client side code
private void ServiceInvoker()
{
DataSet ds = new DataSet ();
// here parameterized constructor is not available
Service1 ser = new Service1 ();
//just default is available " Search src = new Search();"
//it shud be parameterized
localhost.Search src = new Search ();
src.Section = "its";
ds = ser.GetEmployees (src);
int ctr =ds.Tables[0].Rows.Count;
}
best regards
hello
|
|
|
|
|
The code above looks fine to me. did you try updating your webservice. If your webservice is in a different solution try following:
1. In your main project right click on the webservice and click on update web reference.
2. In your Internet browser type in the webreference and see what come up.
Cheers.
|
|
|
|
|
Once i had the same problem that you do now
I believe that you can not have parameterized contructors in a class if you want to use them from client side
As i told you, when i tried to do that long time ago, it was .NET 2005 and i wasnt even able to add the web reference from the client (VB.NET 2005), cause i was getting the error that no parameterized contructor could be used
If the class that has the parameterized contructor wont be accesed from client side, then, there is no problem
Alexei Rodriguez
|
|
|
|
|
I have this weird problem.
Scenario: When I call a page (using XMLHTTP) and write the page info to a file and use that file as an attachment to send along with an email.
Problem Child: The problem is that I always get the html file in binary form therefore I need to convert it to string before writing.
Question: Why does it XMLHTTP return in binary form? (I use xmlHttp.responseText and NOT xmlHttp.responseBody)
Funniest part: I get the other file content in the normal form and it looks fine. (I use the same function to build the files)
My biggest problem is that the application is in Classical ASP otherwise if it was in .Net, I could have used htmltext = StrConv(conn.responseBody, vbUnicode) to just convert the binary to unicode).
Note: Having xmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" doesnt help either.
Im glad if somebody can shed some light on this problem.... Why does XMLHTTP returns in binary form???????
Thanks
|
|
|
|
|
Hi,
I tried to install KnowledgebasePublisher 2.0 on Windows Server 2003 - Standard Edition. IIS 6.0 running on this server and there are some other web pages running perfectly. I installed PHP 5.2.3 and My SQL 5.0.4 which are the requirements for KnowledgebasePublisher. Those are seems to running perfectly.
But when I load the home page of the KnowledgebasePublisher, it is empty. No errors.
How can I fix this? I'm not very good with web development technologies. So step by step help would be really helpful to me.
Thanx.
Sam
|
|
|
|
|
Hello,
Please am in need to how to implement a simple webservice to transfer the database from a client computer to a central computer.
Nana
|
|
|
|
|
You can use Web service by cread Webservice (If you dont have any webservise in your locahost)
Then in your project you must add WebReferen, choise Brown to your Webservice to this project; You can cornect to difirent server and use server's Webservise for using;
<br />
(WebService web = new WebService();<br />
Label1.Text=web.HelloWorld()
Please test again and reply if can't
|
|
|
|
|
Really easy
Make a Web service with a method that accepts a dataset and any other parameter that you need like client id...
The dataset should contain the whole datatabase or any info you need (i hope you are not trying to send to many records)
Once you have the dataset in the server side, you can just save those changes in the database in the server as you would with any other dataset
Im asumming you know how to make a webservice and i hope you do
Alexei Rodriguez
|
|
|
|
|
In my application I have a admin control panel where I can see the list of all the companies registerd with our system. We need to provide the option to login to any company from admin panel of the application. But at the same time I need to maintain a new session for each company i login to. For example If I login to company1 and i set the value of a session variable =1 and then i login to company2 and i set the value of a session variable = 2 then both of these values should be available in their respective sessions.
Please help me out!
Thanks in advance.
|
|
|
|
|
If i can understand your idear i dier; Please Post again your idear and tell me more about that. Examplete databese you using, application, what do you want, what about secsion... more and more details...???????/
|
|
|
|
|
Sessions are kept automatically for each client connected, you only need to set a variable like session("VarName")=1
If someone else connects a new session willl be started
Alexei Rodriguez
|
|
|
|
|
Hi,
I need to set the value of my hidden control. Up to this point I had just played around, have not created the full value of the hidden control. I just want to add the current local date, but that I will do. I just need to know how to set the value parameter from a value returned from a function.
My hidden control:
<input
id="hdnLocalDate"
type="hidden"
value="javascript:GetDateTime();"
runat="server" />
My javascript function:
<script type="text/javascript">
function GetDateTime()
{
var date = new Date();
// Year
var year = date.getFullYear();
// Month
var month = date.getMonth();
}
</script>
Please can someone help me?
Regards
ma se
|
|
|
|
|
Try the following
window.opener.document.forms("formname").elements("id (Example:hdnLocalDate) or name ").Value
Regards,
Vimal
If U Get Errors U Will Learn
If U Don't Get Errors U Have Learnt
|
|
|
|
|
I want to set the value of the hidden control. When I do the following:
Response.Write("hdnLocalDate = " + hdnLocalDate.Value);
I get the value to be something like GetDateTime().
regards
|
|
|
|
|
simply add a return statement to your function, that should work no?
<script type="text/javascript">
function GetDateTime()
{
var date = new Date();
return date.toString("DD/MM/YYYY");
}
</script>
|
|
|
|
|
When I do a Response.Write on the hidden controls value like:
Response.Write("hdnLocalDate = " + hdnLocalDate.Value);
..then it displays:
hdnLocalDate = javascript:GetDateTime();
What now?? If I do a view code, must it display the value property's value as the date returned?
|
|
|
|
|
Hmm, good point, of course the value field will never run the javascript, just take it as a string literal....how silly of me
You'd have to run some function when the page loads to populate the hidden field.
<br />
window.onload = function() {<br />
hdnLocalDate.value = new Date().toString("DD/MM/YYYY");<br />
}<br />
Of course with runat="server" on the hidden form field its ID could easily change if its inside an INamingContainer.
|
|
|
|
|
Does onload exist?? I typed in window. and then there was no onload option. I am using VS 2005.
It's still not working:
<script type="text/javascript">
<!-- // Hide from old browsers
window.onload = function()
{
hdnLocalDate.value = new Date().toString("DD/MM/YYYY");
}
//-->
</script>
<input
id="hdnLocalDate"
type="hidden"
runat="server" />
|
|
|
|
|
ma se wrote: Does onload exist?? I typed in window. and then there was no onload option. I am using VS 2005.
Javascript intellisense in practically non-existent in visual studio, personally I use Aptana for all my JS/CSS development.
My fault again that it doesn't work, using ID.attribute won't work you need a reference to the DOM element via getElementById. Try this:
<script type="text/javascript"><br />
<br />
<!--
window.onload = function()<br />
{<br />
document.getElementById('<%= hdnLocalDate.ClientID %>').value = new Date().toString("DD/MM/YYYY");<br />
}<br />
<br />
</script>
|
|
|
|
|
/// this is the code final, i have just test;
<title>Untitled Page
}
<asp:label id="Label1" runat="server" text="Label">
|
|
|
|
|
|
Unfortunately most of us are lacking in psychic ability today, so maybe if we could see the code it would be better...
|
|
|
|
|
The Code for the Above:
<title>Untitled Document
function frmSubmit() {
if( (document.get_quote.query.value).replace(/^\s+/g,'').replace(/\s+$/g,'')!="" && (document.get_quote.query.value).replace('Company name / code, MF name','')!="")
document.get_quote.submit();
}
|
|
|
|
|
That my friend is what we call Tag Soup. Try seperating out style from content, using more semantic markup (ditch the tables) with better use of CSS. Then I might be able to tell head from tail whats going on there. Oh and while your at it, why not use some progressive enhancement techniques to add the onclick handlers.
|
|
|
|