Re: Passing User Define class to web service.
- From: "berto" <berto@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 1 Jun 2005 12:05:28 -0700
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
> >>
> >>
> >>
>
>
>
.
- Follow-Ups:
- Re: Passing User Define class to web service.
- From: Joel Zinn
- Re: Passing User Define class to web service.
- References:
- RE: Passing User Define class to web service.
- From: berto
- Re: Passing User Define class to web service.
- From: Joel Zinn
- RE: Passing User Define class to web service.
- Prev by Date: xmlValidatingReader doesn't raise validation exception using strea
- Next by Date: help with WebMethod (VB)
- Previous by thread: Re: Passing User Define class to web service.
- Next by thread: Re: Passing User Define class to web service.
- Index(es):
Relevant Pages
|