Method XX cannot be reflected

P

Peter van der veen

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
 
J

John Saunders

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
 
P

Peter van der veen

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
 
P

Peter van der veen

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?
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top