Note that there are some explanatory texts on larger screens.

plurals
  1. POProblems while attempting to hit WSE secured webservice with WCF client: generating incorrect Header
    primarykey
    data
    text
    <p>This is a header that I would like to generate...</p> <pre><code>&lt;soap:Header&gt; &lt;wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt; &lt;wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt; &lt;wsse:Username&gt;----------&lt;/wsse:Username&gt; &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText"&gt;----------&lt;/wsse:Password&gt; &lt;wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"&gt;Hozef94FFwOhuiF5QixaMQ==&lt;/wsse:Nonce&gt; &lt;wsu:Created&gt;2012-08-21T13:26:03.642Z&lt;/wsu:Created&gt; &lt;/wsse:UsernameToken&gt; &lt;/wsse:Security&gt; &lt;/soap:Header&gt; </code></pre> <p>This is a header that I am currently generating...</p> <pre><code>&lt;wsse:Username xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;MedTrak_Dev&lt;/wsse:Username&gt; &lt;wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;---------&lt;/wsse:Password&gt; &lt;wsse:Nonce xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt;WEb3nSNkVO29y0Mt91yYNA==&lt;/wsse:Nonce&gt; &lt;wsu:Created xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"&gt;2012-08-24T13:45:14Z&lt;/wsu:Created&gt; </code></pre> <p>Actually, I can't tell what the header is? How can I figure that out?</p> <p>I did this following the tutorial given in this stack overflow answer...<a href="https://stackoverflow.com/a/5484601/729820">WSE service Client answer</a></p> <p>I believe the problem lies within this specific section of code from that answer</p> <pre><code>public object BeforeSendRequest(ref System.ServiceModel.Channels.Message request, System.ServiceModel.IClientChannel channel) { // Use the WSE 3.0 security token class UsernameToken token = new UsernameToken(this.Username, this.Password, PasswordOption.SendPlainText); Nonce nonce = new Nonce(10); // Serialize the token to XML XmlElement securityToken = token.GetXml(new XmlDocument()); // MessageHeader securityHeader = MessageHeader.CreateHeader("Security", "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#UsernameToken", securityToken, false); request.Headers.Add(securityHeader); // complete return Convert.DBNull; } </code></pre> <p>I modified it a bit so that I send the password in plain text and I get rid of the unimplementedExceptions exceptions tosses. How can I make sure that I get the correct header?</p> <pre><code>security.wssecurity.WSSContextImpl.s02: com.ibm.websphere.security.WSSecurityException: Exception org.apache.axis2.AxisFault: CWWSS5525E: The server cannot find the security header for a Web service with no actor. ocurred while running action: com.ibm.ws.wssecurity.handler.WSSecurityConsumerHandler$1@6af56af5 </code></pre> <p><strong>UPDATE: Generating a relatively close header</strong></p> <p>Except, it is throwing the entire request into the head of the SOAP request and not splitting it up into the body and It is not generating a nonce or creation date... So I guess those would be my next couple of tasks...</p> <pre><code>&lt;s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"&gt; &lt;s:Header&gt; &lt;VsDebuggerCausalityData xmlns="http://schemas.microsoft.com/vstudio/diagnostics/servicemodelsink"&gt;uIDPo9VZylDHg5JMgjsNnWLhATkAAAAA+YtOxHdh0Uqd4a64raX/nIzYz20mPHlBv4Wk5S8d5PsACQAA&lt;/VsDebuggerCausalityData&gt; &lt;wsse:Security s:mustUnderstand="0" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; &lt;UsernameToken xmlns="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"&gt; &lt;Username&gt;------------&lt;/Username&gt; &lt;Password&gt;************&lt;/Password&gt; &lt;/UsernameToken&gt; &lt;/wsse:Security&gt; &lt;s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"&gt; &lt;GetOrganizations xmlns="http://esdm.upmc.com/bpm/medtrak/businessobjects/messaging/"&gt; &lt;personId xmlns=""&gt;0&lt;/personId&gt; &lt;typeId xmlns=""&gt; &lt;int&gt;1&lt;/int&gt; &lt;int&gt;2&lt;/int&gt; &lt;int&gt;3&lt;/int&gt; &lt;int&gt;4&lt;/int&gt; &lt;/typeId&gt; &lt;/GetOrganizations&gt; &lt;/s:Body&gt; &lt;/s:Header&gt; &lt;/s:Envelope&gt; </code></pre> <p>My order of operations must be off or something.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload