Hi,
I am trying to pass an array from an asp page (JScript) to a dotnet web
service using the SOAP Toolkit 3.0. This is still at the Hello World stage,
as you can see:
WEB SERVICE METHOD
[WebMethod]
public string AcceptArray(object[] parameters)
{
return "no error!!!";
}
Can anyone post a very simple, working example of how the .asp page can pass
the array? Below you can see as far as I got, and the error message I'm
getting:
ASP PAGE
<%@ Language="JScript" %>
<%
var mySoapClient = Server.CreateObject("MSSOAP.SoapClient30");
mySoapClient.ClientProperty("ServerHTTPRequest") = true;
var myArray = new Array(0);
myArray[0] = "hallo";
mySoapClient.MSSoapInit("http://mywebservice/test.asmx?wsdl");
var answer = mySoapClient.AcceptArray(myArray);
Response.Write(answer);
//tidy up
mySoapClient = null;
%>
ERROR MESSAGE
Error Type: Client (0x80020005)
Client:Type conversion failure for element parameters
HRESULT=0x80020005:
Type mismatch. - Client:Unspecified client error.
HRESULT=0x80020005:
TIA
JON 10 9331
"Jon Maz" <jo****@surfeu.de.no.spam> wrote in
news:u0**************@TK2MSFTNGP15.phx.gbl: [WebMethod] public string AcceptArray(object[] parameters) { return "no error!!!"; }
You cant just simply pass objects. Everything has to be seriliazible and the
type known. Pass strings instead of objects. Im not sure if string[] will
work or not, but you can try it. string for sure will work.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu
"Jon Maz" <jo****@surfeu.de.no.spam> wrote in
news:u0**************@TK2MSFTNGP15.phx.gbl: [WebMethod] public string AcceptArray(object[] parameters) { return "no error!!!"; }
You cant just simply pass objects. Everything has to be seriliazible and the
type known. Pass strings instead of objects. Im not sure if string[] will
work or not, but you can try it. string for sure will work.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu
Hi,
Thanks for your reply.
Changing to string[] as follows does NOT work:
[WebMethod]
public string AcceptArray(string[] parameters)
{
return "no error!!!";
}
Same error as before:
Error Type: Client (0x80020005)
Client:Type conversion failure for element parameters
HRESULT=0x80020005: Type mismatch. - Client:Unspecified client error.
HRESULT=0x80020005: Type mismatch.
I know that string will work, but I really want to pass an *array*. Any
ideas?
TIA,
JON
Hi,
Thanks for your reply.
Changing to string[] as follows does NOT work:
[WebMethod]
public string AcceptArray(string[] parameters)
{
return "no error!!!";
}
Same error as before:
Error Type: Client (0x80020005)
Client:Type conversion failure for element parameters
HRESULT=0x80020005: Type mismatch. - Client:Unspecified client error.
HRESULT=0x80020005: Type mismatch.
I know that string will work, but I really want to pass an *array*. Any
ideas?
TIA,
JON
"Jon Maz" <jo****@surfeu.de.no.spam> wrote in news:unIFSXCaFHA.3976
@TK2MSFTNGP15.phx.gbl: I know that string will work, but I really want to pass an *array*. Any ideas?
I dont think arrays are serializable off hand. Use a collection instead, but
make sure its typed to a string.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu
"Jon Maz" <jo****@surfeu.de.no.spam> wrote in news:unIFSXCaFHA.3976
@TK2MSFTNGP15.phx.gbl: I know that string will work, but I really want to pass an *array*. Any ideas?
I dont think arrays are serializable off hand. Use a collection instead, but
make sure its typed to a string.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Blog: http://blogs.atozed.com/kudzu
Hi Chad,
Nice idea, but unfortunately not applicable to this scenario... Remember,
I'm going FROM classic asp (the web page calling the webservice via SOAP) TO
dotnet (the .asmx). In classic asp (AFAIK) all I *have* is simple arrays,
and there is no typing at all.
I assumed this must be a simple thing to do, but I've been searching the net
for days and haven't come up with a solution yet...
:-(
JON
Hi Chad,
Nice idea, but unfortunately not applicable to this scenario... Remember,
I'm going FROM classic asp (the web page calling the webservice via SOAP) TO
dotnet (the .asmx). In classic asp (AFAIK) all I *have* is simple arrays,
and there is no typing at all.
I assumed this must be a simple thing to do, but I've been searching the net
for days and haven't come up with a solution yet...
:-(
JON
Hi All,
Well, some progress. Have defeated the evil error message, but don't quite
understand how/why:
ASP PAGE
<%@ Language="JScript" %>
<%
var mySoapClient = Server.CreateObject("MSSOAP.SoapClient30");
mySoapClient.ClientProperty("ServerHTTPRequest") = true;
var myArray = new Array(0);
myArray[0] = "hallo";
myArray[1] = "goodbye";
var myArrayTwo = new Array(0);
myArrayTwo[0] = "nuts";
myArrayTwo[1] = "squirrel";
mySoapClient.MSSoapInit("http://mywebservice/test.asmx?wsdl");
var answer = mySoapClient.AcceptArray(myArray, myArrayTwo);
Response.Write(answer);
//tidy up
mySoapClient = null;
%>
WEB SERVICE
[WebMethod]
public string AcceptArray(string myArray, string myArrayTwo)
{
return myArray + " ????? " + myArrayTwo;
}
and I get this:
hallo,goodbye ????? nuts,squirrel
In other words, the classic asp array is being converted (god knows where)
into a comma-delimited string!
Can anyone explain??
TIA,
JON
Hi All,
Well, some progress. Have defeated the evil error message, but don't quite
understand how/why:
ASP PAGE
<%@ Language="JScript" %>
<%
var mySoapClient = Server.CreateObject("MSSOAP.SoapClient30");
mySoapClient.ClientProperty("ServerHTTPRequest") = true;
var myArray = new Array(0);
myArray[0] = "hallo";
myArray[1] = "goodbye";
var myArrayTwo = new Array(0);
myArrayTwo[0] = "nuts";
myArrayTwo[1] = "squirrel";
mySoapClient.MSSoapInit("http://mywebservice/test.asmx?wsdl");
var answer = mySoapClient.AcceptArray(myArray, myArrayTwo);
Response.Write(answer);
//tidy up
mySoapClient = null;
%>
WEB SERVICE
[WebMethod]
public string AcceptArray(string myArray, string myArrayTwo)
{
return myArray + " ????? " + myArrayTwo;
}
and I get this:
hallo,goodbye ????? nuts,squirrel
In other words, the classic asp array is being converted (god knows where)
into a comma-delimited string!
Can anyone explain??
TIA,
JON This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: John |
last post by:
I would like to pass array variables between URLs but I don't know
how. I know its possible with sessions, but sessions can become
useless if cookies are disabled. I have unsuccessfully tried...
|
by: Joe |
last post by:
I have 3 servers
server1: http://server1/login.asp, http://server1/page1.as
server2: http://server2/login.asp, http://server2/page1.as
server3: http://server3/login.asp, http://server3/page1.as
...
|
by: wilson |
last post by:
Dear all,
In this time, I want to pass array to function.
What should I declare the parameter in the function?i
int array or int array? Which one is correct?
...
|
by: Sai |
last post by:
I am new to this area,please bear with me for this basic question. :)
I have an xml schema file xyz.xsd file with me,That contains request and
response xml schema ,how can I proceed to create a...
|
by: David++ |
last post by:
Hi folks,
I would be interested to hear peoples views on whether or not 'pass by
reference' is allowed when using a Web Service method.
The thing that troubles me about pass-by-reference into...
|
by: Wijaya Edward |
last post by:
Hi,
How can I pass Array, Hash, and a plain variable
in to a function at the same time.
I come from Perl. Where as you probably know
it is done like this:
sub myfunc {
|
by: Jagdish |
last post by:
Hello,
Every body I have recently joined this group and I want to know how to pass Array of string to a Com object function..
Actually I want to pass String array from VB6 to Com Interface...
|
by: igotyourdotnet |
last post by:
Is there a way to pass data from page to page without the use of a Session
Variable or queryString?
I need to pass drop down box selections from page to page and have the drop
downs on the page be...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: ryjfgjl |
last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
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,...
|
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...
|
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,...
|
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...
| |