Re: Passing User Define class to web service.



Joel,

First, you should try to update your web reference, then go to the generated
proxy and verify that the method exists, this is what you most likely found
regarding being up to date. Remember, that when the new web service proxy is
generated it will overwrite any modifications you have made to the current
proxy so make sure you have a backup of your modifications.

Second, if this is unsuccessful, then delete all temporary ASP.net files. I
have encountered errors and know of others encountering errors as a result of
using cached files. Others may be able to explain this in more details since
this approach is primitive, but I and others have found that it works.


Let me know how this goes.

berto

"Joel Zinn" wrote:

> berto,
> Thanks for the help. That did get me further. The problem I am getting now
> is that when the code hits
> the Reference.vb code generated by the web reference where the results is
> being returned, as below:
> Public Function myMethod(ByVal thMssagA As IFWMssagA) As String
>
> Dim results() As Objct = Me.Invoke("myMethod", New Objct() {theMessage})
> <-- this line
>
> Return CType(results(0),String)
>
> End Function
>
> I get the error:"Method not found: Void
> System.Xml.XmlTextReader.set_ProhibitDtd(Boolean)."
>
> I have searched on this error and can't find very much beyond the suggestion
> that I verify that the proxy is current, which it is. Any thoughts on this?
>
> --
> Joel Zinn
> Sr IT Architect
> American Electric Power
> "berto" <berto@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:F7DD6125-1CD0-449B-B5B0-88627F654FA5@xxxxxxxxxxxxxxxx
> > Joel,
> >
> > I am replying to step 5. in your description:
> >
> > Verify that the proxy generated by the web reference does not redefine
> > myClass. In most cases, using the auto-generated proxy will include
> > generation of the class definition of the custom class. You will want to
> > remove the generated class definition and include a reference to the
> > namespace including the single definition of the class. It seems that the
> > likely problem is that myClass is multiply defined in separate namespaces
> > and
> > the proxy is expecting one type and the your test harness is passing in
> > another type.
> >
> > berto
> >
> > "Joel Zinn" wrote:
> >
> >> I am trying to build a web service that will allow a class instance to be
> >> passed to the web service via a method signature. When I write the
> >> client
> >> to consume the web service, I get an error that states, "Value of type
> >> "ExternalNameSpace.myClass" cannot be converted to "localhost/myClass"
> >>
> >> Here is how this is set up.
> >> 1. I have a class(myClass) defined in a namespace. myClass includes:
> >> a. a class that includes header info in 4 properties (all string
> >> values)
> >> b. an array of a second class with one or more detail lines (all
> >> string
> >> values)
> >> 2. I have a wrapper class the includes a copy of myClass in its
> >> definition
> >> 3. I have a Public Shared Sub that takes an instance of theWrapper Class
> >> as
> >> an input parameter.
> >> 4. I create a webmethod on my web service that takes myClass as in input
> >> parameter. The WebMethod:
> >> a. instantiates the wrapper class
> >> b. assigns the myClass parameter to the myClass property of the
> >> wrapper
> >> class
> >> c. builds the remaining info to populate the wrapper class
> >> d. calls the method (in item 3 above), passing the wrapper class
> >> 5. I built a test harness to test consuming the web service. The test
> >> harness:
> >> a. has a web reference to the Webservice
> >> b. instantiates the myClass object
> >> c. populates the instance with some dummy data
> >> d. instantiates the web service
> >> e. calls the method in the web service, passing the myClass (with the
> >> dummy data)
> >>
> >> I get the error message shown at the top, on the signature of the call of
> >> the web service method, where the dummy data myClass is passed
> >>
> >> This is the first time I have attempted to create a web service where a
> >> non-primative object is passed to a web method. Can anyone shed any
> >> light
> >> on my problem?
> >>
> >> Thanks in advance...
> >> --
> >> Joel Zinn
> >> Sr IT Architect
> >> American Electric Power
> >>
> >>
> >>
>
>
>
.



Relevant Pages

  • Re: web service
    ... Can you send a screenshot of the "Add Web Reference" dialog box after you ... I have just tried that web service you specified, and got the WSDL displayed ... ok and was able to generate a proxy class in C# just fine. ...
    (microsoft.public.cert.exam.mcad)
  • Re: how or when to use XmlInclude ?
    ... you need to use a properly created proxy ... >Then why is it that when I view the web service method I see ... >the method return type MyClass only? ... >the public methods of the abstract class also. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Need some help reading instructions
    ... Mr. Rogers would have you edit the generated proxy file, in the hopes that nobody will ever do an "Update Web Reference" command and wipe out your changes. ... Like the original poster in the old thread, I need to return a collection class from the web service, but when I create a client and add a web reference to it, the service returns an object array rather than a collection class. ... This causes ASP.NET to create a WSDL and return it to the client. ...
    (microsoft.public.dotnet.framework.aspnet.webservices)
  • Re: Convert proxy type to class type
    ... I thought about the sync issue but since the client needs all the data ... I have a web service, class library (this class library is used in many ... classes that will take the generated proxy class and create a new class from ... >>the proxy will be a deserialized version of MyClass but under the ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Convert proxy type to class type
    ... I thought about the sync issue but since the client needs all the data ... I have a web service, class library (this class library is used in many ... classes that will take the generated proxy class and create a new class from ... >>the proxy will be a deserialized version of MyClass but under the ...
    (microsoft.public.dotnet.framework.webservices)