[jboss-user] [JBossWS] - Re: Web Service Client : Could not transmit message

mmoura do-not-reply at jboss.com
Fri Jun 29 10:35:29 EDT 2007


Hi,

I'm getting the same error in JBoss 4.0.5. Have you ever got to solve this problem?

In a few words I'm trying to consume a web service hosted in what looks like to be a .NET server from a client running in JBoss 4.0.5.

The same client running from a Java stand-alone application runs fine, with no transport errors. I'm able to receive a SOAP response with no problems. So the issue resides in the client web app. By the way, both the stand-alone and the web apps use the same code to build and send the soap messages. The only difference is that the web client used JNDI to retrieve the service interface.

The client sends two different types of message to the server. One of them is small and runs fine. The other one sends a byte array and is quite big. That's the one that fails, returning a HTTP 400 - Bad request.

Looking at the SOAP request message I could see that it was not being well formated by the JAX-RPC client. Please look at the bold Binario attribute below (it should be a Hex coded string - again, it works fine outside of JBoss - I'm not posting the correct message here):


  | <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
  |     <env:Header>
  |     </env:Header>
  |     <env:Body>
  |         <ns1:RecebeLista xmlns:ns1="http://tempuri.org/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  |             <ns_mensagemLista:mensagemLista xmlns:ns_mensagemLista="http://www.atfla.serpro">
  |                 <ns_AC:AC xmlns:ns_AC="http://www.atfla.serpro/MensagemACLista.xsd">
  |                     <ns_AC:Nome>CN=AC CertiSign SRF, OU=Secretaria da Receita Federal - SRF, O=ICP-Brasil, C=BR</ns_AC:Nome>
  |                     <ns_AC:Chave>da2bac79587b4129976d42d04c29aec89fc972d0</ns_AC:Chave>
  |                     <ns_AC:Data>2007-06-28-03:00</ns_AC:Data>
  |                     <ns_AC:Hora>10:55:48.000-03:00</ns_AC:Hora>
  |                 </ns_AC:AC>
  |                 <ns_LCR:LCR xmlns:ns_LCR="http://www.atfla.serpro/MensagemACLista.xsd" Binario="[B at 60232c">
  |                     <ns_LCR:Tamanho>1164.0</ns_LCR:Tamanho>
  |                     <ns_LCR:Delta>0.0</ns_LCR:Delta>
  |                 </ns_LCR:LCR>
  |             </ns_mensagemLista:mensagemLista>
  |         </ns1:RecebeLista>
  |     </env:Body>
  | </env:Envelope>
  | 

Here's the stack trace (similar to the one posted above):


  | br.com.certisign.ws.receita.client.exceptions.ServiceFailureException: br.com.certisign.ws.receita.client.exceptions.WSException: java.rmi.RemoteException: Call invocation failed: Could not transmit message; nested exception is: 
  | 	javax.xml.soap.SOAPException: Could not transmit message
  | 	at br.com.certisign.ws.receita.client.control.ReceitaWSClientServlet.sendLCR(ReceitaWSClientServlet.java:298)
  | 	at br.com.certisign.ws.receita.client.control.ReceitaWSClientServlet.init(ReceitaWSClientServlet.java:179)
  | 	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1105)
  | 	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:932)
  | 	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:3951)
  | 	at org.apache.catalina.core.StandardContext.start(StandardContext.java:4225)
  | 	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
  | 	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
  | 	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
  | 	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 org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
  | 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
  | 	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 org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
  | 	at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
  | 	at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
  | 	at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
  | 	at org.jboss.web.WebModule.startModule(WebModule.java:83)
  | 	at org.jboss.web.WebModule.startService(WebModule.java:61)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
  | 	at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
  | 	at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
  | 	at $Proxy0.start(Unknown Source)
  | 	at org.jboss.system.ServiceController.start(ServiceController.java:417)
  | 	at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy38.start(Unknown Source)
  | 	at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
  | 	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 org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
  | 	at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
  | 	at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
  | 	at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
  | 	at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy39.start(Unknown Source)
  | 	at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
  | 	at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
  | 	at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
  | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  | 	at java.lang.reflect.Method.invoke(Method.java:585)
  | 	at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
  | 	at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
  | 	at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
  | 	at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
  | 	at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
  | 	at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
  | 	at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
  | 	at $Proxy8.deploy(Unknown Source)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
  | 	at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.loop(AbstractDeploymentScanner.java:274)
  | 	at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.run(AbstractDeploymentScanner.java:225)
  | Caused by: br.com.certisign.ws.receita.client.exceptions.WSException: java.rmi.RemoteException: Call invocation failed: Could not transmit message; nested exception is: 
  | 	javax.xml.soap.SOAPException: Could not transmit message
  | 	at br.com.certisign.ws.receita.client.ws.ReceitaWSClient.sendMessageACLista(ReceitaWSClient.java:32)
  | 	at br.com.certisign.ws.receita.client.control.ReceitaWSClientServlet.sendLCR(ReceitaWSClientServlet.java:284)
  | 	... 92 more
  | Caused by: java.rmi.RemoteException: Call invocation failed: Could not transmit message; nested exception is: 
  | 	javax.xml.soap.SOAPException: Could not transmit message
  | 	at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:718)
  | 	at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
  | 	at org.jboss.ws.jaxrpc.CallProxy.invoke(CallProxy.java:148)
  | 	at $Proxy55.recebeLista(Unknown Source)
  | 	at br.com.certisign.ws.receita.client.ws.ReceitaWSClient.sendMessageACLista(ReceitaWSClient.java:25)
  | 	... 93 more
  | Caused by: javax.xml.soap.SOAPException: Could not transmit message
  | 	at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:204)
  | 	at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:687)
  | 	... 97 more
  | Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker.
  | 	at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:201)
  | 	at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(HTTPClientInvoker.java:81)
  | 	at org.jboss.remoting.RemoteClientInvoker.invoke(RemoteClientInvoker.java:143)
  | 	at org.jboss.remoting.Client.invoke(Client.java:525)
  | 	at org.jboss.remoting.Client.invoke(Client.java:488)
  | 	at org.jboss.ws.soap.SOAPConnectionImpl.call(SOAPConnectionImpl.java:189)
  | 	... 98 more
  | Caused by: org.jboss.ws.WSException: Invalid HTTP server response [400] - Bad Request
  | 	at org.jboss.ws.binding.soap.SOAPMessageUnMarshaller.read(SOAPMessageUnMarshaller.java:73)
  | 	at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(HTTPClientInvoker.java:175)
  | 	... 103 more
  | 


