[JBossWS] - SWA / MTOM attachments
by sirigiris
Hi All,
I've deployed the samples provided by jbossws 1.2.0 on Jboss4.0.4GA and while trying to execute the SWA example, I'm getting the following exception. I came to know through forums that I need to enable MTOM endpoint. The MTOM service is also deployed on the server. Now to get the attachments example working what should I do?
- Call invocation failed with unkown Exception
org.jboss.ws.binding.BindingException: Mime type text/xml not allowed for parameter mimepart allowed types are [application/xml]
at org.jboss.ws.binding.soap.SOAPBindingProvider.createAttachmentPart(SOAPBindingProvider.java:605)
at org.jboss.ws.binding.soap.SOAPBindingProvider.bindRequestMessage(SOAPBindingProvider.java:118)
at org.jboss.ws.binding.soap.SOAP11BindingProvider.bindRequestMessage(SOAP11BindingProvider.java:65)
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:645)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
at ws.jboss.org.samples.swa.AttachTest1.main(AttachTest1.java:108)
Exception in thread "main" java.rmi.RemoteException: Call invocation failed: Mime type text/xml not allowed for parameter mimepart allowed types are [application/xml]; nested exception is:
org.jboss.ws.binding.BindingException: Mime type text/xml not allowed for parameter mimepart allowed types are [application/xml]
at org.jboss.ws.jaxrpc.CallImpl.invokeInternal(CallImpl.java:718)
at org.jboss.ws.jaxrpc.CallImpl.invoke(CallImpl.java:404)
at ws.jboss.org.samples.swa.AttachTest1.main(AttachTest1.java:108)
As of now I'm running a standalone java program. Please find the code attached. Help is highly appreciated.
ServiceFactory factory = ServiceFactory.newInstance();
Service service = factory.createService(SERVICE_NAME);
Call call = service.createCall();
call.setOperationName(new QName(TARGET_NAMESPACE, rpcMethodName));
call.addParameter("message", new QName(Constants.NS_SCHEMA_XSD, "string"), ParameterMode.IN);
if (contentType.equals("application/xml"))
call.addParameter("mimepart", Constants.TYPE_MIME_APPLICATION_XML, DataHandler.class, ParameterMode.IN);
call.setReturnType(new QName(Constants.NS_SCHEMA_XSD, "string"));
call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS); call.setTargetEndpointAddress(TARGET_ENDPOINT_ADDRESS);
URL temp = new File("resources/jaxrpc/samples/swa/attach.xml").toURL();
String strTempURL = temp.toString();
strTempURL = strTempURL.substring(strTempURL.lastIndexOf("/"),strTempURL.length());
URL url = new URL("http","10.2.154.75",8080,strTempURL);
String value = (String)call.invoke(new Object[] {"application/xml" , new DataHandler(url)});
System.out.println("Value ::"+ value);
Regards,
Sreedhar
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4049033#4049033
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4049033
17 years, 7 months
[JBossWS] - Re: JBossWS 1.2.0CR2 with JEMS 1.2 (and JBoss 4.0.5) fails
by akhil.bhaskar
A similar issue I'm having, but this involves an EJB3 SLSB exposed as a webservice. I'm getting an error when deploying my EJB (built using Maven2 as an 'ejb' jar)
| JBoss 4.0.5.GA
| JBossWS 1.2.1.GA (build=200704161533)
| JBoss EJB 3.0 RC9 Patch 1
|
|
| my EJB:
|
| | @Stateless
| | @WebService
| | public class DnCommitmentBean extends BaseServiceBean implements DnCommitment
| | {
| |
| | @WebMethod
| | public DnCommitmentVo[] getDnCommitmentList(byte[] authenticationInfo) throws FhlbServiceException
| |
|
|
| | 12:31:19,986 DEBUG [JAXWSWebServiceMetaDataBuilder] JAXBContext [types=[class com.fhlb.service.dncommitment.business.jaxws.GetDnCommitmentList, class com.fhlb.service.dncommitment.business.jaxws.GetDnCommitmentListResponse, class com.fhlb.service.dncommitment.business.jaxws.FhlbServiceExceptionBean, class com.fhlb.service.dncommitment.business.jaxws.SaveDnCommitment, class com.fhlb.service.dncommitment.business.jaxws.SaveDnCommitmentResponse, class com.fhlb.service.dncommitment.business.jaxws.FhlbServiceExceptionBean],tn...
| | 12:31:20,659 DEBUG [WSDLDefinitionsFactory] parse: file:/Applications/jboss-4.0.5.GA/server/default/tmp/jbossws/DnCommitmentBeanService20342.wsdl
| | 12:31:20,825 DEBUG [JavaToXSD] Load schema: http://business.dncommitment.service.fhlb.com/=file:/Applications/jboss-4...
| | 12:31:20,825 DEBUG [JBossWSEntityResolver] resolveEntity: [pub=null,sysid=file:/Applications/jboss-4.0.5.GA/server/default/tmp/jbossws/JBossWS_business.dncommitment.service.fhlb.com_20343.xsd]
| | 12:31:20,831 DEBUG [JBossWSEntityResolver] resolveEntity: [pub=http://schemas.xmlsoap.org/soap/encoding/,sysid=null]
| | 12:31:20,861 DEBUG [EndpointMetaData] Create new config [name=Standard Endpoint,file=META-INF/standard-jaxws-endpoint-config.xml]
| | 12:31:20,864 DEBUG [JBossWSConfigFactory] getConfig: [name=Standard Endpoint,url=META-INF/standard-jaxws-endpoint-config.xml]
| | 12:31:20,865 DEBUG [JBossWSConfigFactory] parse: file:/Applications/jboss-4.0.5.GA/server/default/deploy/jbossws.sar/META-INF/standard-jaxws-endpoint-config.xml
| | 12:31:20,866 ERROR [ServiceEndpointDeployer] Cannot create service endpoint
| | org.jboss.xb.binding.JBossXBRuntimeException: Failed to create a new SAX parser
| | at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:100)
| | at org.jboss.ws.metadata.config.JBossWSConfigFactory.parse(JBossWSConfigFactory.java:76)
| | at org.jboss.ws.metadata.config.JBossWSConfigFactory.getConfig(JBossWSConfigFactory.java:134)
| | at org.jboss.ws.metadata.umdm.EndpointMetaData.initEndpointConfig(EndpointMetaData.java:683)
| | at org.jboss.ws.metadata.builder.jaxws.JAXWSWebServiceMetaDataBuilder.buildWebServiceMetaData(JAXWSWebServiceMetaDataBuilder.java:152)
| | at org.jboss.ws.metadata.builder.jaxws.JAXWSServerMetaDataBuilder.setupProviderOrWebService(JAXWSServerMetaDataBuilder.java:49)
| | at org.jboss.ws.metadata.builder.jaxws.JAXWSMetaDataBuilderEJB3.buildMetaData(JAXWSMetaDataBuilderEJB3.java:77)
| | at org.jboss.ws.core.server.ServiceEndpointDeployer.create(ServiceEndpointDeployer.java:92)
| | at org.jboss.ws.integration.jboss42.DeployerInterceptor.createServiceEndpoint(DeployerInterceptor.java:127)
| | at org.jboss.ws.integration.jboss42.DeployerInterceptorEJB.createServiceEndpoint(DeployerInterceptorEJB.java:43)
| | at org.jboss.ws.integration.jboss42.DeployerInterceptor.create(DeployerInterceptor.java:78)
| | at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.create(SubDeployerInterceptorSupport.java:180)
| | at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:91)
| | 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 $Proxy29.create(Unknown Source)
| | at org.jboss.deployment.MainDeployer.create(MainDeployer.java:969)
| | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:818)
| | at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
| | at sun.reflect.GeneratedMethodAccessor19.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.startService(AbstractDeploymentScanner.java:336)
| | 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 $Proxy4.start(Unknown Source)
| | at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
| | 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 org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
| | 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.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 $Proxy5.deploy(Unknown Source)
| | at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
| | at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
| | at org.jboss.Main.boot(Main.java:200)
| | at org.jboss.Main$1.run(Main.java:490)
| | at java.lang.Thread.run(Thread.java:613)
| | Caused by: org.jboss.xb.binding.JBossXBException: Failed to create a new SAX parser
| | at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:96)
| | at org.jboss.xb.binding.UnmarshallerImpl.<init>(UnmarshallerImpl.java:55)
| | at org.jboss.xb.binding.UnmarshallerFactory$UnmarshallerFactoryImpl.newUnmarshaller(UnmarshallerFactory.java:96)
| | ... 84 more
| | Caused by: javax.xml.parsers.ParserConfigurationException: Feature 'http://apache.org/xml/features/xinclude' is not recognized.
| | at org.apache.xerces.jaxp.SAXParserFactoryImpl.newSAXParser(Unknown Source)
| | at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.<init>(SaxJBossXBParser.java:92)
| | ... 86 more
| |
|
| I had some other annotations, but cleared them out to test out the most simple implementation. I have used this in previous versions (I'm pretty sure 4.0.4) and have had success with this. The WSDL is generated - I see it in the ${INSTANCE}/tmp/jbossws/ directory, but the XSD is not in there. What am I missing?
|
| Thanks
| -Akhil
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048745#4048745
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048745
17 years, 7 months
[JBossWS] - how to set http header properties
by jcstaff
Is there a way for a client to set the properties used in the HTTP client header? I am using jboss 1.0.4 as well as testing with 1.2.1GA.
We are having a problem with jbossws hanging in between calls to a .NET web service. The problem occurs on or after the second call and clears/completes after a lengthy timeout (and then re-occurs on a subsequent call). The actual call takes ~28secs of processing to complete. The timeouts/re-tries automatically happen (and complete) in about ~90-120secs.
The.NET server sees no activity during the hang, we have no problems calling other jbossws services and we have no trouble calling the same .NET service from Axis.
Our deployed code runs in a JBoss 4.0.5 MDB, but we are able to re-create the problem with a stripped down Java SE JUnit environment.
We'd like to try a work-around by eliminating the "Connection: keep-alive" property from being automatically added in the SOAP call. We are hoping that this will successfully reset the connection between client/server calls. I cannot locate a way to specify HTTP Header properties.
thanks,
jim
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4048490#4048490
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4048490
17 years, 7 months