base64 and UTF-8 encoding issue
-
Hello everyone, I am writing a simple web method which returns byte[], and the byte[] is encoded by UTF-8. I have investigated related WSDL and soap message, seems the underlying web services stack will use base64 encoding? For various reasons, I can not use or re-encode my return byte[] from UTF-8 to base64. Any ideas to modify the base64 encoding to UTF-8 encoding? Here is my related web methods, SOAP message and related type in WSDL
Web service server side code
\[WebMethod\] public byte\[\] HelloWorld2() { return utf8encodedbytes; }
SOAP response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body
<HelloWorld2Response xmlns="http://tempuri.org/">
<HelloWorld2Result>base64Binary</HelloWorld2Result>
</HelloWorld2Response>
</soap:Body>
</soap:Envelope>related type in WSDL
xsd:base64Binary
thanks in advance, George
-
Hello everyone, I am writing a simple web method which returns byte[], and the byte[] is encoded by UTF-8. I have investigated related WSDL and soap message, seems the underlying web services stack will use base64 encoding? For various reasons, I can not use or re-encode my return byte[] from UTF-8 to base64. Any ideas to modify the base64 encoding to UTF-8 encoding? Here is my related web methods, SOAP message and related type in WSDL
Web service server side code
\[WebMethod\] public byte\[\] HelloWorld2() { return utf8encodedbytes; }
SOAP response
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
soap:Body
<HelloWorld2Response xmlns="http://tempuri.org/">
<HelloWorld2Result>base64Binary</HelloWorld2Result>
</HelloWorld2Response>
</soap:Body>
</soap:Envelope>related type in WSDL
xsd:base64Binary
thanks in advance, George
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
You misunderstand my question. Since I pass UTF-8 character in response, but in WSDL it is encoded as base64, there is runtime error which says XXX is invalid value in base64. So, my purpose is how to change the decoding scheme at client side to treat input as UTF-8 other than base64? Any ideas? regards, George
-
You misunderstand my question. Since I pass UTF-8 character in response, but in WSDL it is encoded as base64, there is runtime error which says XXX is invalid value in base64. So, my purpose is how to change the decoding scheme at client side to treat input as UTF-8 other than base64? Any ideas? regards, George
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
-
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L %^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2 W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN% Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia> -------------------------------------------------------- 128 bit encrypted signature, crack if you can
Thanks Xmen! Your document is good, but not directly answers my issue. Please refer to here for my specific issue. Any ideas or comments? http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2935210[^] regards, George