c# - How do you change the endpoint of a service reference without regenerating the client code? -


we have 3rd party soap api we're integrating with. we've done development against development version of api. want switch on production version. how without regenerating entire service reference against new endpoint url? in perfect world, able change path in config file point new endpoint doesn't seem work due namespaces issues.

when changing endpoint address in config (or programmatically), error occurs @ runtime:

system.web.services.protocols.soapexception: server did not recognize value of http header soapaction: http://foo.bar.com/devwebservice/authenticateuser.  @ system.web.services.protocols.soap11serverprotocolhelper.routerequest()   @ system.web.services.protocols.soapserverprotocol.routerequest(soapservermessage message)   @ system.web.services.protocols.soapserverprotocol.initialize()   @ system.web.services.protocols.serverprotocol.setcontext(type type, httpcontext context, httprequest request, httpresponse response)   @ system.web.services.protocols.serverprotocolfactory.create(type type, httpcontext context, httprequest request, httpresponse response, boolean& abortprocessing) 

i believe because auto-generated reference class has soap actions baked in:

[system.servicemodel.operationcontractattribute(action="http://foo.bar.com/devwebservice/authenticateuser", replyaction="*")] [system.servicemodel.xmlserializerformatattribute(supportfaults=true)] system.data.dataset authenticateuser(string strsecuritykey, string strusername, string strpassword); 

what best way change endpoint url via configuration instead of rebuilding of code service reference?


Comments

Popular posts from this blog

c++ - QTextObjectInterface with Qml TextEdit (QQuickTextEdit) -

javascript - angular ng-required radio button not toggling required off in firefox 33, OK in chrome -

xcode - Swift Playground - Files are not readable -