web services - VB.NET InstanceContext not working -


thanks on years - i've never had issue requiring post things answered! unforunately, have one...

consuming web service requires phrased token in soap header follows:

<soapenv:header> <authentication xmlns="...">12345</authentication> </soapenv:header> 

to achieve this, trying use (new instancecontext(me)) declaration on proxy vb 2010 express not allow , can see why... code follows:

imports system.servicemodel imports system.servicemodel.channels  private sub goxsq_click(byval sender system.object, byval e system.eventargs) handles goxsq.click if my.settings.xsq <> ""         dim xsqpservice new xsq_proxy.xsquareproxyservice(new instancecontext(me))         xsqpservice.url = "http://" + my.settings.xsq + ":9004/xsquareproxyservice"         dim token string = ""         try             token = xsqpservice.authenticate(my.settings.xsquser, my.settings.xsqpass)         catch ex exception             sb.appendtext(now() & " - error communicating xsq api - " & ex.message & " - " & ex.innerexception.tostring + environment.newline)         end try         if token <> "" , token > "000000"             sb.appendtext(now() & " - token received: " & token + environment.newline)             '<!--- insert xsq process code here! ---!>             using scope new operationcontextscope(xsqpservice.innerchannel)                 if not operationcontext.current.outgoingmessageheaders.findheader("authentication", "http://www.evs.tv/xmlschema/authentication/") = -1                     operationcontext.current.outgoingmessageheaders.removeat(operationcontext.current.outgoingmessageheaders.findheader("authentication", "http://www.evs.tv/xmlschema/authentication/"))                 end if                 dim header messageheader = messageheader.createheader("authentication", "http://www.evs.tv/xmlschema/authentication/", token)                 operationcontext.current.outgoingmessageheaders.add(header)                 dim jobsrunning = xsqpservice.getmachines()                 each job in jobsrunning                     sb.appendtext(job.name)                 next             end using         else             sb.appendtext(now() & " - xsq api login failure - check username/password!" + environment.newline)         end if     end if end sub 

the errors receiving are:

dim xsqpservice new xsq_proxy.xsquareproxyservice(new instancecontext(me))  

too many arguments public sub new()

using scope new operationcontextscope(xsqpservice.innerchannel) 

innerchannel not member of...

i'm guessing second due first cannot find identify why phrase isn't working - supported .net 4.0 compile framework!

any appreciated

paul


Comments