472,796 Members | 1,297 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,796 software developers and data experts.

System.Guid

I have a simple .NET 2.0 web service created with VS.NET 2005 with a single
web method with the following signature:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)If I change the type of parameter1 to a simple type such as
string or int then the method works as expected. My operating system is
Windows 2003 Server R2 (Enterprise Edition) with all the latest patches.

I see several other people have run into this error. Does anyone have an
idea how to correct this?

Thanks,
Michael
Oct 20 '06 #1
5 6400
"Michael Primeaux" <mj********@msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>I have a simple .NET 2.0 web service created with VS.NET 2005 with a single
web method with the following signature:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)If I change the type of parameter1 to a simple type such
as string or int then the method works as expected. My operating system is
Windows 2003 Server R2 (Enterprise Edition) with all the latest patches.

I see several other people have run into this error. Does anyone have an
idea how to correct this?
First of all, I'd suggest that System.Guid is a platform-specific type, so
why do you want to use it in a Web Service? Perhaps you should make your
parameter be of type string, and then parse out the Guid from the string.

John
Oct 21 '06 #2
Hi John,

I do understand the Guid parameter is a platform-specific type. That said,
the generated WSDL defines the type as a string but with format constraints
(a regular expression in the form
"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}".
I have both JAVA and PHP consumers calling several services with Guid
parameters without issue; again, from their perspective it's a string with
format contraints.

However, this does not explain the below exception. Any help specific as to
why the exception occurs is appreciated.

Kindest regards,
Michael

"John Saunders" <john.saunders at trizetto.comwrote in message
news:uK**************@TK2MSFTNGP05.phx.gbl...
"Michael Primeaux" <mj********@msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>I have a simple .NET 2.0 web service created with VS.NET 2005 with a
single web method with the following signature:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)If I change the type of parameter1 to a simple
type such as string or int then the method works as expected. My
operating system is Windows 2003 Server R2 (Enterprise Edition) with all
the latest patches.

I see several other people have run into this error. Does anyone have an
idea how to correct this?

First of all, I'd suggest that System.Guid is a platform-specific type, so
why do you want to use it in a Web Service? Perhaps you should make your
parameter be of type string, and then parse out the Guid from the string.

John


Nov 2 '06 #3
You could define GUID as a schema type and use that versus System.Guid and
relying on how the platform will translate it:

The following was snipped off the web:

<xsd:simpleType name="GUID">

<xsd:annotation>

<xsd:documentation xml:lang="en">

The representation of a GUID, generally the id of an element.

</xsd:documentation>

</xsd:annotation>

<xsd:restriction base="xsd:string">

<xsd:pattern

value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

</xsd:restriction>

</xsd:simpleType>

I believe I've seen that same type definition for one of Microsoft's
products, SharePoint or something maybe.

Ron

"Michael Primeaux" <mj********@msn.comwrote in message
news:OI**************@TK2MSFTNGP04.phx.gbl...
Hi John,

I do understand the Guid parameter is a platform-specific type. That said,
the generated WSDL defines the type as a string but with format
constraints (a regular expression in the form
"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}".
I have both JAVA and PHP consumers calling several services with Guid
parameters without issue; again, from their perspective it's a string with
format contraints.

However, this does not explain the below exception. Any help specific as
to why the exception occurs is appreciated.

Kindest regards,
Michael

"John Saunders" <john.saunders at trizetto.comwrote in message
news:uK**************@TK2MSFTNGP05.phx.gbl...
>"Michael Primeaux" <mj********@msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl...
>>>I have a simple .NET 2.0 web service created with VS.NET 2005 with a
single web method with the following signature:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)If I change the type of parameter1 to a simple
type such as string or int then the method works as expected. My
operating system is Windows 2003 Server R2 (Enterprise Edition) with all
the latest patches.

I see several other people have run into this error. Does anyone have an
idea how to correct this?

First of all, I'd suggest that System.Guid is a platform-specific type,
so why do you want to use it in a Web Service? Perhaps you should make
your parameter be of type string, and then parse out the Guid from the
string.

