[JBossWS] - Re: MTOM + WS Security = problem
by davideling
I'm sorry Rio, I'm at work now and
I can't look JBossWS sources now.
All I can do now is look at client log4j logs.
If I enable WS-Security I can see this where I can find
two times
...HEADER={SOAPAction="", Content-Type=text/xml...
| ...
| DEBUG main org.jboss.remoting.MicroRemoteClientInvoker - org.jboss.remoting.transport.http.HTTPClientInvoker@1922f46 connecting
| DEBUG main org.jboss.remoting.MicroRemoteClientInvoker - org.jboss.remoting.transport.http.HTTPClientInvoker@1922f46 connected
| DEBUG main org.jboss.ws.core.client.RemotingConnectionImpl - Remoting metadata: {http.basic.password=mypassword, http.basic.username=myusername, HEADER={SOAPAction="", Content-Type=text/xml; charset=UTF-8}, NoThrowOnError=true}
| DEBUG main org.jboss.remoting.transport.http.HTTPClientInvoker - Setting request header with SOAPAction : ""
| DEBUG main org.jboss.remoting.transport.http.HTTPClientInvoker - Setting request header with Content-Type : text/xml; charset=UTF-8
| DEBUG main org.jboss.ws.core.soap.SOAPContentElement - MTOM enabled: Restore XOP data
| DEBUG main org.jboss.ws.extensions.xop.XOPContext - Replace base64 representation on element [xmlName=inputMessage]
| DEBUG main org.jboss.ws.extensions.xop.jaxrpc.XOPMarshallerImpl - serialize: [xmlName=attachment]
| DEBUG main org.jboss.ws.core.soap.attachment.CIDGenerator - generateFromName: attachment-37b4f42c-7f38-43b1-b905-9e5d3a3b08c8(a)ws.jboss.org
| DEBUG main org.jboss.ws.extensions.xop.jaxrpc.XOPMarshallerImpl - Created attachment part attachment-37b4f42c-7f38-43b1-b905-9e5d3a3b08c8(a)ws.jboss.org, with content-type application/octet-stream
| DEBUG main org.jboss.ws.extensions.xop.XOPContext - Restored xop:Include element on [xmlName=attachment]
| DEBUG main org.jboss.ws.core.soap.SOAPMessageUnMarshaller - getMimeHeaders from: {X-Powered-By=[Servlet 2.4; JBoss-4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)/Tomcat-5.5], ResponseCodeMessage=OK, http.basic.password=mypassword, Date=[Tue, 26 Jun 2007 13:23:19 GMT], http.basic.username=myusername, Content-Type=[text/xml;charset=UTF-8], Server=[Apache-Coyote/1.1], HEADER={SOAPAction="", Content-Type=text/xml; charset=UTF-8}, Transfer-Encoding=[chunked], NoThrowOnError=true, ResponseCode=200}
| DEBUG main org.jboss.ws.core.soap.MessageFactoryImpl - createMessage: [contentType=text/xml; charset=UTF-8]
|
Instead If I disable WS-Security the Content-Type is correct (and type too)
| ...
| DEBUG main org.jboss.remoting.MicroRemoteClientInvoker - org.jboss.remoting.transport.http.HTTPClientInvoker@82751 connected
| DEBUG main org.jboss.ws.core.client.RemotingConnectionImpl - Remoting metadata: {http.basic.password=mypassword, http.basic.username=myusername, HEADER={SOAPAction="", Content-Type=multipart/related; type="application/xop+xml"; start="<rootpart(a)ws.jboss.org>";
|
| start-info="text/xml";
|
| boundary="----=_Part_0_7896086.1182865340817"}, NoThrowOnError=true}
| DEBUG main org.jboss.remoting.transport.http.HTTPClientInvoker - Setting request header with SOAPAction : ""
| DEBUG main org.jboss.remoting.transport.http.HTTPClientInvoker - Setting request header with Content-Type : multipart/related; type="application/xop+xml"; start="<rootpart(a)ws.jboss.org>";
|
| start-info="text/xml";
|
| boundary="----=_Part_0_7896086.1182865340817"
| DEBUG main org.jboss.ws.core.soap.SOAPMessageUnMarshaller - getMimeHeaders from: {Connection=[close], X-Powered-By=[Servlet 2.4; JBoss-4.2.0.GA (build: SVNTag=JBoss_4_2_0_GA date=200705111440)/Tomcat-5.5], ResponseCodeMessage=Internal Server Error, http.basic.password=mypassword, Date=[Tue, 26 Jun 2007 13:42:21 GMT], http.basic.username=myusername, Content-Type=[text/xml;charset=UTF-8], Server=[Apache-Coyote/1.1], HEADER={SOAPAction="", Content-Type=multipart/related; type="application/xop+xml"; start="<rootpart(a)ws.jboss.org>";
|
| start-info="text/xml";
|
| boundary="----=_Part_0_7896086.1182865340817"}, Transfer-Encoding=[chunked], NoThrowOnError=true, ResponseCode=500}
| DEBUG main org.jboss.ws.core.soap.MessageFactoryImpl - createMessage: [contentType=text/xml; charset=UTF-8]
| ...
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057717#4057717
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057717
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by richard_opalka
"davideling" wrote :
| But if I enable WS-Security MTOM doesn't work any more.
| The client doesn't send a multipart related message,
| but inserts the xop:include tag with the attachment reference.
|
| I use JBoss 4.2.0 GA, JDK 1.5.0_12 on Linux 32 bit
|
Hi davideling,
I don't know JBossWS stack very well yet but according to the
attachments you've posted I can see that both MTOM and WSSecurity
handlers when activated create buggy message. Probably MTOM handler is
the first one in the handler chain and it created SOAP message with
attachment and set message type to MULTIPART/RELATED, but next
handler in the chain, i.e. WSSecurity handler, changed message type from
MULTIPART/RELATED to simple SOAP message.
But I'm just guessing. What about debugging JBossWS source code? Did
you try it?
Rio
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057698#4057698
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057698
17 years, 6 months
[JBossWS] - javax.naming.NameNotFoundException: service not bound
by patel_123
hi
i am trying to access web services using JNDI lookup.I am using JBoss app server.
this is my client code snippet
ctx=new InitialContext();
//customerSessionRemote remote=(customerSessionRemote)ctx.lookup("customer/remote");
Service service=(Service)ctx.lookup("java:comp/env/service/CustomerRegisteration");
try {
EndpointInterface port = (EndpointInterface)service.getPort(EndpointInterface.class);
String user=port.validateUser(getUserName(), getPassword());
System.out.println(user);
} catch (ServiceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
but i am getting following error,
javax.naming.NameNotFoundException: service not bound
17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
17:55:56,468 ERROR [STDERR] at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
17:55:56,468 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:625)
17:55:56,484 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:716)
17:55:56,484 ERROR [STDERR] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:587)
17:55:56,484 ERROR [STDERR] at javax.naming.InitialContext.lookup(InitialContext.java:351)
17:55:56,484 ERROR [STDERR] at client.UserBean.loginUser(UserBean.java:125)
17:55:56,484 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
17:55:56,484 ERROR [STDERR] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
17:55:56,484 ERROR [STDERR] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
17:55:56,484 ERROR [STDERR] at java.lang.reflect.Method.invoke(Method.java:585)
17:55:56,484 ERROR [STDERR] at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:126)
17:55:56,484 ERROR [STDERR] at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:72)
17:55:56,484 ERROR [STDERR] at javax.faces.component.UICommand.broadcast(UICommand.java:312)
17:55:56,484 ERROR [STDERR] at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:267)
17:55:56,484 ERROR [STDERR] at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:381)
17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:75)
17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:200)
17:55:56,484 ERROR [STDERR] at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:90)
17:55:56,484 ERROR [STDERR] at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:175)
17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:74)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
17:55:56,484 ERROR [STDERR] at org.jboss.web.tomcat.tc5.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:156)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
17:55:56,484 ERROR [STDERR] at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
17:55:56,484 ERROR [STDERR] at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
17:55:56,484 ERROR [STDERR] at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:664)
17:55:56,484 ERROR [STDERR] at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
17:55:56,484 ERROR [STDERR] at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
17:55:56,484 ERROR [STDERR] at java.lang.Thread.run(Thread.java:595)
please help me in resolving this
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057692#4057692
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057692
17 years, 6 months
[JBossWS] - Re: MTOM + WS Security = problem
by davideling
This time I'm trying a simpler example
MTOM/WS-Security onl with username and password
In my service client,
if I comment out
// ((StubExt) port).setConfigName("Standard WSSecurity Client");
I get MTOM work correctly
| POST /servizioJBossWSSEAttachment/ServizioWSSEAttachment?datatype=JBossWSMessage HTTP/1.1
| Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk
| SOAPAction: ""
| Content-Type: multipart/related; type="application/xop+xml"; start="<rootpart(a)ws.jboss.org>";
| start-info="text/xml";
| boundary="----=_Part_0_31571602.1182853646985"
| JBoss-Remoting-Version: 22
| User-Agent: JBossRemoting - 2.2.0 SP4 (Bluto)
| Host: localhost:8181
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| Connection: keep-alive
| Content-Length: 453280
|
|
| ------=_Part_0_31571602.1182853646985
| Content-Type: application/xop+xml; type="text/xml"
| Content-Transfer-Encoding: 8bit
| Content-ID: <rootpart(a)ws.jboss.org>
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'><env:Header></env:Header><env:Body><ns1:inputMessage xmlns:ns1="http://www.tai.it/ServizioWSSEAttachment"><attachment><xop:Include xmlns:xop="http://www.w3.org/2004/08/xop/include" href="cid:attachment-6707b7bd-51d9-4d4f-b133-f0a4774a2874@ws.jboss.org"/></attachment><name>Davide</name><surname>Ling</surname></ns1:inputMessage></env:Body></env:Envelope>
| ------=_Part_0_31571602.1182853646985
| Content-Type: application/octet-stream
| Content-Transfer-Encoding: binary
| Content-Id: <attachment-6707b7bd-51d9-4d4f-b133-f0a4774a2874(a)ws.jboss.org>
|
| %PDF-1.4
| blablabla...
|
But if I enable WS-Security MTOM doesn't work any more.
The client doesn't send a multipart related message,
but inserts the xop:include tag with the attachment reference.
I use JBoss 4.2.0 GA, JDK 1.5.0_12 on Linux 32 bit
| POST /servizioJBossWSSEAttachment/ServizioWSSEAttachment?datatype=JBossWSMessage HTTP/1.1
| Authorization: Basic bXl1c2VybmFtZTpteXBhc3N3b3Jk
| SOAPAction: ""
| Content-Type: text/xml; charset=UTF-8
| JBoss-Remoting-Version: 22
| User-Agent: JBossRemoting - 2.2.0 SP4 (Bluto)
| Host: localhost:8181
| Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
| Connection: keep-alive
| Content-Length: 828
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header>
| <wsse:Security env:mustUnderstand='1' ... >
| <wsse:UsernameToken wsu:Id='token-1-1182854743065-9708927'>
| <wsse:Username>myusername</wsse:Username>
| <wsse:Password>mypassword</wsse:Password>
| </wsse:UsernameToken></wsse:Security>
| </env:Header>
| <env:Body>
| <ns1:inputMessage xmlns:ns1='http://www.tai.it/ServizioWSSEAttachment'>
| <attachment>
| <xop:Include href='cid:attachment-f4e31927-67ed-4162-8a0e-86e53e96b316@ws.jboss.org' xmlns:xop='http://www.w3.org/2004/08/xop/include'/>
| </attachment>
| <name>Davide</name>
| <surname>Ling</surname>
| </ns1:inputMessage>
| </env:Body>
| </env:Envelope>
|
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4057646#4057646
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4057646
17 years, 6 months