views:

79

answers:

1

My understanding was that the default encoding for wsHttp binding is text. However, when I use Fiddler to see the SOAP message, a part of it looks like this:

<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing" xmlns:u="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;&lt;s:Header&gt;&lt;a:Action s:mustUnderstand="1" u:Id="_2">http://tempuri.org/Services/MyContract/GetDataResponse&lt;/a:Action&gt;&lt;a:RelatesTo u:Id="_3">urn:uuid:503c5525-f585-4ecd-ac09-24db78526952</a:RelatesTo><o:Security s:mustUnderstand="1" xmlns:o="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;&lt;u:Timestamp u:Id="uuid-8935f789-fbb7-4c69-9f67-7708373088c5-22"><u:Created>2010-03-08T19:15:50.852Z</u:Created><u:Expires>2010-03-08T19:20:50.852Z</u:Expires></u:Timestamp><c:DerivedKeyToken u:Id="uuid-8935f789-fbb7-4c69-9f67-7708373088c5-18" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc"&gt;&lt;o:SecurityTokenReference&gt;&lt;o:Reference URI="urn:uuid:b2cbfe07-8093-4f44-8a06-f8b062291643" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct"/&gt;&lt;/o:SecurityTokenReference&gt;&lt;c:Offset&gt;0&lt;/c:Offset&gt;&lt;c:Length&gt;24&lt;/c:Length&gt;&lt;c:Nonce&gt;afOoDygRG7BW+q8+makVIA==&lt;/c:Nonce&gt;&lt;/c:DerivedKeyToken&gt;&lt;c:DerivedKeyToken u:Id="uuid-8935f789-fbb7-4c69-9f67-7708373088c5-19" xmlns:c="http://schemas.xmlsoap.org/ws/2005/02/sc"&gt;&lt;o:SecurityTokenReference&gt;&lt;o:Reference URI="urn:uuid:b2cbfe07-8093-4f44-8a06-f8b062291643" ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/sct"/&gt;&lt;/o:SecurityTokenReference&gt;&lt;c:Nonce&gt;l4rFsdYKLJTK4tgUWrSBRw==&lt;/c:Nonce&gt;&lt;/c:DerivedKeyToken&gt;&lt;e:ReferenceList xmlns:e="http://www.w3.org/2001/04/xmlenc#"&gt;&lt;e:DataReference URI="#_1"/><e:DataReference URI="#_4"/></e:ReferenceList><e:EncryptedData Id="_4" Type="http://www.w3.org/2001/04/xmlenc#Element" xmlns:e="http://www.w3.org/2001/04/xmlenc#"&gt;&lt;e:EncryptionMethod Algorithm="http://www.w3.org/2001/04/xmlenc#aes256-cbc"/&gt;&lt;KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#"&gt;&lt;o:SecurityTokenReference&gt;&lt;o:Reference ValueType="http://schemas.xmlsoap.org/ws/2005/02/sc/dk" URI="#uuid-8935f789-fbb7-4c69-9f67-7708373088c5-19"/></o:SecurityTokenReference></KeyInfo><e:CipherData><e:CipherValue>dW8B7wGV9tYaxM5ADzY6UuEgB5TFzdy4BZjOtF0NEbHyNevCIAVHMoyA69U4oUjQHMJD5nHS0N4tnJqfJkYellKlpFZcwqruJ1J/TFx9uwLFFAwZ+dSfkDqgKu/1MFzVSY8eyeYKmbPbVEYOHr0lhw3+7wn5NQr3yxvCjlucTAdklIhD72YnVlSVapOW3zgysGt5hStyj+bmIz5hLGyyv6If4HzWjUiru8V3iMM/ss1I+i9sJOD013kr4zaaA937CN9+/aZ2wbDXnYj31UX49uE/vvt9Tl+c4SiydbiX7tp1eNSTx9Ms5O64gb3aUmHEAYOJ19XCrr756ssFZtaE7QOAoPQkFbx9zXy0mb9j1YoPQNG+JAcrN0yoRN1klhccmY+csfYXdq7YBB/KS+u2WnUjQ7SlNFy5qIPxuy5y0Jyedr2diPKLi0gUi+cK49BLQtG/XEShtxFaeMy7zZTrQADxww7kEkhvtmAlmyRbz3oGc+

This doesn't look like text encoding to me (Shouldn't text encoding send data in readable form)? What am I missing?

Also, how do I setup binary encoding for wsHttp binding?

A: 

Each of the standard bindings uses different transport and encodings.

Reference:
http://en.csharp-online.net/WCF_Essentials%E2%80%94Format_and_Encoding

JeremySpouken
Per the table in the link, wsHttp uses Text encoding - so shouldn't I be seeing plain text in the soap message. The soap message has this xml : <t:BinaryExchange ValueType="schemas.xmlsoap.org/ws/2005/02/trust/spnego" EncodingType="docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"> Not sure why it says Base64Binary
Yes. But does the endpoint has it configured?<endpoint address="" binding="wsHttpBinding" contract="IContract" >
JeremySpouken