John



Nov 5 '06 #4
Hi Ron,

I appreciate your time. As indicated in my previous post that is precisely
what I do. The issue is that I receive the following error when doing so:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)If I change the type of parameter1 to a simple type such as
string or int then the method works as expected. My operating system is
Windows 2003 Server R2 (Enterprise Edition) with all the latest patches.
"RYoung" <rcyoungatinkspotdev.comwrote in message
news:uf**************@TK2MSFTNGP04.phx.gbl...
You could define GUID as a schema type and use that versus System.Guid and
relying on how the platform will translate it:

The following was snipped off the web:

<xsd:simpleType name="GUID">

<xsd:annotation>

<xsd:documentation xml:lang="en">

The representation of a GUID, generally the id of an element.

</xsd:documentation>

</xsd:annotation>

<xsd:restriction base="xsd:string">

<xsd:pattern

value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

</xsd:restriction>

</xsd:simpleType>

I believe I've seen that same type definition for one of Microsoft's
products, SharePoint or something maybe.

Ron

"Michael Primeaux" <mj********@msn.comwrote in message
news:OI**************@TK2MSFTNGP04.phx.gbl...
>Hi John,

I do understand the Guid parameter is a platform-specific type. That
said, the generated WSDL defines the type as a string but with format
constraints (a regular expression in the form
"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}".
I have both JAVA and PHP consumers calling several services with Guid
parameters without issue; again, from their perspective it's a string
with format contraints.

However, this does not explain the below exception. Any help specific as
to why the exception occurs is appreciated.

Kindest regards,
Michael

"John Saunders" <john.saunders at trizetto.comwrote in message
news:uK**************@TK2MSFTNGP05.phx.gbl...
>>"Michael Primeaux" <mj********@msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl.. .
I have a simple .NET 2.0 web service created with VS.NET 2005 with a
single web method with the following signature:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)If I change the type of parameter1 to a simple
type such as string or int then the method works as expected. My
operating system is Windows 2003 Server R2 (Enterprise Edition) with
all the latest patches.

I see several other people have run into this error. Does anyone have
an idea how to correct this?

First of all, I'd suggest that System.Guid is a platform-specific type,
so why do you want to use it in a Web Service? Perhaps you should make
your parameter be of type string, and then parse out the Guid from the
string.

John




Dec 21 '06 #5
Sorry about that, didn't realize System.Guid was serializable.

I can't reproduce the error here. Just a simple web service with the same
signature as what you've posted, and a console client calling the service
and passing a Guid.NewGuid() to it. Tried Guid.Empty as well.

Is it safe to say that since you aren't getting a SoapException, that the
exception is occuring on the client side? I know you mention changing the
signature from Guid to String and everything works, but I think there's an
issue serializing the value of what's supposed to be a guid on the client.

How about if you change the signature to string, have the service log the
value it receives and see if that value is a valid Guid format?

Ron

"Michael Primeaux" <mj********@msn.comwrote in message
news:OP**************@TK2MSFTNGP03.phx.gbl...
Hi Ron,

I appreciate your time. As indicated in my previous post that is precisely
what I do. The issue is that I receive the following error when doing so:

[WebMethod]
void HelloWorld(Guid parameter1);

When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type type,
HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type type,
HttpContext context, HttpRequest request, HttpResponse response, Boolean&
abortProcessing)If I change the type of parameter1 to a simple type such
as
string or int then the method works as expected. My operating system is
Windows 2003 Server R2 (Enterprise Edition) with all the latest patches.
"RYoung" <rcyoungatinkspotdev.comwrote in message
news:uf**************@TK2MSFTNGP04.phx.gbl...
>You could define GUID as a schema type and use that versus System.Guid
and relying on how the platform will translate it:

The following was snipped off the web:

<xsd:simpleType name="GUID">

<xsd:annotation>

<xsd:documentation xml:lang="en">

The representation of a GUID, generally the id of an element.

