473,666 Members | 1,979 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Web Services

Hi all-

I am new to web services, so please bear with me. I have to have a web
service (Coded in Visual C#), and I need to have it work with Netscape
7.0 (Mozilla 1.0 I believe). I have it working perfectly with IE (with
the help of webservice.htc) , but cannot get it working in Netscape 7.0.
I have read articles on how to access Web Services through Javascript
with SOAP, but I get errors saying that "SOAPCall is undefined", etc.
Does anybody know how to access web service methods in javascript for
Netscape 7.0? Any help would be greatly appreciated. Thanks in
advance.

Jul 23 '05 #1
9 2213
VK
> I have to have a web service (Coded in Visual C#),
and I need to have it work with Netscape 7.0
(Mozilla 1.0 I believe).


I don't think that you can do it, especially with .htc blocks that you
call "web service" and which is Microsoft "behaviors" in the reality.
It *should* work though on Netscape 8.0 that has its dual-mode property
(so it can act as FF or IE upon the curcumstances). It makes me
suspitius though that you mention C# and .htc blocks in one context.
Could you give a sample HTML/XML page your're calling server-side
blocks from?

Jul 23 '05 #2


M B HONG 20 wrote:
I am new to web services, so please bear with me. I have to have a web
service (Coded in Visual C#), and I need to have it work with Netscape
7.0 (Mozilla 1.0 I believe). I have it working perfectly with IE (with
the help of webservice.htc) , but cannot get it working in Netscape 7.0.
I have read articles on how to access Web Services through Javascript
with SOAP, but I get errors saying that "SOAPCall is undefined", etc.
Does anybody know how to access web service methods in javascript for
Netscape 7.0? Any help would be greatly appreciated. Thanks in
advance.


As far as I remember SOAPCall is around since Mozilla 1.0 and thus
should be supported in Netscape 7.0. Do you have code that works with
later Netscape or Mozilla versions but gives the "SOAPCall is undefined"
error in Netscape 7.0? Do you have a URL where the error occurs?
I have no Mozilla 1.0 build here but in the Mozilla 1.1 build I have
SOAPCall is defined.

Of course 7.0 is quite old so it is always a good idea to upgrade (or
get your users to upgrade).

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #3
Hey thanks to both of you for your replies.

As for Netscape 7.0, I am aware that WSDL is supported in Netscape
7.1(Mozilla 1.4), but making it work for Netscape 7.0 is a must for me
im afraid. I have read some articles on calling web service methods
from Netscape 7.0 with SOAP, but I get a "SOAPCall is undefined" error
when i try running the script. Basically in my Web Service (C#) i just
have a simple function:

[WebMethod]
public bool ReturnTrue()
{
return true;
}

and in my client side script i have something like:
var soapCall = new SOAPCall();
soapCall.transp ortURI = ..... etc.

but the error occurs on the top line of the script, which is the
initialization of the SOAPCall. Do I need any sort of plugin or
additional reference to make this work? i used this site for
reference, by the way:
http://devedge-temp.mozilla.org/view.../index_en.html

regards.

Jul 23 '05 #4


M B HONG 20 wrote:

As for Netscape 7.0, I am aware that WSDL is supported in Netscape
7.1(Mozilla 1.4), but making it work for Netscape 7.0 is a must for me
im afraid. I have read some articles on calling web service methods
from Netscape 7.0 with SOAP, but I get a "SOAPCall is undefined" error
when i try running the script. Basically in my Web Service (C#) i just
have a simple function:

[WebMethod]
public bool ReturnTrue()
{
return true;
}

and in my client side script i have something like:
var soapCall = new SOAPCall();
soapCall.transp ortURI = ..... etc.

but the error occurs on the top line of the script, which is the
initialization of the SOAPCall. Do I need any sort of plugin or
additional reference to make this work? i used this site for
reference, by the way:
http://devedge-temp.mozilla.org/view.../index_en.html


The error is odd, I have grabbed a Mozilla 1.0 build and tried new
SOAPCall() and that creates an object.
The user agent string is
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530
and Netscape 7.0 should be some 1.0.1 or 1.0.2 release and thus have
SOAPCall too.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #5
Martin -

Thanks for your reply. You are right, it does work in Netscape 7.0 and
I got the SOAP object to be created. This brings me to another
question though, now that it is working, I can't seem to get the web
service method called. I think there is something wrong with my
syntax. Like i said before, my web service looks like this:

[WebMethod]
public bool SayGoodBye()
{
return false;
}

and my client script looks like this so far:

var soapCall = new SOAPCall(); //which now works, by the way
soapCall.transp ortURI = "http://localhost/test/Service1.asmx";
soapCall.encode (0, "SayGoodBye ", null, 0, null, null, null);
var result = soapCall.invoke ();
alert (result.value);
but I keep getting "undefined" instead of "false". I'm pretty sure its
my encode line, can you please tell me what's wrong? The webmethod
does not take any parameters, so i am not sure what to put there (the
last 2 parameters of the encode method). Thanks in advance.

Regards.

Jul 23 '05 #6


M B HONG 20 wrote:

You are right, it does work in Netscape 7.0 and
I got the SOAP object to be created.
Fine, then we have a starting point to work something out.
However when I have tested the interoperabilit y of Mozilla and .NET web
services some while ago I have unfortunately found that Mozilla is able
to understand the SOAP response of a .NET RPC style web service but that
..NET does not understand Mozilla's SOAP requests. But as your example
does not pass anything to the web service it should be possible to get
it to work with Mozilla (but as far as I know only if the service is RPC
style).
So you would need .NET C# code alike

[WebService(Name space="http://example.com/2005/06/BoolService")]
[SoapRpcService]
public class TestService : WebService {
This brings me to another
question though, now that it is working, I can't seem to get the web
service method called. I think there is something wrong with my
syntax. Like i said before, my web service looks like this:

[WebMethod]
public bool SayGoodBye()
{
return false;
}

and my client script looks like this so far:

var soapCall = new SOAPCall(); //which now works, by the way
soapCall.transp ortURI = "http://localhost/test/Service1.asmx";
I think you also need to set the action URI e.g.
soapCall.action URL = "http://example.com/2005/06/BoolService/SayGoodBye";
soapCall.encode (0, "SayGoodBye ", null, 0, null, null, null);
That should be
soapCall.encode (
0,
"SayGoodBye "
"http://example.com/2005/06/BoolService",
0,
null,
0,
null
);
where the URL is the one defined for your web service.
var result = soapCall.invoke ();
alert (result.value);


It is not that easy that the return value of the invoke call has a value
property. You should first check for an error e.g.
if (result.fault) {
alert(result.fa ult.faultString );
}
else {
var responseValues = result.getParam eters(false, {});
alert(responseV alues[0].value);
}

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #7
Martin - your continued help is greatly appreciated.

I have made some changes to my Web Service and client form to follow
your examples, but I'm afraid i am still getting "undefined" for the
values. My web service looks exactly like this, and is located in the
RemoteScripting folder inside of the wwwroot folder.

namespace RemoteScripting
{
[WebService(
Namespace="http ://localhost/RemoteScripting/Service1",
Name="HelloWebS ervice",
Description="Th is says hello/goodbye")]
//[SoapRpcService]
public class Service1 : System.Web.Serv ices.WebService
{
public Service1()
{
InitializeCompo nent();
}

#region Component Designer generated code

//Required by the Web Services Designer
private IContainer components = null;

/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeCompo nent()
{
}

/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if(disposing && components != null)
{
components.Disp ose();
}
base.Dispose(di sposing);
}

#endregion

[WebMethod]
public string SayHello(String strMyName)
{
return "Hello " + strMyName;
}

[WebMethod]
public bool SayGoodBye()
{
return false;
}
}
}

upon compile, the line "[SoapRpcService]" hits me back with an error,
saying "Namespace SoapRpcService could not be found".

and my client scriptblock looks like this:

<body onload="init(); " MS_POSITIONING= "GridLayout ">
<SCRIPT language="JavaS cript">
var soapCall = new SOAPCall();
soapCall.transp ortURI =
"http://localhost/RemoteScripting/Service1.asmx";
soapCall.action URI =
"http://localhost/RemoteScripting/Service1/SayGoodBye";
soapCall.encode (0, "SayGoodBye ",
"http://localhost/RemoteScripting/Service1", 0, null, 0, null);
var result = soapCall.invoke ();
document.Form1. elements["TextBox2"].value = result.value;
document.Form1. elements["TextBox1"].value =
result.fault.fa ultString;
the result.fault.fa ultString is null, so I'm guessing there are no
errors with the call. However, the value is still "undefined" , when it
should be "false". Do you see anything that is overtly wrong? thanks
again.

Charles.

Jul 23 '05 #8


M B HONG 20 wrote:

upon compile, the line "[SoapRpcService]" hits me back with an error,
saying "Namespace SoapRpcService could not be found".
It is in the .NET namespace
System.Web.Serv ices.Protocols
so you need
using System.Web.Serv ices.Protocols;
in your C# code.

var soapCall = new SOAPCall();
soapCall.transp ortURI =
"http://localhost/RemoteScripting/Service1.asmx";
soapCall.action URI =
"http://localhost/RemoteScripting/Service1/SayGoodBye";
soapCall.encode (0, "SayGoodBye ",
"http://localhost/RemoteScripting/Service1", 0, null, 0, null);
var result = soapCall.invoke ();
document.Form1. elements["TextBox2"].value = result.value;


Where did you get the idea that there is a single value property? There
is none, I have already outlined what you need to do:
var responseValues = result.getParam eters(false, {});
var firstValue = responseValues[0].value;

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #9
That did the trick. Thank you Martin, your continued help is greatly
appreciated.

Charles.

Jul 23 '05 #10

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

Similar topics

4
2241
by: rbt | last post by:
How does one associate a "Description" with a Windows service written in Python? I've just started experimenting with Python services. Here's my code... copied straight from Mr. Hammond's "Python Programming on Win32": import win32serviceutil import win32service import win32event class test_py_service(win32serviceutil.ServiceFramework): _svc_name_ = "test_py_service"
6
2555
by: cs | last post by:
I noticed there is some .net services on my winxp. One or two mention the CLR. Does that mean that my .net apps/services wont run before those services start? I need to run my service as early on as possible, it doesnt even need to be a service if there is a way to run .net apps before that, anyone knows what or where?
0
2153
by: Diego F. | last post by:
I've been days with that. I'm trying to work with web services sending and returning objects, and the web service must store some objects. - My first try (the most obvious in my opinion) was to use a class contained in a extern dll so the web service and the application can use it and send or return via web services: public customObject myWebMethod(customObject obj); . I saw that web services can't deal with this cause the WS creates...
26
1889
by: Mr Newbie | last post by:
What do I need to run a web service on my PC ? I know I need the .NET Framework, but do I need IIS Running ?
3
6498
by: Matt D | last post by:
I've got two web services that use the same data types and that clients will have to consume. I read the msdn article on sharing types (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnservice/html/service07162002.asp) but I don't want clients to have to add two web references and then manually have to edit the proxy classes. After doing some searching I found that putting references to multiple web services in a .disco...
7
6013
by: Stu | last post by:
Hi, I have a web service which returns a record set and works well integrated with an asp dot net page. However if I decided to develop a unix app will i be able to read the dataset as it is or do i need to write the xml as text from the web service and supply a DTD. Also any other pitfalls TIA
3
4995
by: Olivier BESSON | last post by:
Hello, I have a web service of my own on a server (vb.net). I must declare it with SoapRpcMethod to be used with JAVA. This is a simple exemple method of my vb source : >************************************************************************ > <WebMethod(), System.Web.Services.Protocols.SoapRpcMethod()> _ > Public Function HelloWorld() As > <System.Xml.Serialization.SoapElementAttribute("return")> String
2
2066
by: sdstraub | last post by:
I have created 5 services in my project, in the 1st service I set servicestorun = array of all 5 services, I have a project installer with 5 service installers, one for each service. I have code so that whenever any service starts, stops or timers elapse a log entry is created. When I install my project, and start the 1st service in the services console, it shows that the service started and I have the corresponding log entry confirming...
0
1803
by: krishnaraju | last post by:
HI to all, please help me.its urgent requirement. my question is this is the wsdl file i got from our client.please see at bottom. when iam trying to access that webmethods iam getting only byval params but i didnt get byref params.please let me know how to get byref values from web methods. please help me in this regard because its an urgent requirement. ------------------------wsdl...
1
2180
by: Data Entry Outsourcing | last post by:
Data Entry plays vital role in every business area. Data Entry is one such aspects of any business that needs to be handled properly for expanding your business. Data Entry is one of the leading elements for running a business successfully. Now Days it's a trend to outsource Data Entry Work to reliable service provider who provides excellent output out of their work. Many Companies or Organization prefer to outsource data entry work to...
0
8445
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
8356
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8640
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...
1
6198
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
5664
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
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4369
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2771
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.