|
Hi,
I build a web service in .Net. After adding this web service as a web reference in my website and when I am trying to use the methods in a web services by creating the object of it, I am getting only two methods which are equals and reference equals anyone knows why I am facing this issue?
Rock Star
|
|
|
|
|
Well, some code snippets would be nice. It would help us help you
One possibility without seeing your code is that your web service methods are missing the "WebMethod" attribute:
VB.NET
<WebMethod()> _
Public Function HelloWorld() As String
Return "Hello World"
End Function
C#
[WebMethod()]
public string HelloWorld()
{
return "Hello World";
}
|
|
|
|
|
public class Service1 : System.Web.Services.WebService
{
public DataSet UserDataset = new DataSet();
public SqlDataAdapter UserAdapter = new SqlDataAdapter("Select Query",new SqlConnection("connection string"));
[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public DataSet GetUserData()
{
UserAdapter.Fill(UserDataset);
return UserDataset;
}
[WebMethod]
public DataSet UpdateUserData(DataSet ds)
{
if(ds != null)
{
UserAdapter.Update(ds);
return ds;
}
else
{
return null;
}
}
private void InitializeComponent()
{
this.UserDataset = new System.Data.DataSet();
((System.ComponentModel.ISupportInitialize)(this.UserDataset)).BeginInit();
this.UserDataset.DataSetName = "NewDataSet";
((System.ComponentModel.ISupportInitialize)(this.UserDataset)).EndInit();
}
}
This is the source code but when I am trying to access any of this method by making an object of Service1 class I am getting only two function in intellisense that are Equals() and ReferenceEquals().
any idea why am I getting this issue?
Rock Star
|
|
|
|
|
Can I see the code you are using to call this web service?
|
|
|
|
|
Hi,
I am trying to call this web service in window application I am assigning generated dataset in web service to one of my dataset in windows application. The code is as follows
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Web.Services;
using System.Configuration.Assemblies;
using System.Xml;
namespace UserWindow
{
public partial class UserWindow : Form
{
public UserWindow()
{
InitializeComponent();
}
private void LoadData_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
ds = UserWebService1.Service1.(Here I am getting Reference, GenerateXMLMappings and EqualReference methods)
}
}
}
Rock Star
|
|
|
|
|
Try this:
private void LoadData_Click(object sender, EventArgs e)
{
DataSet ds = new DataSet();
UserWebService1.Service1 WebSrvc = new UserWebService1.Service1();
ds = WebSrvc.YouFunctionHere;
}
|
|
|
|
|
Thanx Its working now but what was the fault in previous code when I am trying to call methods directly.
Rock Star
|
|
|
|
|
You must always unless create an instance of the class before you can use it. UNLESS it's a static object.
|
|
|
|
|
I have objects being passed through web services that contain System.DateTimeOffset variables in them (I just changed from System.DateTime). When updating a web service reference in my client project, the auto-generated proxy code includes a definition for DateTimeOffset as a generic object under the service's namespace (instead of using the System.DateTimeOffset structure. Can anyone help me understand why this happens with this struct and not with the System.DateTime struct?
Update ~ Just ran across this as I was debugging a service; seems the DateTimeOffset is a non-standard primitive as far as DataContractSerializer is concerned:
"Unlike other primitive types, the DateTimeOffset structure is not a known type by default, so it must be manually added to the list of known types (see Data Contract Known Types)."[]
Jack of all trades ~ Master of none.
modified on Tuesday, June 29, 2010 3:58 PM
|
|
|
|
|
Hi,
Here's the situation:
We've some Crystal XI reports that are being called from an ASP page. Here's the code:
[CODE]
<OBJECT ID="CRViewer"
<% If AEMSFEATURE_CRYSTALREPORTSVERSION = 11 Then
Response.Write "CLASSID='CLSID:460324E8-CFB4-4357-85EF-CE3EBFE23A62' " _
& "CODEBASE='../../cgi-bin/crystalreportviewers11/ActiveXControls/ActiveXViewer.cab#Version=11,0,0,893' VIEWASTEXT "
End If %>
WIDTH="100%" HEIGHT="99%">
<PARAM NAME="EnableRefreshButton" VALUE=0>
<% If Request.QueryString("print") Then %>
<PARAM NAME="EnableToolbar" VALUE=0>
<% End If 'print %>
</OBJECT>
[/CODE]
It was a working solution - until we installed it on Windows 7 when the Viewer came up with grey screen, but allowed saving the report as pdf etc. correctly.
Anyways, we decided to switch to Crystal 2008 (12), but don't know the ClassID. Anybody knows how to fix the problem with Crystal 11 on Windows 7 (Viewer greyed out) or knows the ClassID for Crystal 12 ActiveXViewer?
Thanks,
Ekjon
|
|
|
|
|
Hey...guys, where is my help? Thanks.
|
|
|
|
|
|
Perfect!! Add video simply to your site; Play video easily on your site
Cool players: http://www.web-video-player.com/sampleplayer.php
Best Player for Web Videos-- Socusoft Web Video Player
=========
Free tutorials:
Web design: Best way to make MSN style internet video player:
http://www.web-video-player.com/support/easiest_way_make_online_player_msn_video_style.php
=========
YouTube/Media Conversion: Explore free functions of web video player:
http://www.web-video-player.com/support/explore_free_functions_of_socusoft_web_video_player.php
=========
Perfect Solutions: Trim, Split, Merge or Convert Videos and Extract Sound Clips:
http://www.web-video-player.com/support/trim-split-merge-convert-video-extract-audio.php
More:
Socusoft Web Video Player is an excellent tool which is integrated with powerful functions such as web video creation, video conversion (including video merging, video trimming, video playing), YouTube/Google video download and audio extraction. It provides fantastic solutions for making web videos.
[img]http://www.web-video-player.com/support/web-video-player/yahoo-video-news.jpg[/img]
|
|
|
|
|
Blatent advert. Please pay to advertise like everyone else.
Bob
Ashfield Consultants Ltd
Proud to be a Code Project MVP
|
|
|
|
|
cool
|
|
|
|
|
Hi
I wrote a code to send newsletter to all members of site. There are 1000 members on site. Some mails are bouncing back. How I can store bounce mail addresses directly in database.
How I can record - when my mail was read and how many times from which IP.
I have seen this working application in classic asp.
I am working in classic asp. Please guide.
thanks in advance
|
|
|
|
|
Poonam Devi wrote: Some mails are bouncing back. How I can store bounce mail addresses directly in database.
These bounced mails are delivered to your email-address. You'd need to make a connection, probably using POP, to read them and flag those in your database.
Poonam Devi wrote: How I can record - when my mail was read and how many times from which IP.
Invest 1-3 hours in reading this[^] Coding4Fun article. Once you're done, consider that the image could be 1 pixel by 1 pixel, and it could be white. Hence, you don't see it - but your code will execute when the mailbrowser opens the image, which in turn gives you the change to flag a record in your database, with the requesting IP and the current date and time.
Happy Programming
I are Troll
|
|
|
|
|
Thanks for your answer.
Suggested link is in asp.net I want in classic asp.
You'd need to make a connection, probably using POP, to read them and flag those in your database.
-Can you guide how to make a connection using pop.
Please guide
Thanks
|
|
|
|
|
Poonam Devi wrote: Suggested link is in asp.net I want in classic asp.
In that case you better try to write it in ASP Classic. You can use the ASP.NET version as an example. In other words; I'm not going to translate the article to ASP Classic.
Poonam Devi wrote: Can you guide how to make a connection using pop.
That's explained here[^]
I are Troll
|
|
|
|
|
its visible in all the browsers except below ie7.
|
|
|
|
|
It surprised me at first, with nothing being displayed.
But later i discovered, if proper content was given within form, it displayed image properly.
specifying min-height, served no purpose with IE7.
Ravie Busie
Coding is my birth-right and bugs are part of feature my code has!
|
|
|
|
|
Hi, I was wondering if anyone could help/advise me on how I can write an iPhone application using C# or VB .NET / Visual Studio.
I have seen Mono but I don't want to pay $400. Is there another free bit of kit I can use?
Thanks in advance
|
|
|
|
|
|
Danpeking wrote: I have seen Mono but I don't want to pay $400
Mono is free software?
I are Troll
|
|
|
|
|