473,499 Members | 1,724 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Urgent: Webservice method not recognizing parameters

Hey all,

I have a SOAP envelope with which I try to communicate to a webservice.
Everything is fine, but when I try to access a parameter of the webservice
method, I get the Object reference not set to an instance of the object
error.

This is the method:

public string query(string type, string[] someValues)
{
// As soon as I try to access a parameter, eg. type.Length or
someValues.Length, I get the error
}

The soap body looks like this:

msg = msg & "<soap:Body>"
msg = msg & "<query xmlns='xxxxxx'>"
msg = msg & "<type>type1</type>"
msg = msg & "<someValues>"
msg = msg & "<string>value1</string>"
msg = msg & "<string>value2</string>"
msg = msg & "<string>value3</string>"
msg = msg & "<string>value4</string>"
msg = msg & "</someValues>"
msg = msg & "</query>"
msg = msg & "</soap:Body>"

-----------------------

So what exactly am I missing here? I've used this before and it worked fine.
So I'm completely in the dark as to why I get this error. I hope someone can
help me with this. Thanks :)


Nov 16 '05 #1
4 1592
Razzie,

I am curious, are you on the receiving end of this call? If so, then
why are you not using ASP.NET to expose the web service? This way, you
don't have to worry about the plumbing in between your method and it being
exposed to the outside world.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hey all,

I have a SOAP envelope with which I try to communicate to a webservice.
Everything is fine, but when I try to access a parameter of the webservice
method, I get the Object reference not set to an instance of the object
error.

This is the method:

public string query(string type, string[] someValues)
{
// As soon as I try to access a parameter, eg. type.Length or
someValues.Length, I get the error
}

The soap body looks like this:

msg = msg & "<soap:Body>"
msg = msg & "<query xmlns='xxxxxx'>"
msg = msg & "<type>type1</type>"
msg = msg & "<someValues>"
msg = msg & "<string>value1</string>"
msg = msg & "<string>value2</string>"
msg = msg & "<string>value3</string>"
msg = msg & "<string>value4</string>"
msg = msg & "</someValues>"
msg = msg & "</query>"
msg = msg & "</soap:Body>"

-----------------------

So what exactly am I missing here? I've used this before and it worked fine. So I'm completely in the dark as to why I get this error. I hope someone can help me with this. Thanks :)


Nov 16 '05 #2
Hey Nicholas,

I'm not quite sure if I understand what you mean.
The webservice will be made public eventually for customers of the company.
We want to support SOAP as a way of communicating with it for them. So
that's why I am testing a soap script with it. Or is that not what you mean?

Thanks,

Razzie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:eY*************@tk2msftngp13.phx.gbl...
Razzie,

I am curious, are you on the receiving end of this call? If so, then
why are you not using ASP.NET to expose the web service? This way, you
don't have to worry about the plumbing in between your method and it being
exposed to the outside world.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hey all,

I have a SOAP envelope with which I try to communicate to a webservice.
Everything is fine, but when I try to access a parameter of the webservice method, I get the Object reference not set to an instance of the object
error.

This is the method:

public string query(string type, string[] someValues)
{
// As soon as I try to access a parameter, eg. type.Length or
someValues.Length, I get the error
}

The soap body looks like this:

msg = msg & "<soap:Body>"
msg = msg & "<query xmlns='xxxxxx'>"
msg = msg & "<type>type1</type>"
msg = msg & "<someValues>"
msg = msg & "<string>value1</string>"
msg = msg & "<string>value2</string>"
msg = msg & "<string>value3</string>"
msg = msg & "<string>value4</string>"
msg = msg & "</someValues>"
msg = msg & "</query>"
msg = msg & "</soap:Body>"

-----------------------

So what exactly am I missing here? I've used this before and it worked

fine.
So I'm completely in the dark as to why I get this error. I hope someone

can
help me with this. Thanks :)



Nov 16 '05 #3
Razzie,

Instead of writing your own request for the web service, why not just
create a test project and set a reference to the web service? This way, you
can test the web serivce, and not have to write all that plumbing code
yourself.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:OI**************@tk2msftngp13.phx.gbl...
Hey Nicholas,

I'm not quite sure if I understand what you mean.
The webservice will be made public eventually for customers of the company. We want to support SOAP as a way of communicating with it for them. So
that's why I am testing a soap script with it. Or is that not what you mean?
Thanks,

Razzie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:eY*************@tk2msftngp13.phx.gbl...
Razzie,

I am curious, are you on the receiving end of this call? If so, then
why are you not using ASP.NET to expose the web service? This way, you
don't have to worry about the plumbing in between your method and it being exposed to the outside world.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
Hey all,

I have a SOAP envelope with which I try to communicate to a webservice. Everything is fine, but when I try to access a parameter of the webservice method, I get the Object reference not set to an instance of the object error.

