c# - InvalidOperationException when SOAP webservice - but working on dev machine -
i have webservice class inherits soaphttpclientprotocol
[webservicebinding(name = "gp_ws_mysoap", namespace = "https://www.xxx/yyy/")] internal class webservicenestle : soaphttpclientprotocol { public webservicenestle(string surl) : base() { url = surl; } [soapdocumentmethod("https://www.xxx/yyy/test", requestnamespace = "https://www.xxx/yyy/", responsenamespace = "https://www.xxx/yyy/", use = soapbindinguse.literal, parameterstyle = soapparameterstyle.wrapped)] public xmlnode test(string a, int b) { var results = invoke("test", new object[] { a, b }); return (xmlnode)results[0]; } }
on development machine, webservice call works, on production, exception "system.invalidoperationexception
: xml element named '' namespace" namespace present in current scope:
the stacktrace of exception is:
system.invalidoperationexception: die ?????????????????????????????????????????.?????????????????????????????????????????-methode kann nicht reflektiert werden. ---> system.invalidoperationexception: fehler beim reflektieren von ''. ---> system.invalidoperationexception: das xml-attribut '' im namespace 'https://www.yyy/xxx/' ist bereits im aktuellen bereich vorhanden. verwenden sie xml-attribute, um einen anderen xml-namen oder -namespace für das element anzugeben. bei system.xml.serialization.xmlreflectionimporter.adduniqueaccessor(inamescope scope, accessor accessor) bei system.xml.serialization.xmlreflectionimporter.adduniqueaccessor(membermapping member, inamescope elements, inamescope attributes, boolean issequence) bei system.xml.serialization.xmlreflectionimporter.importmembersmapping(xmlreflectionmember[] xmlreflectionmembers, string ns, boolean haswrapperelement, boolean rpc, boolean openmodel, recursionlimiter limiter) --- ende der internen ausnahmestapelüberwachung --- bei system.xml.serialization.xmlreflectionimporter.importmembersmapping(xmlreflectionmember[] xmlreflectionmembers, string ns, boolean haswrapperelement, boolean rpc, boolean openmodel, recursionlimiter limiter) bei system.xml.serialization.xmlreflectionimporter.importmembersmapping(string elementname, string ns, xmlreflectionmember[] members, boolean haswrapperelement, boolean rpc, boolean openmodel, xmlmappingaccess access) bei system.web.services.protocols.soapreflector.importmembersmapping(xmlreflectionimporter xmlimporter, soapreflectionimporter soapimporter, boolean servicedefaultisencoded, boolean rpc, soapbindinguse use, soapparameterstyle paramstyle, string elementname, string elementnamespace, boolean nsisdefault, xmlreflectionmember[] members, boolean validate, boolean openmodel, string key, boolean writeaccess) bei system.web.services.protocols.soapreflector.reflectmethod(logicalmethodinfo methodinfo, boolean client, xmlreflectionimporter xmlimporter, soapreflectionimporter soapimporter, string defaultns)
i found problem:
i used confuser (https://yck1509.github.io/confuserex/) protect application, caused reflection error in soaphttpclientprotocol parent class constructor.
Comments
Post a Comment