Wednesday, November 11, 2009

soap with security, Username Token

<soap:Envelope xmlns:har="http://www.yourhost.com/YourWebService" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
<soap:Header>
<wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-25814968" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>username</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">GR1ps</wsse:Password>
<wsse:Nonce>iKhvn+MbQxD26oRg89mffA==</wsse:Nonce>
<wsu:Created>2009-11-11T11:37:40.906Z</wsu:Created>
</wsse:UsernameToken>
</wsse:Security>
</soap:Header>
<soap:Body>
<har:getDetails>
<har:requestorID>requestorID</har:requestorID>
<!--Optional:-->
<har:requestorPassword>password</har:requestorPassword>
<!--Optional:-->
<har:requestData>7042776376380606</har:requestData>
</har:getDetails>
</soap:Body>
</soap:Envelope>


see also
Java and security bits

meta refresh


EPB Webservice Test Application
javascript:void(0)

Monday, October 5, 2009

cookies & ICEfaces

((HttpServletRequest)((BridgeExternalContext) FacesContext.getCurrentInstance().getExternalContext()).getRequest()).getCookies()
returns Cookie[]

((BridgeExternalContext) FacesContext.getCurrentInstance()
.getExternalContext()).addCookie(new Cookie(COOKIE_NAME, cookieValue));

Tuesday, July 14, 2009

Struts - custom validation messages

in validation.xml

<field property="increasedIdleRotation"
depends="integer,intRange">
<msg
name="intRange"
key="error.EPBMeasure.idleRotation.rangemsg" />
<var>
<var-name>min</var-name>
<var-value>2000</var-value>
</var>
<var>
<var-name>max</var-name>
<var-value>9999</var-value>
</var>
</field>

add element msg
name must correspond to the validator, e.g. intRange
key is the key in application.properties resource file containing the localizated error message when the corresponding validation fails

Tuesday, June 9, 2009

woodstock -> icefaces migration

combos problem - getting HTTP 500
with icefaces 1.8 get - java.util.NoSuchElementException: javax.faces.component.selectItemIterator.next

solution:
1) parameter com.icesoft.faces.standardRequestScope to be set to true (in web.xml)
when com.sun.sql.rowset.CachedRowSetXImpl is used for combo elements
2) use javax.faces.model.SelectItem[] for combo elements

mysql dump import

1) create db
mysql –u –p
will prompt for password, e.g. mysql –u root –p
create database <database> ;
e.g. create database sprit;
2) actuall db restore:
use mysql not msimport - the latter expects database structure to exist already
mysql –u –p <database> < <file>
will prompt for password
def. user - root
e.g. mysql –u –p <sprit> < <sprit.dmp>
3) to execute SQL commands from mysql console first execute
use <database> ; e.g. use sprit;