My web.xml follows:


<?xml version = '1.0'?>

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4">
	<display-name>ReceitaWSClientServlet</display-name>
	
	    <servlet-name>ReceitaWSClientServlet</servlet-name>
	    <servlet-class>br.com.certisign.ws.receita.client.control.ReceitaWSClientServlet</servlet-class>
		<init-param>
			<param-name>propertiesFile</param-name>
			<param-value>WEB-INF/config/client.properties</param-value>
		</init-param>
		<init-param>
			<param-name>javax.xml.soap.MessageFactory</param-name>
			<param-value>com.sun.xml.messaging.saaj.soap.ver1_1.SOAPMessageFactory1_1Impl</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
  	 
	<servlet-mapping>
		<servlet-name>ReceitaWSClientServlet</servlet-name>
	    <url-pattern>/ReceitaWSClientServlet/*</url-pattern>
	</servlet-mapping>

	<session-config>
		<session-timeout>30</session-timeout>
	</session-config>
  
	<welcome-file-list>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>index.html</welcome-file>
		<welcome-file>index.htm</welcome-file>
	</welcome-file-list>

	<service-ref>
		<service-ref-name>services/ReceitaWSServer</service-ref-name>
		<service-interface>br.com.certisign.ws.receita.lcr.LCRReceber</service-interface>
		<wsdl-file>WEB-INF/lcrreceber.wsdl</wsdl-file>
		<jaxrpc-mapping-file>WEB-INF/jaxrpc-mapping.xml</jaxrpc-mapping-file>
		<port-component-ref>
			<service-endpoint-interface>
				br.com.certisign.ws.receita.lcr.LCRReceberSoap
			</service-endpoint-interface>
		</port-component-ref>
	</service-ref>

</web-app>

  | 
  | 
  | I tried to deploy the same app in JBoss 4.2.0 and got an exception:
  | 
  |   | org.jboss.deployment.DeploymentException: Failed to parse WEB-INF/web.xml; - nested throwable: (org.jboss.kernel.spi.registry.KernelRegistryEntryNotFoundException: Entry not found with name ServiceRefHandler)
  |   | 
  | 
  | I did not manage to configure the right Handler in the web.xml file. I tried something like the code below but it did not work:
  | 
  |   | <handler>
  |   | 	<handler-name>Service Ref Handler</handler-name>
  |   | 	<handler-class>org.jboss.ws.core.jaxws.client.ServiceRefHandlerJAXWS</handler-class>
  |   | </handler>
  |   | 
  | 
  | 
  | I'd like to have the app running in 4.0.5.
  | 
  | I can send you more information if necessary.
  | 
  | Any help will be greatly appreciated!
  | 
  | Thanks,
  | Marcel
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4059204#4059204

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4059204



More information about the jboss-user mailing list