Method XX cannot be reflected

Discussion in 'ASP .Net Web Services' started by Peter van der veen, Nov 14, 2006.

  1. Hi

    In my porject i use a custom header to be added to the SOAP message.
    I added the the custom SOAP header to the follwoing function which is
    in the proxy class.

    But when invoking the proxy for the first time i got the message

    Method XX cannot be reflected, where XX is the name of this function.
    When i remove the soapheader attribute everythings works, but no
    custom header is then send

    How to solve?


    <System.Web.Services.Protocols.SoapHeader("Vendor",
    Direction:=SoapHeaderDirection.InOut)> _
    <System.Web.Services.Protocols.SoapRpcMethodAttribute("",
    RequestNamespace:="http://berichten.communicatie.ech.bevalue.com",
    ResponseNamespace:="https://echstag.ilcampo.com/axis/services/ECHBerichtenServices")>
    _
    Public Function zetAflosOpdracht(ByVal in0 As AflosOpdracht)
    As
    <System.Xml.Serialization.SoapElementAttribute("zetAflosOpdrachtReturn")>
    Acknowledgement
    Dim results() As Object = Me.Invoke("zetAflosOpdracht",
    New Object() {in0})
    Return CType(results(0), Acknowledgement)
    End Function
    Peter van der veen, Nov 14, 2006
    #1
    1. Advertising

  2. <Peter van der veen> wrote in message
    news:...
    > Hi
    >
    > In my porject i use a custom header to be added to the SOAP message.
    > I added the the custom SOAP header to the follwoing function which is
    > in the proxy class.
    >
    > But when invoking the proxy for the first time i got the message
    >
    > Method XX cannot be reflected, where XX is the name of this function.
    > When i remove the soapheader attribute everythings works, but no
    > custom header is then send
    >
    > How to solve?


    Usually, the SoapHeader attribute is used in the server side. The client
    proxy would then be updated via Update Web Reference.

    Is the soap header defined on the server? Also, did you define the
    corresponding public field in the client?

    John
    John Saunders, Nov 14, 2006
    #2
    1. Advertising

  3. The ws is an axis server, so the header as not present in the
    WSDL/proxy. But the header must be repsent in the SOAP message.

    i did add the following to the project

    <System.Serializable()> _
    <System.Diagnostics.DebuggerStepThrough()> _
    <System.ComponentModel.DesignerCategory("code")> _
    <System.Xml.Serialization.XmlType(Namespace:="http://ech.client.nl/vendor")>
    _
    <System.Xml.Serialization.XmlRoot(Namespace:="http://ech.client.nl/vendor",
    IsNullable:=False)> _
    Public Class Vendor : Inherits SoapHeader
    Public VENDOR As String
    End Class

    and in the proxy i added the line to the function that needs the
    header

    <System.Web.Services.Protocols.SoapHeader("Vendor",
    Direction:=SoapHeaderDirection.InOut)> _
    <System.Web.Services.Protocols.SoapRpcMethodAttribute("",
    RequestNamespace:="http://berichten.communicatie.ech.bevalue.com",
    ResponseNamespace:="https://echstag.ilcampo.com/axis/services/ECHBerichtenServices")>
    _
    Public Function zetAflosOpdracht(ByVal in0 As AflosOpdracht)
    As
    <System.Xml.Serialization.SoapElementAttribute("zetAflosOpdrachtReturn")>
    Acknowledgement
    Dim results() As Object = Me.Invoke("zetAflosOpdracht",
    New Object() {in0})
    Return CType(results(0), Acknowledgement)
    End Function

    Peter

    On Tue, 14 Nov 2006 18:34:17 -0500, "John Saunders" <john.saunders at
    trizetto.com> wrote:

    ><Peter van der veen> wrote in message
    >news:...
    >> Hi
    >>
    >> In my porject i use a custom header to be added to the SOAP message.
    >> I added the the custom SOAP header to the follwoing function which is
    >> in the proxy class.
    >>
    >> But when invoking the proxy for the first time i got the message
    >>
    >> Method XX cannot be reflected, where XX is the name of this function.
    >> When i remove the soapheader attribute everythings works, but no
    >> custom header is then send
    >>
    >> How to solve?

    >
    >Usually, the SoapHeader attribute is used in the server side. The client
    >proxy would then be updated via Update Web Reference.
    >
    >Is the soap header defined on the server? Also, did you define the
    >corresponding public field in the client?
    >
    >John
    >
    Peter van der veen, Nov 15, 2006
    #3
  4. I got it.

    I was reffering to the wrong class in the SOAP header

    I had to reffer to the one present in the proxy class.
    I can send the header and the webservice get the header

    Only one problem exists. The header information has to be in a
    certain namespace and ws is missing that.

    i thought i had to place it in the vendor class, but it seems that is
    not enough.any idea whre ot place?


    On Wed, 15 Nov 2006 09:49:33 +0100, Peter van der veen <> wrote:

    >The ws is an axis server, so the header as not present in the
    >WSDL/proxy. But the header must be repsent in the SOAP message.
    >
    >i did add the following to the project
    >
    ><System.Serializable()> _
    ><System.Diagnostics.DebuggerStepThrough()> _
    ><System.ComponentModel.DesignerCategory("code")> _
    ><System.Xml.Serialization.XmlType(Namespace:="http://ech.client.nl/vendor")>
    >_
    ><System.Xml.Serialization.XmlRoot(Namespace:="http://ech.client.nl/vendor",
    >IsNullable:=False)> _
    >Public Class Vendor : Inherits SoapHeader
    > Public VENDOR As String
    >End Class
    >
    >and in the proxy i added the line to the function that needs the
    >header
    >
    > <System.Web.Services.Protocols.SoapHeader("Vendor",
    >Direction:=SoapHeaderDirection.InOut)> _
    > <System.Web.Services.Protocols.SoapRpcMethodAttribute("",
    >RequestNamespace:="http://berichten.communicatie.ech.bevalue.com",
    >ResponseNamespace:="https://echstag.ilcampo.com/axis/services/ECHBerichtenServices")>
    >_
    > Public Function zetAflosOpdracht(ByVal in0 As AflosOpdracht)
    >As
    ><System.Xml.Serialization.SoapElementAttribute("zetAflosOpdrachtReturn")>
    >Acknowledgement
    > Dim results() As Object = Me.Invoke("zetAflosOpdracht",
    >New Object() {in0})
    > Return CType(results(0), Acknowledgement)
    > End Function
    >
    >Peter
    >
    >On Tue, 14 Nov 2006 18:34:17 -0500, "John Saunders" <john.saunders at
    >trizetto.com> wrote:
    >
    >><Peter van der veen> wrote in message
    >>news:...
    >>> Hi
    >>>
    >>> In my porject i use a custom header to be added to the SOAP message.
    >>> I added the the custom SOAP header to the follwoing function which is
    >>> in the proxy class.
    >>>
    >>> But when invoking the proxy for the first time i got the message
    >>>
    >>> Method XX cannot be reflected, where XX is the name of this function.
    >>> When i remove the soapheader attribute everythings works, but no
    >>> custom header is then send
    >>>
    >>> How to solve?

    >>
    >>Usually, the SoapHeader attribute is used in the server side. The client
    >>proxy would then be updated via Update Web Reference.
    >>
    >>Is the soap header defined on the server? Also, did you define the
    >>corresponding public field in the client?
    >>
    >>John
    >>
    Peter van der veen, Nov 15, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Sumit
    Replies:
    1
    Views:
    309
    Rajesh.V
    Oct 16, 2003
  2. monika
    Replies:
    2
    Views:
    310
    monika
    Apr 25, 2005
  3. Replies:
    7
    Views:
    4,666
    Pushpadant
    Jul 3, 2006
  4. Gino
    Replies:
    0
    Views:
    278
  5. =?Utf-8?B?cGF0cmlja2RyZA==?=

    Client side changes not reflected in page

    =?Utf-8?B?cGF0cmlja2RyZA==?=, Feb 1, 2007, in forum: ASP .Net
    Replies:
    24
    Views:
    1,019
    =?Utf-8?B?cGF0cmlja2RyZA==?=
    Mar 28, 2007
Loading...

Share This Page