This is the method:

public string query(string type, string[] someValues)
{
// As soon as I try to access a parameter, eg. type.Length or
someValues.Length, I get the error
}

The soap body looks like this:

msg = msg & "<soap:Body>"
msg = msg & "<query xmlns='xxxxxx'>"
msg = msg & "<type>type1</type>"
msg = msg & "<someValues>"
msg = msg & "<string>value1</string>"
msg = msg & "<string>value2</string>"
msg = msg & "<string>value3</string>"
msg = msg & "<string>value4</string>"
msg = msg & "</someValues>"
msg = msg & "</query>"
msg = msg & "</soap:Body>"

-----------------------

So what exactly am I missing here? I've used this before and it worked

fine.
So I'm completely in the dark as to why I get this error. I hope

someone can
help me with this. Thanks :)




Nov 16 '05 #4
Ah yes. I did that too - that works. It's not the webservice what I'm think
is not working, but there is something wrong with the SOAP envelope. I just
can't figure out what it is though. If anyone still has a suggestion, I'd
appreciate it.

Thanks.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:O%***************@tk2msftngp13.phx.gbl...
Razzie,

Instead of writing your own request for the web service, why not just
create a test project and set a reference to the web service? This way, you can test the web serivce, and not have to write all that plumbing code
yourself.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:OI**************@tk2msftngp13.phx.gbl...
Hey Nicholas,

I'm not quite sure if I understand what you mean.
The webservice will be made public eventually for customers of the

company.
We want to support SOAP as a way of communicating with it for them. So
that's why I am testing a soap script with it. Or is that not what you

mean?

Thanks,

Razzie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote

in
message news:eY*************@tk2msftngp13.phx.gbl...
Razzie,

I am curious, are you on the receiving end of this call? If so, then why are you not using ASP.NET to expose the web service? This way, you don't have to worry about the plumbing in between your method and it being exposed to the outside world.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Razzie" <ra****@quicknet.nl> wrote in message
news:uH**************@TK2MSFTNGP11.phx.gbl...
> Hey all,
>
> I have a SOAP envelope with which I try to communicate to a webservice. > Everything is fine, but when I try to access a parameter of the

webservice
> method, I get the Object reference not set to an instance of the object > error.
>
> This is the method:
>
> public string query(string type, string[] someValues)
> {
> // As soon as I try to access a parameter, eg. type.Length or
> someValues.Length, I get the error
> }
>
> The soap body looks like this:
>
> msg = msg & "<soap:Body>"
> msg = msg & "<query xmlns='xxxxxx'>"
> msg = msg & "<type>type1</type>"
> msg = msg & "<someValues>"
> msg = msg & "<string>value1</string>"
> msg = msg & "<string>value2</string>"
> msg = msg & "<string>value3</string>"
> msg = msg & "<string>value4</string>"
> msg = msg & "</someValues>"
> msg = msg & "</query>"
> msg = msg & "</soap:Body>"
>
> -----------------------
>
> So what exactly am I missing here? I've used this before and it worked fine.
> So I'm completely in the dark as to why I get this error. I hope someone can
> help me with this. Thanks :)
>
>
>
>
>
>



Nov 16 '05 #5

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

Similar topics

4
9466
by: ramarnath | last post by:
Problem in sending datatime format to the .net webservice from php. description follows. I've created a .net webservice. ..Net Webservice: <WebMethod()> _ Public Function HelloDate(ByVal...
3
1389
by: sunnyz | last post by:
hi I wanted to know whether we can store something in Session objects in webservice.My windows application calls the webservice and i want the data to be stored in Session object so that each user...
1
1081
by: Vidya | last post by:
Class in the System.Collection.Specialized namespace like NameValueCollection that is defined as a parameter in one of the Webmethod causes a reflection error at runtime and gives...
12
4100
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport)...
2
1941
by: farseer | last post by:
Hi, I have a few webservice questions i'd like to bounce of you... 1. Can a webservice contain a paramterized contructor ( can't the contructor take parameters )? 2. If two users make an...
3
1888
by: Pebble | last post by:
Hi folks, I have a WebService that simply acts as a thin wrapper to a .Net dll. Literally almost zero code in the WebService. Parameters passed to the WebService are simply used as...
2
2561
by: rn5a | last post by:
I have created the following WebService named NConnect.asmx using which I want an ASPX page to first authenticate a user & after successful user validation, the ASPX page should display a few...
7
13453
by: Sam Shrefler | last post by:
I'm working on creating a WebService / WebMethod to receive a record in real time from another system. The record contains about 20 fields. 10 of which aren't required. I was planning on just...
0
7134
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,...
0
7012
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...
0
7225
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...
1
6901
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...
0
5479
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,...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1429
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 ...
1
667
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.