[JBossWS] - My WS doesn't send any attachment... why?
by cdc08x
Hi all!
I'm using the EJB3.0 spec. with JBoss AS 4.2.2 (and the related JBossWS version inside, of course), in order to create a Web Service using a Stateless Session Bean instead of a Servlet.
I'd like to send an attachment from within a Web Service method.
Here I explain my problem.
I programmed as follows my Stateless Session Bean:
| ...
| @Stateless(name="PortalInfoExchangeServiceEJB")
| @WebService(
| name="PortalInfoExchange",
| serviceName="PortalInfoExchange",
| targetNamespace="http://www.provincia.latina.it/servizi/ws/portal/PortalInfoExchange",
| endpointInterface = "servizi.it.latina.provincia.portal.ws.PortalInfoExchangeWS")
| @Remote(PortalInfoExchangeWS.class)
| public class PortalInfoExchangeBean implements PortalInfoExchangeWS {
| @Resource WebServiceContext context;
| ...
| public String interact(
| String xmlData
| ) throws IllegalArgumentException {
|
| // Start-up
| String pdfFilePath = "/var/www/SOAPprova/prova.pdf";
| ...
| // Attachment
| SOAPMessageContext msgContext = (SOAPMessageContext)context.getMessageContext();
| SOAPMessage soapMessage = msgContext.getMessage();
| DataHandler dh = new DataHandler(new FileDataSource(pdfFilePath));
| AttachmentPart attachment = soapMessage.createAttachmentPart(dh);
|
| soapMessage.addAttachmentPart(attachment);
| ...
| // Return
| return "Ciao " + xQueryResult + "! [ xQuery: \"for $nome in doc('/home/cdc/workspace/LTPortalWS/build/classes/servizi/it/latina/provincia/portal/ws/tmp.xml')/dataWrapper/dati/nome return data($nome)\" ]";
| }
|
But when I call this service from a PHP Client, sniffing the SOAP response packet I see this:
| HTTP/1.1 200 OK
| Server: Apache-Coyote/1.1
| X-Powered-By: Servlet 2.4; JBoss-4.2.2.GA (build: SVNTag=JBoss_4_2_2_GA date=200710221139)/Tomcat-5.5
| Content-Type: text/xml;charset=UTF-8
| Date: Thu, 06 Dec 2007 09:56:13 GMT
| Connection: close
|
| <env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
| <env:Header>
| </env:Header>
| <env:Body>
| <ns2:interactResponse xmlns:ns2="http://www.provincia.latina.it/servizi/ws/portal/PortalInfoExchange">
| <xmlData>Ciao Claudio! [ xQuery: "for $nome in doc('/home/cdc/workspace/LTPortalWS/build/classes/servizi/it/latina/provincia/portal/ws/tmp.xml')/dataWrapper/dati/nome return data($nome)" ]</xmlData>
|
| </ns2:interactResponse>
| </env:Body>
| </env:Envelope>
|
Please, could anyone suggest me why there's no attachment?
Have I got to change somehow manually the WSDL to specify that there will be an attachment?
Did I make something wrong into the code?
I searched a lot around the web, but found nothing...
Any help will be very appreciated!
Claudio Di Ciccio
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110782#4110782
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110782
18 years, 4 months
[JBoss jBPM] - Re: Problem with my jbpm database
by dleerob
I have the a similair problem, where my MySQL connection seems to die with a socket connection error. I am going to try the following:
In hibernate.cfg.xml file, use:
<property name="hibernate.connection.datasource">java:comp/env/jdbc/JbpmDS</property>
| instead of the direct jdbc connection.
In my webapps context.xml which should be found in tomcat\conf\Catalina\localhost\[myappname].xml file, use something like:
<Resource name="jdbc/JbpmDS" auth="Container" type="javax.sql.DataSource"/>
| <ResourceParams name="jdbc/JbpmDS">
| <parameter>
| <name>factory</name>
| <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
| </parameter>
| <parameter>
| <name>maxActive</name>
| <value>100</value>
| </parameter>
| <parameter>
| <name>maxIdle</name>
| <value>30</value>
| </parameter>
| <parameter>
| <name>maxWait</name>
| <value>10000</value>
| </parameter>
| <parameter>
| <name>username</name>
| <value>jbossjbpm</value>
| </parameter>
| <parameter>
| <name>password</name>
| <value>jbossjbpm</value>
| </parameter>
| <parameter>
| <name>driverClassName</name>
| <value>com.mysql.jdbc.Driver</value>
| </parameter>
| <parameter>
| <name>defaultAutoCommit</name>
| <value>true</value>
| </parameter>
| <parameter>
| <name>url</name>
| <value>jdbc:mysql://localhost/jbpm321</value>
| </parameter>
| <parameter>
| <name>removeAbandoned</name>
| <value>true</value>
| </parameter>
| <parameter>
| <name>removeAbandonedTimeout</name>
| <value>60</value>
| </parameter>
| <parameter>
| <name>logAbandoned</name>
| <value>true</value>
| </parameter>
| </ResourceParams>
|
I'm hoping the maxIdle parameter will do the trick.
You could lower the maxIdle value if need be.
Or, you could look at using hibernate.c3p0.timeout property in hibernate.cfg.xml, instead of using the above method, but I think you may then need to go and get some extra hibernate jar files or something.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110775#4110775
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110775
18 years, 4 months
[JBoss AOP] - Re: Maven 2 plugin?
by stale.pedersen@jboss.org
hi, thanks for using the aop plugin and providing feedback all. ill try to answer some of the questions / responses here. first of all i just want to say that im sorry i havent released a final version of the plugin and provided more info/docs. we are pushing hard to finish jboss aop 2.0 and the maven plugin issues have a lower priority atm. - but my goal is to provide the final plugin and docs at the same time we release 2.0. bear with me :)
elysch, thanks for the info on how to create and .aop package. i've been thinking of making a plugin that does it, but the example you provided was so clear that i might drop it :)
mc.coder, ill try to answer your questions here:
1: hm, its strange that you have troubles with this. ive tested locally a few times with a class that used a project dependency and it works just fine. the only issue is if you extend/implement a class thats a project dependency. then you'll get the problem you're describing.
but please post a small example which describes your problem. if i can reproduce it i've probably overlooked something.
regarding the issue when you extend/implement a class thats a project dependency i will add a option that'll be possible to configure from the xml which will include the project dependency to the aop classpath.
- atm i thought it should be defaulted as off, but if you can provide a example that im wrong i can easily be presuaded :)
take a look at the comments here http://jira.jboss.com/jira/browse/JBAOP-453 for more info.
2. ive only put up snapshots. so the location i use is:
<dependency>
| <groupId>org.jboss.maven.plugins</groupId>
| <artifactId>maven-jbossaop-plugin</artifactId>
| <version>1.0-SNAPSHOT</version>
| </dependency>
and
<repository>
| <id>snapshots.jboss.org</id>
| <name>JBoss Maven Snapshot Repository</name>
| <url>http://snapshots.jboss.org/maven2</url>
| </repository>
3. there isnt much information except in this thread im afraid. my goal is to provide maven plugin examples to all the examples we provide in our distro. - i just have to finish some core issues first.
try to explain what you want to do (examples are always nice) and ill try to help, and if i cant there are other in this thread thats shown that they can a lot of maven too :)
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110773#4110773
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110773
18 years, 4 months