|
security
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
error passing byte[] of encrypted data to Web ServiceIf I just send a couple of simple strings, it works fine ... as in: byte[] A = Encoding.Default.GetBytes("First"); byte[] B = Encoding.Default.GetBytes("Last"); but changing A to a 100+ byte encypted sequence of bytes, causes an error: An unhandled exception of type 'System.Web.Services.Protocols.SoapException' occurred in system.web.services.dll Additional information: Server was unable to process request. --> Object reference not set to an instance of an object. Obviously happening at the SOAP level. (Server is Win 2K .NET Framework 1.0, client is XP, .NET/Latest, but tried it on localhost (XP) ) Any thoughts?? Thanks in advance. Chuck My advice uy to use strings instead of byte arrays..
But, as error indicating, it is a null pointer exception. There is no limit with byte arrays. Just check if you successfully construct your byte arrays.. -- Show quoteHide quoteThanks, Yunus Emre ALPÖZEN BSc, MCSD.NET "ChuckD_Duncan" <cduncan@nospam.guardianangelcorp.com> wrote in message news:5d96ef79d912558faf5284a971dad2ac@localhost.talkaboutsoftware.com... > Have Web Service: bool Login( byte[] A, byte[] B ); > If I just send a couple of simple strings, it works fine ... as in: > byte[] A = Encoding.Default.GetBytes("First"); > byte[] B = Encoding.Default.GetBytes("Last"); > > but changing A to a 100+ byte encypted sequence of bytes, causes an > error: > > An unhandled exception of type > 'System.Web.Services.Protocols.SoapException' occurred in > system.web.services.dll > > Additional information: Server was unable to process request. --> Object > reference not set to an instance of an object. > > Obviously happening at the SOAP level. (Server is Win 2K .NET Framework > 1.0, client is XP, .NET/Latest, but tried it on localhost (XP) ) > > Any thoughts?? > > Thanks in advance. > Chuck > Thanks... I tried converting the byte array to a string which succeeds but
fails to send ... because (I suspect) that the conversions are binary and characters in the string end up with every conceivable value, perhaps terminating nulls or some such?? I am wondering if MIME encoding is necessary in these cases. Still working on the problem, but thanks again for your advice. Chuck passing something simple like:
bool result = Sample("first", "second"); works fine... but when the two args are replaced by encrypted strings, I get the same "object not set to an instance" error message as in the start of this thread. bool result = Sample( szEncryp, szXMLPublicKey); also blows up if the first parm is NOT encrypted at all, just "xyz". The XML string is in fact a well-formed XML: string szXMLPublicString = provider_alg.GetXMLString(false); // and can be viewed and verified as a valid XML string. Help?? Hello ChuckD_Duncan,
try converting your encrypted strings to Base64 prior to sending string s = Convert.ToBase64(byte[]) this should be done automatically upon serialization by the proxy infrastructure (what datatype ends up in your wsdl document) ?? --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > passing something simple like: > bool result = Sample("first", "second"); > works fine... but when the two args are replaced by encrypted strings, > I > get the same "object not set to an instance" error message as in the > start of this thread. > > bool result = Sample( szEncryp, szXMLPublicKey); > > also blows up if the first parm is NOT encrypted at all, just "xyz". > The > XML string is in fact a well-formed XML: > string szXMLPublicString = provider_alg.GetXMLString(false); // > and > can be viewed and verified as a valid XML string. > Help?? > U are right. Converting Base64 should fix it. To overcome this issue, I
prefer to implement a class and mark it serializable and embed my data in it. Conversion is done automatically. I used this method for secure file transfer over SSL in web services. It works perfectly... -- Show quoteHide quoteThanks, Yunus Emre ALPÖZEN BSc, MCSD.NET "Dominick Baier [DevelopMentor]" <dbaier@pleasepleasenospamdevelop.com> wrote in message news:421237632530493895783323@news.microsoft.com... > Hello ChuckD_Duncan, > > try converting your encrypted strings to Base64 prior to sending > > string s = Convert.ToBase64(byte[]) > > this should be done automatically upon serialization by the proxy > infrastructure (what datatype ends up in your wsdl document) ?? > > --------------------------------------- > Dominick Baier - DevelopMentor > http://www.leastprivilege.com > >> passing something simple like: >> bool result = Sample("first", "second"); >> works fine... but when the two args are replaced by encrypted strings, >> I >> get the same "object not set to an instance" error message as in the >> start of this thread. >> >> bool result = Sample( szEncryp, szXMLPublicKey); >> >> also blows up if the first parm is NOT encrypted at all, just "xyz". >> The >> XML string is in fact a well-formed XML: >> string szXMLPublicString = provider_alg.GetXMLString(false); // >> and >> can be viewed and verified as a valid XML string. >> Help?? >> > > > Dom, this works great... except I'm afraid I'm a bit at a loss on how to
get the original string back on the other end of the pipe. There must be a Convert before I bust it up into bytes again, I guess??? Help? Thanks again. Hello ChuckD_Duncan,
ok - you are using a string variable now? Convert.FromBase64 is your friend on the server side. --------------------------------------- Dominick Baier - DevelopMentor http://www.leastprivilege.com Show quoteHide quote > Dom, this works great... except I'm afraid I'm a bit at a loss on how > to get the original string back on the other end of the pipe. There > must be a Convert before I bust it up into bytes again, I guess??? > > Help? > > Thanks again. > Dom, this works great... except I'm afraid I'm a bit at a loss on how to
get the original string back on the other end of the pipe. There must be a Convert before I bust it up into bytes again, I guess??? Help? Thanks again.
sslstream and certificates
Impersonation through HttpModule hotmail IIS / SQL Server impersonation How many keys? CAPICOM problem:cannot access certificate store .Net Authorization and NTFS permissions problem:referenced assembly "XPCommonControls(a free third party component)" has no strongName. DPAPI Changing MSN Messenger Display Name for NON msn/hotmail email addr |
|||||||||||||||||||||||