Ask a Question related to Coldfusion - Getting Started, Design and Development.

  1. #1

    Default Web Service problem

    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)) >
    System.Collections.ArrayList
    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
    Paul K Guest

  2. Similar Questions and Discussions

    1. .Net web service uploading problem
      Hello everybody i created a simple .Net web service and it is working well on my local host. but when i uploaded it to my server i got an error ...
    2. Problem consuming ASP.NET web service in Flash 2004 MX using Web Service Class (WITHOUT Flash Remoting)
      This problem really has me stumped. I'm wondering if anyone can help me with the following problem: I am using Flash 2004 MX Professional and I...
    3. Problem with Web Service
      Yap, if u return dataset all data present in dataset, if u return datareader u return only db connection with system information. U cant send db...
    4. DTS web service problem
      I'm trying to create a web service that will allow a remote authenticated user to start a DTS package. I've created the web service method as...
    5. Async web service problem
      When trying to following code in responsive network there is no problem but, if I take the client out of intranet ( relatively lower latency...
  3. #2

    Default Web Service Problem

    The problem I have is:

    I have a solution on my pc with a web application and a web service. It
    works perfect on my PC.
    When I try to migrate to the INTERNET server I do the following.
    1. I copied the WEBSERVICE proyect to the destintation folder of the server.
    (NO PROBLEM)
    2. SO I must change the reference for it to work .
    When I add the reference
    to this site.
    [url]http://apl1.haceb.com/servicioweb/wsproveedores.asmx[/url]

    On the window I got this error
    Error al descargar 'http://apl1.haceb.com/servicioweb/wsproveedores.asmx'.

    Se ha terminado la conexión: No es posible conectar con el servidor remoto.

    In english is says( The conection has finished. Its not possible to connect
    to the remote server)

    If I can Surf to the webservice URL? why I cant add the reference?

    The name and the button are deactivated.


    --
    LUIS ESTEBAN VALENCIA
    MICROSOFT DCE 2.
    MIEMBRO ACTIVO DE ALIANZADEV


    Luis Esteban Valencia Guest

  4. #3

    Default Re: Web Service Problem

    Luis, maybe it is an issue with your http proxy, see here:
    [url]http://support.microsoft.com/kb/q318140/[/url]
    ?

    IE has settings for the HTTP proxy (you can surf to it), but VS has separate
    settings.
    the above kb article tells you how to config vs to use IE's settings.


    -Dino


    "Luis Esteban Valencia" <luisvalen@haceb.com> wrote in message
    news:ukp9Lv2uEHA.944@TK2MSFTNGP11.phx.gbl...
    > The problem I have is:
    >
    > I have a solution on my pc with a web application and a web service. It
    > works perfect on my PC.
    > When I try to migrate to the INTERNET server I do the following.
    > 1. I copied the WEBSERVICE proyect to the destintation folder of the
    > server.
    > (NO PROBLEM)
    > 2. SO I must change the reference for it to work .
    > When I add the reference
    > to this site.
    > [url]http://apl1.haceb.com/servicioweb/wsproveedores.asmx[/url]
    >
    > On the window I got this error
    > Error al descargar 'http://apl1.haceb.com/servicioweb/wsproveedores.asmx'.
    >
    > Se ha terminado la conexión: No es posible conectar con el servidor
    > remoto.
    >
    > In english is says( The conection has finished. Its not possible to
    > connect
    > to the remote server)
    >
    > If I can Surf to the webservice URL? why I cant add the reference?
    >
    > The name and the button are deactivated.
    >
    >
    > --
    > LUIS ESTEBAN VALENCIA
    > MICROSOFT DCE 2.
    > MIEMBRO ACTIVO DE ALIANZADEV
    >
    >

    Dino Chiesa [Microsoft] Guest

  5. #4

    Default Web Service Problem

    Dear All,

    I have written a Web Service which is called from ASPX file(Web Form). It
    works fine on the local machine. On the local machine I am using the
    following command

    wsdl.exe /l:cs [url]http://localhost/ReturnEvents/Service1.asmx?wsdl[/url]

    Now I want to use the same service on the Remote Server. What I think is
    that the
    above path should be changed as it is localhost. So I try to do something
    like this

    wsdl.exe /l:cs [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]

    where [url]www.hop.man.ac.uk[/url] is the server where I am trying to host my web service

    But it does not compile and throws the following error:

    There was an error downloading:

    [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]

    The request failed with HTTP status 404: Not Found

    I dont know whether I going in a right direction. It works fine on the
    client machine
    But on the server when I change the path to my server name it throws this
    error.I mean we cant use localhost in the wsdl when using Web service on the
    REMOTE server. Dont know what to do. Any help would be greatly appreciated.

    Cheers,

    Sunil Sabir


    Sunil Sabir Guest

  6. #5

    Default Re: Web Service Problem

    We also getting 404 for
    [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx[/url] :-)

    Other thing to check if you internet connection needs http proxy server.

    AndyMalakov Guest

  7. #6

    Default RE: Web Service Problem

    Hi Sunil,

    You shouldn't be using WSDL.exe to move a service to a different server.
    Instead, after you get the server ready to run the applicaiton (e.g.
    install IIS, install the .NET Framework server components), you should
    publish your service implementation to the server.

    The service itself is unaware of it's address. It's just code, running on
    a server.

    To publish, open your project in Visual Studio, and after it is loaded, use
    the Publish option on the File menu to publish the right files to the
    server.

    Once the service is moved, the code that calls the client side proxy should
    use a configuration setting to change the server/service address. If you
    change the proxy property to "dynamic", you can then change the URL setting.

    I hope this helps

    Dan Rogers
    Microsoft Corporation
    --------------------
    >Thread-Topic: Web Service Problem
    >thread-index: AcTjlHZM9BRyGSjVTCOpn5WmnWgLPw==
    >X-WBNR-Posting-Host: 130.88.76.91
    >From: "=?Utf-8?B?U3VuaWwgU2FiaXI=?=" <SunilSabir@discussions.microsoft.com>
    >Subject: Web Service Problem
    >Date: Thu, 16 Dec 2004 09:27:05 -0800
    >Lines: 36
    >Message-ID: <8044CB74-2D6E-4E4C-B5F0-1339A15964EE@microsoft.com>
    >MIME-Version: 1.0
    >Content-Type: text/plain;
    > charset="Utf-8"
    >Content-Transfer-Encoding: 7bit
    >X-Newsreader: Microsoft CDO for Windows 2000
    >Content-Class: urn:content-classes:message
    >Importance: normal
    >Priority: normal
    >X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
    >Newsgroups: microsoft.public.dotnet.framework.aspnet.webservic es
    >NNTP-Posting-Host: TK2MSFTNGXA03.phx.gbl 10.40.1.29
    >Path: cpmsftngxa10.phx.gbl!TK2MSFTNGXA03.phx.gbl
    >Xref: cpmsftngxa10.phx.gbl
    microsoft.public.dotnet.framework.aspnet.webservic es:27238
    >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservic es
    >
    >Dear All,
    >
    >I have written a Web Service which is called from ASPX file(Web Form). It
    >works fine on the local machine. On the local machine I am using the
    >following command
    >
    >wsdl.exe /l:cs [url]http://localhost/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    >Now I want to use the same service on the Remote Server. What I think is
    >that the
    >above path should be changed as it is localhost. So I try to do something
    >like this
    >
    >wsdl.exe /l:cs [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    >where [url]www.hop.man.ac.uk[/url] is the server where I am trying to host my web
    service
    >
    >But it does not compile and throws the following error:
    >
    >There was an error downloading:
    >
    >[url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    >The request failed with HTTP status 404: Not Found
    >
    >I dont know whether I going in a right direction. It works fine on the
    >client machine
    >But on the server when I change the path to my server name it throws
    this
    >error.I mean we cant use localhost in the wsdl when using Web service on
    the
    >REMOTE server. Dont know what to do. Any help would be greatly appreciated.
    >
    >Cheers,
    >
    >Sunil Sabir
    >
    >
    >
    Dan Rogers Guest

  8. #7

    Default Re: Web Service Problem

    if you look at the proxy again there's a property called URL, it's the
    web service endpoint, now every time you move the service address all
    you should do just change this property either directly in the proxy
    file all the calling code

    Mywebservice svc = new myWebService();
    svc.Url = ConfigurationSetting.AppSettings["MyWebSerice.Url"];

    The reason why you're getting error 404 , my guess would be the
    "ReturnEvents" virtual directory is not configured at all or incorrectly
    pointing to wrong folder

    actually you can place the service1.asmx in wwwroot directory and the
    dll in wwwroor\bin and all you have to is change the proxy Url to
    [url]http://www.hop.man.ac.uk/Service1.asmx[/url]

    Regards
    Erymuzuan Mustapa


    Sunil Sabir wrote:
    > Dear All,
    >
    > I have written a Web Service which is called from ASPX file(Web Form). It
    > works fine on the local machine. On the local machine I am using the
    > following command
    >
    > wsdl.exe /l:cs [url]http://localhost/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    > Now I want to use the same service on the Remote Server. What I think is
    > that the
    > above path should be changed as it is localhost. So I try to do something
    > like this
    >
    > wsdl.exe /l:cs [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    > where [url]www.hop.man.ac.uk[/url] is the server where I am trying to host my web service
    >
    > But it does not compile and throws the following error:
    >
    > There was an error downloading:
    >
    > [url]http://www.hop.man.ac.uk/ReturnEvents/Service1.asmx?wsdl[/url]
    >
    > The request failed with HTTP status 404: Not Found
    >
    > I dont know whether I going in a right direction. It works fine on the
    > client machine
    > But on the server when I change the path to my server name it throws this
    > error.I mean we cant use localhost in the wsdl when using Web service on the
    > REMOTE server. Dont know what to do. Any help would be greatly appreciated.
    >
    > Cheers,
    >
    > Sunil Sabir
    >
    >
    erymuzuan Guest

  9. #8

    Default Re: web service problem

    There is absolutely nothing wrong with your code, so you must be using the wrong address for the Web Service.
    Stressed_Simon Guest

  10. #9

    Default Re: web service problem

    It might sound silly but do you have a valid mapping to your CFIDE directory.
    If you take off the ?wsdl query parameter and then browse the *cfc you are in
    fact inspecting a ColdFusion component (which just happens to constitute your
    web service functionality.). When doing this if there is no valid mapping to
    the CFIDE directory (where the CFC Explorer tool lives) ColdFusion will throw
    an error not just in IE but in any browser since it cannot locate needed files
    to explore your CFC. I doubt this would be the case however since you display
    a URL using your localhost IP address. However if you have modified your
    C:\WINDOWS\system32\drivers\etc\hosts file then CFIDE may not exist. Check
    this out to ensure ColdFusion is set up correctly. Hope that helps you out.

    www.xmlstandards.org Guest

  11. #10

    Default Re: web service problem

    I'm having a slightly similar problem.... I wrote a very simple query CFC and
    then created another page in the same folder that invoked it - no problem.
    However when I changed it to be a webservice I'm getting: Could not find the
    ColdFusion Component bands. Please check that the given name is correct and
    that the component exists. with bands being the name of the cfc. In my
    cfinvoke, for the webservice param I'm using a URL to the cfc (and it's on a
    different server). Weird thing is, I know it's there because if I put the same
    URL in a browser from my local work station (which is not the same as the
    server the cfc is on) minus the ?wdsl but adding method=[methodname i'm
    calling] to the end of the URL I get back a raw string of the data.... Any
    ideas?

    plange Guest

  12. #11

    Default Re: web service problem

    and also, just as background, I did set the cfc to have access='remote' Also,
    on another note, if I put the URL in a browser with the ?wdsl I get the File
    not found: /CFIDE/componentutils/cfcexplorer.cfc error, even though I have a
    mapping in CFAdmin for /CFIDE

    plange Guest

  13. #12

    Default Re: web service problem

    Never mind-- I solved my issue, but doesn't look like it would solve moyoxxx's
    problem. I was a complete dummy and copied the same cfinvoke I'd used to test
    the cfc and just added the webservice param but didn't take out the component
    param.....

    plange Guest

  14. #13

    Default Web Service Problem

    I'm having a problem from a long time ago, and I can't figure out how
    to solve it.

    I have a .NET object (PruebaEntidadAP) with the following properties:

    PruebaEntidadAP object:

    *Adress
    *Name
    *ColPrueba as ObjItem() (an object item array of type ObjItem)

    ObjItem object:
    *IDItem
    *ElementoItem

    I also have a web service with the following web methods:

    *' Returns an object PruebaEntidadAP
    FetchPrueba() as PruebaEntidadAP

    *' Updates the PruebaEntidadAP object
    UpdatePrueba(pUsu as PruebaEntidadAP)
    >From Flex, I consume the web service calling the FetchPrueba method, it
    returns an object of type PruebaEntidadAP. I get and show the object in
    Flex and I also can acces to all it's properties, I even show the array
    ColPrueba into a Grid without problem.

    Later I send this object using the web method UpdatePrueba to modify
    it, there is where I get this error:

    RPC Fault, "uknown propery: IDItem" faultCode="EncodingError".

    If I do the same with an object that doesn't have a property
    representing an object's array, I mean a simple object without
    ColPrueba, it works. The problem is with the complex objects or those
    whom have collections in it.

    The same web service I consume from .NET and Visual Fox without
    problem, only Flex is giving me errors.

    You can see the web service at:
    [url]http://www.managernet.com.ar/webservices/wssecurity.asmx[/url]


    the WSDL:
    [url]http://www.managernet.com.ar/webservices/wssecurity.asmx?WSDL[/url]

    the application:
    [url]http://www.managernet.com.ar/flex/managermain.html[/url]

    the code:
    [url]http://www.managernet.com.ar/flex/srcview/index.html[/url]


    Any idea on how to solve this problem?


    If you have any doubt, please ask me.

    Thanks.

    Fabian Guest

  15. #14

    Default Re: Web Service Problem

    Sure, just make your own web page to return the xml.

    The Grand Master


    On Oct 23, 9:30 am, "Fabian" <fbru...@gmail.com> wrote:
    > I'm having a problem from a long time ago, and I can't figure out how
    > to solve it.
    >
    > I have a .NET object (PruebaEntidadAP) with the following properties:
    >
    > PruebaEntidadAP object:
    >
    > *Adress
    > *Name
    > *ColPrueba as ObjItem() (an object item array of type ObjItem)
    >
    > ObjItem object:
    > *IDItem
    > *ElementoItem
    >
    > I also have a web service with the following web methods:
    >
    > *' Returns an object PruebaEntidadAP
    > FetchPrueba() as PruebaEntidadAP
    >
    > *' Updates the PruebaEntidadAP object
    > UpdatePrueba(pUsu as PruebaEntidadAP)
    >
    > >From Flex, I consume the web service calling the FetchPrueba method, itreturns an object of type PruebaEntidadAP. I get and show the object in
    > Flex and I also can acces to all it's properties, I even show the array
    > ColPrueba into a Grid without problem.
    >
    > Later I send this object using the web method UpdatePrueba to modify
    > it, there is where I get this error:
    >
    > RPC Fault, "uknown propery: IDItem" faultCode="EncodingError".
    >
    > If I do the same with an object that doesn't have a property
    > representing an object's array, I mean a simple object without
    > ColPrueba, it works. The problem is with the complex objects or those
    > whom have collections in it.
    >
    > The same web service I consume from .NET and Visual Fox without
    > problem, only Flex is giving me errors.
    >
    > You can see the web service at:[url]http://www.managernet.com.ar/webservices/wssecurity.asmx[/url]
    >
    > the WSDL:[url]http://www.managernet.com.ar/webservices/wssecurity.asmx?WSDL[/url]
    >
    > the application:[url]http://www.managernet.com.ar/flex/managermain.html[/url]
    >
    > the code:[url]http://www.managernet.com.ar/flex/srcview/index.html[/url]
    >
    > Any idea on how to solve this problem?
    >
    > If you have any doubt, please ask me.
    >
    > Thanks.
    White Joe Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139