[JBoss Web Services] - Problem with securing web service with ws security ( username token )
by Łukasz Marczuk
Łukasz Marczuk [http://community.jboss.org/people/lmarczuk] created the discussion
"Problem with securing web service with ws security ( username token )"
To view the discussion, visit: http://community.jboss.org/message/560597#560597
--------------------------------------------------------------
Hello,
I'am trying to secure web service ( from ejb 3.0 stateless bean) and it is not working.
here is my code :
Bean :
@Stateless
@SOAPBinding(style=SOAPBinding.Style.RPC)
@SecurityDomain("JBossWS")
@EndpointConfig(configName = "Standard WSSecurity Endpoint")
@WebService(name="Hello",targetNamespace = " http://test http://test",serviceName = "HelloWSSService")
public class HelloBean implements IHello {
@WebMethod
public String sayHello(String aName) {
return "siemanko " + aName;
}
}
// ... some imports
@Stateless
@SOAPBinding(style=SOAPBinding.Style.RPC)
@SecurityDomain("JBossWS")
@EndpointConfig(configName = "Standard WSSecurity Endpoint")
@WebService(name="Hello",targetNamespace = "http://test",serviceName = "HelloWSSService")
public class HelloBean implements IHello {
@WebMethod
public String sayHello(String aName) {
return "siemanko " + aName;
}
}
interface :
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT)
@EndpointConfig(configName = "Standard WSSecurity Endpoint")
@WebService(name="Hello",targetNamespace = "http://test",serviceName = "HelloWSSService")
public interface IHello {
String sayHello( String name);
}
In my META-INF folder i put jboss-wsse-server.xml file :
<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
<config>
<timestamp ttl="300"/>
<requires/>
</config>
</jboss-ws-security>
Now i deploy my app on server and i test it from SoapUI.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:test="http://test">
<soapenv:Header/>
<soapenv:Body>
<test:sayHello>
<arg0>?</arg0>
</test:sayHello>
</soapenv:Body>
</soapenv:Envelope>
And anser :
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
<wsse:Security env:mustUnderstand="1" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext..." xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utilit...">
<wsu:Timestamp wsu:Id="timestamp">
<wsu:Created>2010-09-06T11:41:38.621Z</wsu:Created>
<wsu:Expires>2010-09-06T11:46:38.621Z</wsu:Expires>
</wsu:Timestamp>
</wsse:Security>
</env:Header>
<env:Body>
<test:sayHelloResponse xmlns:test="http://test">
<return>siemanko ?</return>
</test:sayHelloResponse>
</env:Body>
</env:Envelope>
Got any idea why i can't secure my web service like that? i tryid it on jboss 4.2.3 , 5.01, 5.1, and 6 actually i work on 5.0.1 with JBoss Web Services - Native Server 3.3.1.GA.
Mayby i'm skipping some step or jboss-wsse-server.xml is incorect ?
when i put to jboss-wsse-server.xml this :
<jboss-ws-security xmlns="http://www.jboss.com/ws-security/config"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.jboss.com/ws-security/config
http://www.jboss.com/ws-security/schema/jboss-ws-security_1_0.xsd">
<config>
<username/>
<authenticate>
<usernameAuth/>
</authenticate>
</config>
</jboss-ws-security>
Also nothing happend and i'am albe to get response without puting principals in header.
JBossWS is good configured in login-config.xml
Please help.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/560597#560597]
Start a new discussion in JBoss Web Services at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months
[Datasource Configuration] - HA XA Datasource
by Ross Nicholson
Ross Nicholson [http://community.jboss.org/people/rnicholson10] created the discussion
"HA XA Datasource"
To view the discussion, visit: http://community.jboss.org/message/566687#566687
--------------------------------------------------------------
Hi,
We currnently use HA local tx connections in JBoss 5.1, it is very simple to set up simply separating JNDI strings with "|", characters as follows:
<local-tx-datasource>
<jndi-name>PhaseInformixLocalTX</jndi-name>
<connection-url>jdbc:informix-sqli://rampcm1:port/database:INFORMIXSERVER=oltp_cm1;IFX_LOCK_MODE_WAIT=20|jdbc:informix-sqli:
//rampcm2:port/database:INFORMIXSERVER=oltp_cm2;IFX_LOCK_MODE_WAIT=20</connection-url>
<url-delimeter>|</url-delimeter>
<driver-class>com.informix.jdbc.IfxDriver</driver-class>
<user-name>user</user-name>
<password>password</password>
</local-tx-datasource>
What I am having difficulty with is setting up a HA XA datasource, the following is my attempt which does not work:
<xa-datasource>
<jndi-name>PhaseInformixXADS</jndi-name>
<xa-datasource-class>com.informix.jdbcx.IfxXADataSource</xa-datasource-class>
<url-delimeter>|</url-delimeter>
<xa-datasource-property name="Description">DB Pool for phase to talk to Informix</xa-datasource-property>
<xa-datasource-property name="IfxIFXHOST">rampcm1|rampcm2</xa-datasource-property>
<xa-datasource-property name="PortNumber">PORT</xa-datasource-property>
<xa-datasource-property name="DatabaseName">target db</xa-datasource-property>
<xa-datasource-property name="ServerName">oltp_cm1|oltp_cm2</xa-datasource-property>
<xa-datasource-property name="User">user</xa-datasource-property>
<xa-datasource-property name="Password">password</xa-datasource-property>
<xa-datasource-property name="IfxIFX_LOCK_MODE_WAIT">20</xa-datasource-property>
<transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
<user-name>user</user-name>
<password>password</password>
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.InformixExceptionSorter</exception-sorter-class-name>
<metadata>
<type-mapping>InformixDB</type-mapping>
</metadata>
</xa-datasource>
I simply tried to separate the host and servername using "|" characters (which I know cannot work!).
Does anyone know how this should be done?
Thanks,
Ross
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/566687#566687]
Start a new discussion in Datasource Configuration at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months
[jBPM] - jbpm process instance save
by arash norouz
arash norouz [http://community.jboss.org/people/arashbahal] created the discussion
"jbpm process instance save"
To view the discussion, visit: http://community.jboss.org/message/568794#568794
--------------------------------------------------------------
| | Hi all
i am new to JBPM. i am using jbpm4.4 this is my basic example code: |
ProcessEngine processEngine = new Configuration()
.buildProcessEngine();
NewDeployment deployment=processEngine.getRepositoryService().createDeployment().addResourceFromClasspath("com/pardis/jpdl/test.jpdl.xml");
String deploymentId = deployment.deploy();
Map<String,Object> variables = new HashMap<String,Object>();
variables.put("customer", "John Doe");
variables.put("type", "Accident");
variables.put("amount", new Float(763.74));
ProcessInstance processInstance = processEngine.getExecutionService().startProcessInstanceByKey("iran",variables,"doops");
processEngine.getExecutionService().signalExecutionById(processInstance.getId());
and this is my process definition:
<?xml version="1.0" encoding="UTF-8"?>
<process key="iran" name="test" xmlns="http://jbpm.org/4.4/jpdl">
<start g="388,85,48,48" name="start1">
<transition g="-49,-18" name="to state1" to="state1"/>
</start>
<end g="519,310,48,48" name="end1"/>
<java class="test.TestAction" g="278,173,92,52" method="pr" name="java1">
<arg> <object expr="#{type}"/> </arg>
<arg> <object expr="#{customer}"/> </arg>
<arg> <object expr="#{amount}"/> </arg>
<transition name="to state2" to="state2" g="-49,-18"/>
</java>
<state g="89,151,92,52" name="state1">
<transition g="-45,-18" name="to java1" to="java1"/>
</state>
<state name="state2" g="500,205,92,52">
<transition name="to end1" to="end1" g="-42,-18"/>
</state>
</process>
i have a question about it:
2. suppose that the execution of process is halted on some state, how could i persist the execution and resume it again? i want to run a process for multiple users and keep tracks of executions.
i think that JBPM documentation is very poor! so could you suggest a useful resource to me? thanks in advance
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/568794#568794]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
15 years, 5 months