</xsd:documentation>

</xsd:annotation>

<xsd:restriction base="xsd:string">

<xsd:pattern

value="\{[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}\}"/>

</xsd:restriction>

</xsd:simpleType>

I believe I've seen that same type definition for one of Microsoft's
products, SharePoint or something maybe.

Ron

"Michael Primeaux" <mj********@msn.comwrote in message
news:OI**************@TK2MSFTNGP04.phx.gbl...
>>Hi John,

I do understand the Guid parameter is a platform-specific type. That
said, the generated WSDL defines the type as a string but with format
constraints (a regular expression in the form
"[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}".
I have both JAVA and PHP consumers calling several services with Guid
parameters without issue; again, from their perspective it's a string
with format contraints.

However, this does not explain the below exception. Any help specific as
to why the exception occurs is appreciated.

Kindest regards,
Michael

"John Saunders" <john.saunders at trizetto.comwrote in message
news:uK**************@TK2MSFTNGP05.phx.gbl...
"Michael Primeaux" <mj********@msn.comwrote in message
news:%2****************@TK2MSFTNGP03.phx.gbl. ..
>I have a simple .NET 2.0 web service created with VS.NET 2005 with a
>single web method with the following signature:
>
[WebMethod]
void HelloWorld(Guid parameter1);
>
When calling this method I receive the following error:
System.IndexOutOfRangeException: Index was outside the bounds of the
array.
at System.Web.Services.Protocols.HttpServerType..ctor (Type type)
at System.Web.Services.Protocols.HttpServerProtocol.I nitialize()
at System.Web.Services.Protocols.ServerProtocol.SetCo ntext(Type
type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactor y.Create(Type
type, HttpContext context, HttpRequest request, HttpResponse response,
Boolean& abortProcessing)If I change the type of parameter1 to a
simple type such as string or int then the method works as expected.
My operating system is Windows 2003 Server R2 (Enterprise Edition)
with all the latest patches.
>
I see several other people have run into this error. Does anyone have
an idea how to correct this?

First of all, I'd suggest that System.Guid is a platform-specific type,
so why do you want to use it in a Web Service? Perhaps you should make
your parameter be of type string, and then parse out the Guid from the
string.

John




Dec 21 '06 #6

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

Similar topics

7
by: headware | last post by:
Is the GUID generated by the .NET System.Guid.NewGuid() function compatible with Access' Replication ID field type? Dave
0
by: sergi | last post by:
Hi there, I am getting a System.NullReference exception when calling an unmanaged method CreateClassEnumerator. I am really new to Interop, so that I am having trouble finding out a solution....
2
by: Nadav | last post by:
Hi, I am using the System.Type.GUID to identify similar types on different computers, one computer send the GUID through a socket while the other resolve the GUID and identify the type, when...
2
by: Lee Crabtree | last post by:
I've been wrapping an unmanaged class, and everything has gone well. That is...until now. I've hit a wall while trying to marshal the System::Guid type down into the unmanaged GUID structure...
5
by: rcolby | last post by:
Evening, Wondering if someone can point me in the right direction, on how I would compare a system.guid with a system.byte. system.guid (pulled from sql server table with a data type of...
11
by: Tarren | last post by:
Hi: I need to get the unique GUID for a file, so I am using API calls through System.InteropServices I am using BY_HANDLE_FILE_INFORMATION and
1
by: Jeff | last post by:
ASP.NET 2.0 In the code below, the reader has a column named "Id". The MsgInfo class needs that value sent into its constructor. But MsgInfo need it as a System.Guid datatype. How do I convert...
1
by: Jeff | last post by:
ASP.NET 2.0 This problem occur using the basic version of SQL Server 2005 which get installed when installing Visual Studio 2005! I have inserted a record in the Test table. But when I try to...
2
by: Jeff | last post by:
ASP.NET 2.0 I'm wondering how to convert a string into a System.Guid! I have this code where I want to use the convert: Message.DeleteMessage(hidden.Value);. Here DeleteMessage wants an...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.