[JBoss Web Services Users] - Re: how to use catalog files in jbossws?
by smartz
The stacktrace I am getting while creating the service client (SimpleServiceService.getSimpleServiceBinding()) is:
| java.lang.IllegalArgumentException: Cannot resolve imported resource: http://127.0.0.1:9090/SimpleService/Schema
| org.jboss.ws.tools.wsdl.WSDLLocatorImpl.getImportInputSource(WSDLLocatorImpl.java:141)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:779)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseSchema(JBossWSDLReaderImpl.java:659)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseTypes(JBossWSDLReaderImpl.java:620)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.parseDefinitions(JBossWSDLReaderImpl.java:332)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2293)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2257)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2310)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2331)
| org.jboss.ws.tools.wsdl.JBossWSDLReaderImpl.readWSDL(JBossWSDLReaderImpl.java:2363)
| org.jboss.ws.tools.wsdl.WSDLDefinitionsFactory.parse(WSDLDefinitionsFactory.java:127)
| org.jboss.ws.metadata.umdm.ServiceMetaData.getWsdlDefinitions(ServiceMetaData.java:295)
| org.jboss.ws.metadata.builder.jaxws.JAXWSClientMetaDataBuilder.buildMetaData(JAXWSClientMetaDataBuilder.java:86)
| org.jboss.ws.core.jaxws.spi.ServiceDelegateImpl.<init>(ServiceDelegateImpl.java:140)
| org.jboss.ws.core.jaxws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:64)
| javax.xml.ws.Service.<init>(Service.java:81)
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258771#4258771
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258771
15 years, 2 months
[JBoss Web Services Users] - Soap Attachment causes OutOfMemoryError
by s3filho
Hello Everyone,
I am building a Web Services that will receive a file attachment in its message.
I used the DataHandler classe and the specified annotations (@XmlAttachmentRef) and it worked prety fine.
The problem is that when the file to be transmited is really big (more than 100MB, for example) the Client throws an
java.lang.OutOfMemoryError, and I belive it does that before even start sending the message.
My Client code is:
| SignerService service = new SignerService();
| Signer signer = service.getSignerPort();
|
| BindingProvider bp = (BindingProvider)signer;
| Binding binding = bp.getBinding();
| ((SOAPBinding)binding).setMTOMEnabled(true);
|
| String path = "..."; //My file path
|
| MyDocument doc = new MyDocument();
| FileDataSource dataSource = new FileDataSource(path);
| doc.setDataHandler(new DataHandler(dataSource));
|
| signer.sendDoc(doc);
|
Where MyDocument is:
| @XmlAccessorType(XmlAccessType.FIELD)
| @XmlType(name = "myDocument", propOrder = {
| "dataHandler"
| })
| public class MyDocument {
|
| @XmlElement(type = String.class)
| @XmlAttachmentRef
| protected DataHandler dataHandler;
|
| public DataHandler getDataHandler() {
| return dataHandler;
| }
| public void setDataHandler(DataHandler value) {
| this.dataHandler = value;
| }
| }
|
The stack trace is:
| Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
| at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:95)
| at sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
| at javax.activation.DataHandler.writeTo(DataHandler.java:308)
| at com.sun.xml.ws.message.DataHandlerAttachment.writeTo(DataHandlerAttachment.java:110)
| at com.sun.xml.ws.encoding.MtomCodec.writeAttachments(MtomCodec.java:216)
| at com.sun.xml.ws.encoding.MtomCodec.encode(MtomCodec.java:167)
| at com.sun.xml.ws.encoding.SOAPBindingCodec.encode(SOAPBindingCodec.java:258)
| at com.sun.xml.ws.transport.http.client.HttpTransportPipe.process(HttpTransportPipe.java:142)
| at com.sun.xml.ws.transport.http.client.HttpTransportPipe.processRequest(HttpTransportPipe.java:86)
| at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:595)
| at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:554)
| at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:539)
| at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:436)
| at com.sun.xml.ws.client.Stub.process(Stub.java:248)
| at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:135)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:109)
| at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:89)
| at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:118)
| at $Proxy29.sendDoc(Unknown Source)
| ...
|
Increasing the Java heap space of Client (to 256MB) does resolve the problem for that file but if I try sending a bigger file
(500MB) the Error comes back. Since I can't limit a file size to my system, increasing the heap space is only a workaround.
It seems that the whole file is being loaded into the memory heap and I though DataHandler class and MTMO property were to address this memory problem, by using cache and flushing routines.
Is there anyway to assure that my file will be sent regardless of its size?
Thank you very much
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258467#4258467
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258467
15 years, 2 months
[JBoss Web Services Users] - How do I catch a user define exception on the client (SOAP/J
by newmanw10
Seems like I am following the spec correctly and JAX-RPC is generating the exception class correctly (I think), but I still cannot get this to work. I am wondering if there is something configuration wise that I need to setup in JBoss to get the correct exception back on the client side.
I have a user defined exception:
| <xsd:element name="TestExceptionElement" type="xsd:string"/>
|
| <message name="TestException">
| <part name="message" type="TestExceptionElement"/>
| </message>
| .
| .
| <operation name="throwTestException">
| <input message="tns:throwTestException_request"/>
| <output message="tns:throwTestException_response"/>
| <fault name="TestException" message="tns:TestException"/>
| </operation>
|
This generates the following code for the exception:
| public class TestException extends java.lang.Exception {
| private java.lang.String message;
|
| public TestException(java.lang.String message) {
| super(message);
| this.message = message;
| }
|
| public String getMessage() {
| return message;
| }
| }
|
When I throw this exception on the server side things look ok. However on the client side I catch a SOAPFaultException instead of my TestException. Has anyone successfully defined an exception and caught that exception on the client side?
Thanks,
Billy
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258421#4258421
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258421
15 years, 2 months