[JBossWS] - Re: MTOM + WS Security = problem
by richard_opalka
"davideling" wrote : Ok,
| but have the MTOM attachment to be inlined or not
| when WS-Security signature or encryption is activated?
|
| Thanks
|
MTOM attachments do not need to be inlined.
For example Microsoft Indigo and some other Java stacks (I don't know if JBossWS too)
provide some kind of "MTOM SAAJ Text Element",
which contains just MIME attachment id as its content (when you're
sniffing the wire communcation). However from SOAP stack point of view when
some other SAAJ handler that is in the handler chain tries to read
the content of this special text element, it will obtain attachment binary data
encoded in base64 canonical format instead of the attachment id.
However on the wire it goes as the MIME attachment.
This has also some performance consequences. For example if application
sends MTOM in the form of MIME attachment and there's some handler in
the handler chain that needs to work with this MTOM attachment content
(e.g. WSSecurity SAAJ handler), this attachment must be encoded to base64 canonical
format and that value is returned to the requestor. When
processing really big attachments this fact causes real performance issues.
Rio
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057567#4057567
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057567
17 years, 6 months
[JBossWS] - Re: change HTTP status code in a WS fault
by axstevens
Something along the following lines if you can configure in a filter.
But to a previous posters point. How do you get a filter configured when @WebService is a Session Bean, nice <web-app> example in user guide is for POJO. I guess use HTTP request/response context properties in SOAPHandler? Haven't looked to see if they are popuated yet.
But anyway kind of problemattic with a lot of servlet filter resources already written for authentication, etc.
public class AdobeStatusFilter implements Filter {
| Logger log = Logger.getLogger(AdobeStatusFilter.class);
| private FilterConfig filterConfig = null;
|
| public void init(FilterConfig filterConfig) throws ServletException {
| this.filterConfig = filterConfig;
| }
|
| public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException {
| AdobeResponseWrapper wrapper = new AdobeResponseWrapper((HttpServletResponse) resp);
| HttpServletResponse response = (HttpServletResponse)resp;
| chain.doFilter(req, wrapper);
| }
|
| public void destroy() {
| this.filterConfig = null;
| }
|
| }
public class AdobeResponseWrapper extends HttpServletResponseWrapper {
|
| private int statusCode;
| public AdobeResponseWrapper(HttpServletResponse response) {
| super(response);
| }
| public int getStatus() {
| return statusCode;
| }
| public void sendError(int errorCode) throws IOException {
| this.statusCode = adjust(errorCode);
| super.sendError(this.statusCode);
| }
| public void sendError(int errorCode, String errorMessage) throws IOException {
| this.statusCode = adjust(errorCode);
| super.sendError(this.statusCode, errorMessage);
| }
| public void setStatus(int statusCode) {
| this.statusCode = adjust(statusCode);
| super.setStatus(this.statusCode);
| }
| public void setStatus(int statusCode, String message) {
| this.statusCode = adjust(statusCode);
| super.setStatus(this.statusCode, message);
| }
|
| private int adjust(int errorCode) {
| return errorCode == HttpServletResponse.SC_INTERNAL_SERVER_ERROR ?
| HttpServletResponse.SC_OK : errorCode;
| }
|
|
| }
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057524#4057524
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057524
17 years, 6 months
[JBossWS] - Re: Problem Accessing Web Service
by djayakaran
I've tried everything short of looking into JBoss's source code to see why it's throwing the exception:
Here's a portion of the call stack in the exception:
javax.xml.ws.WebServiceException: SEI is missing @WebService annotation: interface ws.currencyconverter.CurrencyWS
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.assertSEIConstraints(ServiceDelegateImpl.java:287)
at org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.getPort(ServiceDelegateImpl.java:180)
at javax.xml.ws.Service.getPort(Service.java:116)
at ws.currencyconverter.CurrencyWSService.getCurrencyWSPort(CurrencyWSService.java:54)
at commands.ConvertCurrencyCommand.invokeWebService(ConvertCurrencyCommand.java:76)
at commands.ConvertCurrencyCommand.execute(ConvertCurrencyCommand.java:59)
at web.CurrencyConverterServlet.process(CurrencyConverterServlet.java:52)
Can someone help? If you think you can help but need more info, please reply and I'll post any additional info needed.
Thanks,
David
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057401#4057401
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057401
17 years, 6 months
[JBossWS] - Elements sorted in Ascending order in WSDL
by leo5abi
Hello there,
new beginner in JBOSSWS.
I went through the Getting started guide release 5 from JBOSS and developed a Small web service.
Details:
EJB:
I have an entity bean that selects data from a view in HSQLDB with columns as Contract, Newdate, Company (all varchar)
On top of entity bean i have a session bean that i use to access all records in a view (findAll()) using EJB ql.
I have deployed the ejb - works fine
Now i try to develop a webservice to access the VIEW (using the startup guide). Now when i run the wstool the WSDL file i get has elemnts in Ascending order of the name
i.e
element name="company" nillable="true" type="string"
element name="contract" nillable="true" type="string"
element name="newdate" nillable="true" type="string"
whereas i was expecting it to be in order same as column in the view
element name="contract" nillable="true" type="string"
element name="newdate" nillable="true" type="string"
element name="company" nillable="true" type="string"
deployment of ws goes fine
Now when i run my client and try to print contract, i get company name which mean that data is correct but element name is wrong
Help needed what should i do to correct my problem so that the data for contract comes under element contract?
/Amit
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057360#4057360
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057360
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by davideling
Thank you for your links mr_d, they are very interesting.
Now I'm sure that my Web Services behaviour is not correct :-( .
Request Headers
| POST /servizioJBossCipheredSigned/ServizioJBossCipheredSigned?datatype=JBossWSMessage HTTP/1.1
|
| Authorization: Basic bXlVc2VybmFtZTpteVBhc3N3b3Jk
|
| SOAPAction: ""
|
| Content-Type: text/xml; charset=UTF-8
|
| JBoss-Remoting-Version: 22
|
| User-Agent: JBossRemoting - 2.2.0 SP4 (Bluto)
|
| Host: 127.0.0.1:8181
|
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
|
| Connection: keep-alive
|
| Content-Length: 503592
|
Response Headers
| HTTP/1.1 200 OK
|
| Server: Apache-Coyote/1.1
|
| X-Powered-By: Servlet 2.4; JBoss-4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)/Tomcat-5.5
|
| Content-Type: text/xml;charset=UTF-8
|
| Transfer-Encoding: chunked
|
| Date: Mon, 25 Jun 2007 13:22:57 GMT
|
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057348#4057348
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057348
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by mr_d
Hello,
Thanks for your answers,
@richard_opalka:
I agree, they are compatible, so to use attachments with WS Security, MTOM is the only and right way.
@davideling:
I have the same config. As I said on my first post, mtom only works, and ws security only also works.
Are you sure that your encrypted soap envelope is created using mtom?
Can you post one of your soap messages? And also the parameters of the exposed method or the wsdl file?
I tried to get some soap message examples where mtom + ws security are enabled.
I found two:
-http://wso2.org/files/rampart-tute.pdf [page 81]
-http://msdn2.microsoft.com/en-US/library/aa738574.aspx[bottom of the page]
In these two message, we can see that:
-Content-Type contains "multipart/related" and "type="application/xop+xml"
-In the body of the soap message, there is a "xop:Include" element
-In the body of the soap message, there is a "CipherData" and a "CipherValue" element
-The attachment is in an encrypted mime part
The two first points are the proof that mtom is enabled.
The last ones indicate that ws security is active too.
Im trying to achieve this kind of message with JbossWS. So far, no luck.
:oD.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057334#4057334
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057334
17 years, 6 months
[JBossWS] - Re: JBoss 4.0.5 and JBoss 4.2 CR1 plus JBossWS 1.2 - Does it
by patel_123
i am getting following error can anybody tell what would be cause,
Caused by: org.jboss.ws.WSException: Cannot obtain java type mapping for: {http://wb1-329:8080}validateUser
at org.jboss.ws.deployment.JSR109MetaDataBuilder.buildParameterMetaDataDoc(JSR109MetaDataBuilder.java:451)
at org.jboss.ws.deployment.JSR109MetaDataBuilder.setupOperationsFromWSDL(JSR109MetaDataBuilder.java:200)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaDataInternal(JSR109ClientMetaDataBuilder.java:208)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:126)
at org.jboss.ws.deployment.JSR109ClientMetaDataBuilder.buildMetaData(JSR109ClientMetaDataBuilder.java:82)
at org.jboss.ws.jaxrpc.ServiceImpl.(ServiceImpl.java:96)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:157)
at org.jboss.ws.jaxrpc.ServiceFactoryImpl.createService(ServiceFactoryImpl.java:128)
at client.UserBean.loginUser(UserBean.java:90)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
thanks in advance
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057275#4057275
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057275
17 years, 6 months