[JBossWS] - JAXB Annotations are beeing ignored
by andre.rieck@hansemerkur.de
Hi,
i've build a Web-Service enabled StatelessSession Bean with JAXB annotated classes as Result-Types.
@Stateless
@Remote(MyBusinessInterface.class)
@WebService(name="MyBusinessService")
public class MyBusinessServiceBean implements MyBusinessInterface
// from MyBusinessInterface
@WebMethod
public MyResultType getResult() {
....
}
...
}
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name="ResultType")
public class MyResultType implements Serializable {
@XmlElement(name="anElement")
protected List myElements;
... getters and setters ...
}
Unfortunately the JAXB-Annotations are ignored when
generating the wsdl !
I used wsprovide and also tried just to deploying the the EAR with the
@WebService-annotated bean. In both cases the JAXB-Annotations
do not seem to have any effect.
I would very much appreciate any hint on what might be wrong here.
Thanks a lot :-) !!
André
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209496#4209496
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209496
15 years, 10 months
[JBossWS] - Is it possible to inject a Datasource in a JBoss WS ?
by dimar1975
Hi all !
I have posted this question in the persistence forum yesterday, but I had no luck. Meybe this forum is more appropriate: so I'm trying to inject a Datasource in a Webservice....
@WebService(name = "CalculatorWS", targetNamespace = "http://webservice_calc/calculator")
| public class CalculatorWS
| {
| @Resource(mappedName="java:/OracleDS")
| DataSource datasource;
|
| @WebMethod
| public Person calculate(Object obj) {
| System.out.println("Datasource is " + datasource; // NULL !!
| // .....
| }
| }
|
|
|
The Datasource injected is null in the method calculate.....
so I have tried to get the datasource with the InitialContext
DataSource ds = (DataSource)new InitialContext().lookup("java:/OracleDS");
|
| Connection conn = null;
| try {
|
| conn = ds.getConnection();
| System.out.println("Connection with initial context" +conn);
| }
|
|
and the Connection is correctly retrieved.
Do I miss something to make it work also with injection ???
The AS I0m using is JBoss 5.0 GA but I have tested also with 4.2 and it doesn't work too. :-(
Thanks a lot
Marco
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209416#4209416
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209416
15 years, 10 months
[JBossWS] - WS-Security on POJO Endpoint
by dhanushgopinath
Hi,
I am trying to implement WS-Security on a POJO Endpoint using JBOSS WS. I want to use the UserName token authentication. This is already a Jira Issue with 3.0.5 (https://jira.jboss.org/jira/browse/JBWS-1999) and since I saw the Jira Issue as resolved, I got the latest code from the site and built the Web Service stack and tried to implement it. I am implementing based on this
http://www.jboss.org/index.html?module=bb&op=viewtopic&t=131719&postdays=...
But while deploying the Web Service the endpoint configuration is shown as Standard Endpoint in the logs . Shouldn't it be Standard WSSecurity Endpoint. Given below is the excerpt from log.
| ServerEndpointMetaData:
| type=JAXWS
| qname={http://www.test.com/WF/Framework/AWFUtilityService}AWFUtilityServi...
| id=jboss.ws:context=TestUtility,endpoint=AWFUtilityService
| address=http://127.0.0.1:8180/TestUtility/AWFUtilityService
| binding=http://schemas.xmlsoap.org/wsdl/soap/http
| linkName=AWFUtilityService
| implName=com.test.wf.framework.awfutilityservice.AWFUtilityServiceImpl
| seiName=com.test.wf.framework.awfutilityservice.AWFUtilityServicePortType
| serviceMode=null
| portComponentName=null
| contextRoot=/TestUtility
| urlPattern=/AWFUtilityService
| configFile=META-INF/standard-jaxws-endpoint-config.xml
| configName=Standard Endpoint
| authMethod=null
| transportGuarantee=null
| secureWSDLAccess=false
| properties={}
|
Now I run the client and the SOAP Message is properly built using the wsse:security headers, but at the server side its throwing a class cast exception
2009-02-11 20:12:52,153 DEBUG [org.jboss.ws.core.soap.MessageFactoryImpl] createMessage: [contentType=text/xml; charset=UTF-8]
| 2009-02-11 20:12:52,247 DEBUG [org.jboss.ws.metadata.umdm.EndpointMetaData] Configure SOAPBinding
| 2009-02-11 20:12:52,247 ERROR [org.jboss.ws.core.jaxws.SOAPFaultHelperJAXWS] SOAP request exception
| java.lang.ClassCastException: org.jboss.ws.core.soap.EnvelopeBuilderDOM
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:278)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:193)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:455)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:295)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:205)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:131)
| at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(AbstractEndpointServlet.java:85)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
|
Here is my Web Service and the server side config files.
| @WebService(name="AWFUtilityServicePortType", serviceName = "AWFUtilityService", targetNamespace = "http://www.test.com/WF/Framework/AWFUtilityService",
| endpointInterface = "com.test.wf.framework.awfutilityservice.AWFUtilityServicePortType"
| )
| @EndpointConfig(configFile="META-INF/standard-jaxws-endpoint-config.xml", configName = "Standard WSSecurity Endpoint")
|
| public class AWFUtilityServiceImpl implements AWFUtilityServicePortType {
|
| public String getCorrelationID(String CorrelationID)
| throws GetCorrelationIDFault
| {
| String strCorrValue = Calendar.getInstance().getTime().toString();
| return CorrelationID + "_" + strCorrValue;
| }
|
| }
|
Server config file jboss-wsse-server.xml
<?xml version="1.0" encoding="UTF-8"?>
|
| <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>
| <authorize>
| <unchecked />
| </authorize>
| </config>
|
| <port name="AWFUtilityServicePort">
| <operation
| name="{http://www.test.com/WF/Framework/AWFUtilityService}getCorrelationID">
| <config>
| <authorize>
| <unchecked />
| </authorize>
| </config>
| </operation>
| </port>
| </jboss-ws-security>
|
jboss-web.xml
<?xml version="1.0" encoding="UTF-8"?>
| <!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_4_0.dtd">
|
|
| <jboss-web>
|
| <security-domain>java:/jaas/JBossWS</security-domain>
| <context-root>/TestUtility</context-root>
|
| </jboss-web>
|
Please help why this service is not getting deployed as a WS Security Endpoint. Do I need to enable it some where ? Or is it that the latest code doesn't contain the fix?
Thanks in Advance.
Dhanush
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209342#4209342
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209342
15 years, 10 months
[JBossWS] - Problem with inheritance - JbossWS
by fghj5678
I have problem to get inheritance in a WS to work.
I've tried a small example on these env:
Windows XP SP2
Jboss AS 4.2.2 GA , 4.2.3 (and also JBoss eap 4.3)
I'm trying to do a request to server with a parameter that contains a inherited class. Class testEnv contains class testAAA, and class testBBB inherits testAAA. So when I put testBBB in testEnv and sends it to the WS I'm supposed to get testBBB from testEnv on the server - but I only get a testAAA!
Classes used in my example:
| @WebService
| public interface TestWS {
|
| public String test(TestEnv testEnv);
| }
|
|
| @Stateless
| @WebService(name = "TestWSService", serviceName = "TestWSService")
| @Remote(TestWS.class)
| public class TestWSImpl implements TestWS {
|
| public String test(TestEnv testEnv) {
| if (testEnv.getTestAAA() instanceof TestAAA) {
| return "WRONG, should not end up here";
| } else if (testEnv.getTestAAA() instanceof TestBBB) {
| return "CORRECT";
| }
| return "ERROR..";
| }
|
|
| public class TestEnv implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| TestAAA testAAA;
|
| public TestAAA getTestAAA() {
| return testAAA;
| }
|
| public void setTestAAA(TestAAA testAAA) {
| this.testAAA = testAAA;
| }
| }
|
| @XmlSeeAlso({TestBBB.class})
| public class TestAAA implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| int a = 1;
| }
|
| public class TestBBB extends TestAAA implements Serializable {
|
| private static final long serialVersionUID = 1L;
|
| int b = 2;
| }
|
|
Then I've tried both with SoupUI and a generated ws-client - but I always get a testAAA instead of testBBB. example from ws-client:
| ...
| TestWSService testWS = ts.getTestWSServicePort();
| TestBBB testBBB = new TestBBB();
| TestEnv testEnv = new TestEnv();
| testEnv.setTestAAA(testBBB);
| String s = testWS.test(testEnv);
| ...
|
I also have logged the http soap request and it looks ok (with xsi:type for the inherited class), here is the parameter:
| <testAAA xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="ns2:testBBB"/>
|
This is from the generated wsdl: (which have a correct "extension base=..")
| <xs:complexType name="test">
| <xs:sequence>
| <xs:element minOccurs="0" name="arg0" type="tns:testEnv"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="testEnv">
| <xs:sequence>
| <xs:element minOccurs="0" name="testAAA" type="tns:testAAA"/>
| </xs:sequence>
| </xs:complexType>
| <xs:complexType name="testAAA">
| <xs:sequence/>
| </xs:complexType>
| <xs:complexType name="testBBB">
| <xs:complexContent>
| <xs:extension base="tns:testAAA">
| <xs:sequence/>
| </xs:extension>
| </xs:complexContent>
| </xs:complexType>
|
Any help would be appreciated!
Mats.
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209119#4209119
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209119
15 years, 10 months
[JBossWS] - Receiving Compressed WebService Requests
by hannes.koller
Hi,
I have built a simple JAX-WS WebService (on JBoss 4.2.3.GA) which is supposed to receive a rather large data structure from clients. In order to speed up the transmission I would like the clients of my service to use http compressed requests.
I have tried using SoapUI to test the service. As long as I turn off request compression in SoapUI everything works fine. When I set Request compression to "GZIP" or "DEFLATE" I get the following error from JBoss:
| 14:35:33,042 ERROR [SOAPFaultHelperJAXWS] SOAP request exception
| org.jboss.ws.core.CommonSOAPFaultException: org.xml.sax.SAXParseException: Content is not allowed in prolog.
| at org.jboss.ws.core.soap.EnvelopeBuilderDOM.build(EnvelopeBuilderDOM.java:93)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:280)
| at org.jboss.ws.core.soap.MessageFactoryImpl.createMessage(MessageFactoryImpl.java:195)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:447)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleRequest(RequestHandlerImpl.java:284)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.doPost(RequestHandlerImpl.java:201)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.handleHttpRequest(RequestHandlerImpl.java:134)
| at org.jboss.wsf.stack.jbws.EndpointServlet.service(EndpointServlet.java:84)
| at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
| at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
| at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
| at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
| at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
| at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:182)
| at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
| at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
| at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
| at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
| at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
| at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
| at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
| at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
| at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
| at java.lang.Thread.run(Thread.java:619)
|
It appears that the request is not uncompressed before it is forwarded to the SAX Parser. I am wondering how I can tell JBoss to run compressed requests through gzip before passing them to the SAX Parser? Or is it possible to write a custom HttpConnectionHandler in order to perform request decompression? I would be most thankful for any pointers you can give me. TIA :)
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4209073#4209073
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4209073
15 years, 10 months