[JBossWS] - Use of JAX-RPC in JBoss 4.2.3
by glen_s
I have a web app running on JBoss AS 4.2.3, default server configuration. I need to write a web service client that can talk to a soap encoded web service. I know that JBossWS does not support soap encoding, so I am struggling to find a workaround.
>From my research I'm lead to believe that JAX-RPC is the one library that does support soap encoding, so have tried using a (JWSDP) wscompile produced client in JBoss 4.2.3.
When I include the JWSDP compatible JARs[1] in the lib directory of my EAR, and my client code calls into the wscompile produced stub, the stub calls into (JWSDP) StreamingSender class and ultimately throws a ClassCastException:
| 1. java.lang.ClassCastException: org.jboss.ws.core.soap.SOAPMessageImpl
| 2. at com.sun.xml.rpc.client.StubBase._postSendingHook(StubBase.java:231)
| 3. at com.sun.xml.rpc.client.StreamingSender._send(StreamingSender.java:324)
|
How can I make JAX-RPC work on JBoss 4.2.3? Is it possible to manipulate the set of JARs from JWSDP that I am including[1] in my web app to make JAX-RPC (supporting soap encoding) work on JBoss 4.2.3?
If no-one can offer the silver-bullet answer as to how to make JAX-RPC work on JBoss 4.2.3, maybe one of the following ideas will ring true with someone who can at least point me in the right direction to pursue.
Might I:
* *Somehow* configure JBossWS to "play nice" with JAX-RPC so that JAX-RPC can be used as my web service library
| * Change the class loader configuration to allow the JAX-RPC (and associated JWSDP) JAR files to work in my web app
| * Remove the JBossWS module from the default configuration, and somehow just use JAX-RPC JARs from my web app rather than being loaded as a JBoss service (although I have concerns that the JAX-RPC dependant JARs from JWSDP would still conflict with other XML related JARs in JBoss AS)
| * Switch to some other web service client library that supports soap encoding (that I'm not aware of) that can be configured to run on JBoss AS 4.2.3
|
| I am relatively new to JBoss, so if one of the above ideas strikes you as ludicrous (just doesn't make sense), I apologize.
|
| Thank you,
| Glen Scott
|
| [1]The jars from JWSDP 1.6 I included in my EAR's lib are: activation.jar, commons-beanutils.jar, commons-collections.jar, commons-digester.jar, commons-logging.jar, dom.jar, jaas.jar, jax-qname.jar, jaxp-api.jar, jaxrpc-api.jar, jaxrpc-impl.jar, jaxrpc-spi.jar, mail.jar, namespace.jar, relaxngDatatype.jar, saaj-api.jar, saaj-impl.jar, sax.jar, xercesImpl.jar, xsdlib.jar
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213909#4213909
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213909
15 years, 7 months
[JBossWS] - Could not find MessageBodyWriter for class java.util.List an
by jej2003
Has anyone had any experience with getting the java.util.List multipart support working as described at http://bill.burkecentral.com/2008/10/23/jax-rs-multipart-support-with-res... ?
When running the Client Framework I get the following:
Exception in thread "main" java.lang.RuntimeException: Could not find MessageBodyWriter for class java.util.List and mediaType multipart/mixed
| at org.jboss.resteasy.client.core.MessageBodyParameterMarshaller.getMessageBodyWriter(MessageBodyParameterMarshaller.java:59)
| at org.jboss.resteasy.client.core.MessageBodyParameterMarshaller.buildRequest(MessageBodyParameterMarshaller.java:48)
| at org.jboss.resteasy.client.core.WebRequestIntializer.setHeadersAndRequestBody(WebRequestIntializer.java:43)
| at org.jboss.resteasy.client.core.ClientInvoker.initBaseMethod(ClientInvoker.java:107)
| at org.jboss.resteasy.client.core.ClientInvoker.invoke(ClientInvoker.java:67)
| at org.jboss.resteasy.client.core.ClientProxy.invoke(ClientProxy.java:47)
I see the provider being loaded (or at least what I would assume is the provider)
| ...
| 78 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in provider org.jboss.resteasy.plugins.providers.multipart.ListMultipartReader
| 78 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in provider org.jboss.resteasy.plugins.providers.multipart.MultipartFormDataReader
| 78 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in provider org.jboss.resteasy.plugins.providers.multipart.MapMultipartFormDataReader
| 94 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in providerorg.jboss.resteasy.plugins.providers.multipart.MultipartWriter
| 94 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in providerorg.jboss.resteasy.plugins.providers.multipart.MultipartFormDataWriter
| 94 [main] INFO org.jboss.resteasy.plugins.providers - Adding built in providerorg.jboss.resteasy.plugins.providers.multipart.ListMultipartWriter
| ...
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4213863#4213863
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4213863
15 years, 7 months
[JBossWS] - Webservice problem with base64 data when upgrading to JBoss
by toma25
Hi,
This is a long one du to config files...
I'm running a upgrade from JBoss 4.0.5 to 4.2.3
The system I work with have a legacy webservice. It is based on J2EE webservices 1.1.
It has a SLSB (EJB2) as endpoint.
The WSDL file points out a schema (XSD-file) file for the definition of the parameters to the webservice.
And there is a mapping file which maps to the schema.
The problem:
For starters, the service works in JBoss 4.0.5.
In 4.2.3 it works perfectly fine for except for a attachment element, the base64 data doesn't convert properly into a byte array. Changing it to string works fine, so there is no problem with typos, it just won't convert into a byte array.
Has anyone had a similar problem when upgrading from 4.0.5 to 4.2.3?
If i remove an attachments from the call, it works fine, but if I have one, if fails with:
org.jboss.ws.WSException: org.jboss.ws.core.binding.BindingException: org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to
| parse source: Failed to resolve target property type on org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1f1804d({http://foo/newsws/types}attachment, type={http://foo/newsws/types}AttachmentElementType)
| at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:250)
| at org.jboss.ws.core.soap.XMLContent.transitionTo(XMLContent.java:97)
| at org.jboss.ws.core.soap.SOAPContentElement.transitionTo(SOAPContentElement.java:141)
| at org.jboss.ws.core.soap.SOAPBodyElementDoc.transitionTo(SOAPBodyElementDoc.java:85)
| at org.jboss.ws.core.soap.SOAPContentElement.getObjectValue(SOAPContentElement.java:173)
| at org.jboss.ws.core.EndpointInvocation.transformPayloadValue(EndpointInvocation.java:263)
| at org.jboss.ws.core.EndpointInvocation.getRequestParamValue(EndpointInvocation.java:115)
| at org.jboss.ws.core.EndpointInvocation.getRequestPayload(EndpointInvocation.java:135)
| at org.jboss.ws.core.server.DelegatingInvocation.getArgs(DelegatingInvocation.java:82)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB21.getMBeanInvocation(InvocationHandlerEJB21.java:169)
| at org.jboss.wsf.container.jboss42.InvocationHandlerEJB21.invoke(InvocationHandlerEJB21.java:144)
| at org.jboss.ws.core.server.ServiceEndpointInvoker.invoke(ServiceEndpointInvoker.java:221)
| at org.jboss.wsf.stack.jbws.RequestHandlerImpl.processRequest(RequestHandlerImpl.java:466)
| 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.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:524)
| 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.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:393)
| 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)
| Caused by: org.jboss.ws.core.binding.BindingException: org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to parse source:
| Failed to resolve target property type on org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1369863({http://foo/newsws/t
| ypes}attachment, type={http://foo/newsws/types}AttachmentElementType)
| at org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializer.deserialize(JBossXBDeserializer.java:111)
| at org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializer.deserialize(JBossXBDeserializer.java:62)
| at org.jboss.ws.core.binding.DeserializerSupport.deserialize(DeserializerSupport.java:60)
| at org.jboss.ws.core.soap.XMLContent.unmarshallObjectContents(XMLContent.java:180)
| ... 36 more
| Caused by: org.jboss.ws.core.jaxrpc.binding.jbossxb.UnmarshalException: Failed to parse source: Failed to resolve target property type on or
| g.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1369863({http://foo/newsws/types}attachment, type={http://foo/newsws/types}AttachmentElementType)
| at org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:65)
| at org.jboss.ws.core.jaxrpc.binding.JBossXBDeserializer.deserialize(JBossXBDeserializer.java:103)
| ... 39 more
| Caused by: org.jboss.xb.binding.JBossXBException: Failed to parse source: Failed to resolve target property type on org.jboss.xb.binding.sun
| day.unmarshalling.ElementBinding@1369863({http://foo/newsws/types}attachment, type={http://foo/newsws/types}Attach
| mentElementType)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:179)
| at org.jboss.xb.binding.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:126)
| at org.jboss.ws.core.jaxrpc.binding.jbossxb.JBossXBUnmarshallerImpl.unmarshal(JBossXBUnmarshallerImpl.java:61)
| ... 40 more
| Caused by: org.jboss.ws.WSException: Failed to resolve target property type on org.jboss.xb.binding.sunday.unmarshalling.ElementBinding@1369
| 863({http://foo/newsws/types}attachment, type={http://foo/newsws/types}AttachmentElementType)
| at org.jboss.ws.extensions.xop.jaxrpc.JBossXBContentAdapter.beforeSetParent(JBossXBContentAdapter.java:115)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endElement(SundayContentHandler.java:1005)
| at org.jboss.xb.binding.sunday.unmarshalling.SundayContentHandler.endElement(SundayContentHandler.java:246)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser$DelegatingContentHandler.endElement(SaxJBossXBParser.java:296)
| at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
| at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source)
| at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
| at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
| at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
| at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
| at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
| at org.jboss.xb.binding.parser.sax.SaxJBossXBParser.parse(SaxJBossXBParser.java:175)
| ... 42 more
this is the webservices.xml
<webservice-description>
| <webservice-description-name>FooService</webservice-description-name>
| <wsdl-file>META-INF/wsdl/FooService.wsdl</wsdl-file>
| <jaxrpc-mapping-file>META-INF/FooService-mapping.xml</jaxrpc-mapping-file>
| <port-component>
| <port-component-name>FooService</port-component-name>
| <wsdl-port>FooServicePort</wsdl-port>
| <service-endpoint-interface>com.foo.FooServiceEndpoint</service-endpoint-interface>
| <service-impl-bean>
| <ejb-link>FooServiceBean</ejb-link>
|
| </service-impl-bean>
| </port-component>
| </webservice-description>
>From the foo.xsd
<xs:complexType name="AttachmentElementType">
| <xs:annotation>
| <xs:documentation>Attachment data. When submitting, contains the attachment itself.</xs:documentation>
| </xs:annotation>
| <xs:simpleContent>
| <xs:extension base="xs:base64Binary">
| <xs:attribute name="filename" use="required">
| <xs:annotation>
| <xs:documentation>The filename of the attachment</xs:documentation>
| </xs:annotation>
| </xs:attribute>
| <xs:attribute name="href" type="xs:anyURI" use="optional">
| <xs:annotation>
| <xs:documentation>The URL from which the attachment can be downloaded. Not used when submitting news.</xs:documentation>
| </xs:annotation>
| </xs:attribute>
| <xs:attribute name="mimeType" type="xs:string" use="required">
| <xs:annotation>
| <xs:documentation>The MIME type of the attached file</xs:documentation>
| </xs:annotation>
| </xs:attribute>
| </xs:extension>
| </xs:simpleContent>
| </xs:complexType>
>From FooService-mapping.xml
<java-xml-type-mapping>
| <java-type>foo.MessageElementType</java-type>
| <root-type-qname xmlns:typeNS='http://foo/newsws/types'>typeNS:MessageElementType</root-type-qname>
| <qname-scope>complexType</qname-scope>
| <variable-mapping>
| <java-variable-name>category</java-variable-name>
| <xml-element-name>category</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>type</java-variable-name>
| <xml-element-name>type</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>headline</java-variable-name>
| <xml-element-name>headline</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>body</java-variable-name>
| <xml-element-name>body</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>attachment</java-variable-name>
| <xml-element-name>attachment</xml-element-name>
| </variable-mapping>
| <variable-mapping>
| <java-variable-name>field</java-variable-name>
| <xml-element-name>field</xml-element-name>
| </variable-mapping>
| </java-xml-type-mapping>
And Attachment.java looks like this:
public class AttachmentElementType
| {
|
| protected java.lang.String filename;
|
| protected java.net.URI href;
|
| protected java.lang.String mimeType;
|
| protected byte[] _value;
| public AttachmentElementType(){}
|
| public AttachmentElementType(java.lang.String filename, java.net.URI href, java.lang.String mimeType, byte[] _value){
| this.filename=filename;
| this.href=href;
| this.mimeType=mimeType;
| this._value=_value;
| }
| public java.lang.String getFilename() { return filename ;}
|
| public void setFilename(java.lang.String filename){ this.filename=filename; }
|
| public java.net.URI getHref() { return href ;}
|
| public void setHref(java.net.URI href){ this.href=href; }
|
| public java.lang.String getMimeType() { return mimeType ;}
|
| public void setMimeType(java.lang.String mimeType){ this.mimeType=mimeType; }
|
| public byte[] get_value() { return _value ;}
|
| public void set_value(byte[] _value){ this._value=_value; }
|
| }
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4212824#4212824
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4212824
15 years, 7 months