Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Web Service problem

Thread Tools

Web Service problem

Paul K
Posts: n/a
I have a pretty basic Web Method (see below) that accepts an arraylist and a
string, and returns an arraylist.

The problem I am running into is that if I send an arraylist containing any
objects, the proxy class breaks saying that type is not expected. In this
case, I am trying to send an arraylist of PSI.Common.Inspection objects.

From what I understand, if I added a XmlArrayItem attribute to the
inspections parameter it would then expect PSI.Common.Inspection objects.

Could anyone let me know if my understanding is correct? If it is, how do I
add the attribute? No matter where I try to place it, I always get a
compiler error.

The web method follows:

<WebMethod(), _
XmlInclude(GetType(PSI.Common.Applicant)), _
XmlInclude(GetType(PSI.Common.ApplicantProperty)), _
XmlInclude(GetType(PSI.Common.Contractor)), _
XmlInclude(GetType(PSI.Common.ContractorType)), _
XmlInclude(GetType(PSI.Common.Inspection)), _
XmlInclude(GetType(PSI.Common.InspectionType)), _
XmlInclude(GetType(PSI.Common.Municipality)), _
XmlInclude(GetType(PSI.Common.Permit)), _
XmlInclude(GetType(PSI.Common.PermitContractor))> _

Public Function SynchronizeClient(ByVal inspections As
System.Collections.ArrayList, ByVal inspectorAccountName As String) As
<XmlArrayItemAttribute(GetType(PSI.Common.Permit)) >
MgrObject.ConnectionString =
ConfigurationSettings.AppSettings("ConnectionStrin g")

Dim str As String = Context.User.Identity.Name

If inspectorAccountName.Length > 0 Then
If mIMgr.CompleteInspections(inspections) <> ErrorCodes.None Then Throw
New System.SystemException("An unknown error occurred while attempting to
synchronize the provided data with the database.")
Return PMgr.GetPermitsForInspector(inspectorAccountName)
End If
End Function
Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Consuming local web service - ok, remote web service -problem? dgleeson422111 ASP .Net Web Controls 0 01-26-2010 11:17 AM
Web service autentication problem when call another web service Redhot ASP .Net Web Services 0 07-18-2009 09:43 PM
Does timer in Web Service Global.asax block my Web Service from processing web-site requests? Leo Violette ASP .Net Web Services 0 04-17-2009 12:39 AM
Problem: My web service calls only open a single connection to the web service machine Scott Baierl ASP .Net Web Services 1 07-29-2006 01:16 AM
InvocationTargetException when calling "new Service()" in Axis web service to call another web service Michael Averstegge Java 0 01-10-2006 11:05 PM