help with xmlcursor

2006-12-04 Thread Pader, Erwin
Hi All,

i am using xmlcursor to retrieve all elements of an xml object as part of the 
functions of my service.  however it looks like only elements that have values 
in them are picked up the cursor.  snippet of my code is:

XmlCursor xmlCursor = requestObject.newCursor();

xmlCursor.toFirstChild();

System.out.println("xmlcursor: " + 
xmlCursor.getName().getLocalPart()); 

while (xmlCursor.toNextSibling()) { 
System.out.println("xmlcursor: " + 
xmlCursor.getName().getLocalPart());
}

is there a better way for me to traverse the xml object to get all elements 
regardless if it has a value or not.  thanks!

ErwinP



RE: Accessing spring context inside axis2 handlers and CallbackHandler

2006-12-01 Thread Pader, Erwin
to access spring context in any part of the application:
 
add this in web.xml:
 


org.springframework.web.context.ContextLoaderListener


contextConfigLocation
/WEB-INF/spring-jms.xml


add a singleton implementation of ServletContextAware in spring-jms.xml:
 

 
code this in springappcontext:
 
public class SpringAppContext implements ServletContextAware {
 private static ServletContext servletContext;
 
 public void setServletContext(ServletContext arg0) {
  servletContext = arg0;
 }
 
 public static ServletContext getServletContext() {
  return servletContext;
 }
}
 
to get spring bean in any part of the application:
 
  WebApplicationContext webAppContext = 
WebApplicationContextUtils.getRequiredWebApplicationContext(SpringAppContext.getServletContext());
   JmsTemplate template = (JmsTemplate) 
webAppContext.getBean("jmsTemplate");

 
HTH.
 
ErwinP
 

-Original Message-
From: Dejan Miloševic [mailto:[EMAIL PROTECTED]
Sent: Friday, December 01, 2006 2:47 AM
To: axis-user@ws.apache.org
Subject: Accessing spring context inside axis2 handlers and CallbackHandler



I've found some solutions for this on the net, all of them trying to access 
current message context with MessageContext.getCurrentMessageContext(), then 
retrieve the ServletContext, then call spring's 
WebApplicationContextUtils.getWebApplicationContext(servletContext). This 
worked well with axis1 and can work in axis2 handlers, since they have 
MessageContext as input parameter for invoke(), but cannot work in 
CallbackHandler because it cannot access current message context 
(MessageContext.getCurrentMessageContext() returns null). I need spring beans 
inside CallbackHandler to access the DB and retrieve the pass for the given 
user. 

 

Has anyone solved this problem?

 

I had one not-best-practise idea to store the ApplicationContext in a static 
field in some class just upon its creation. For instance in 
ContextLoaderListener replace the method contextInitialized with:

 

public void contextInitialized(ServletContextEvent event) {

this.contextLoader = createContextLoader();

this.webApplicationContext = 
this.contextLoader.initWebApplicationContext(event.getServletContext());

}

 

And provide field and getter for this context:

 

private static WebApplicationContext webApplicationContext;

 

public static WebApplicationContext getWebApplicationContext()  {

return webApplicationContext;

}

 

Then anywhere in application (including axis2 handlers and CallbackHandler) I 
can call MyContextLoaderListener.getWebApplicationContext() and the spring 
beans can be accessed.

 

Is this so bad solution? Any better ideas?



help with attribute not generated in xmlbeans

2006-11-30 Thread Pader, Erwin
Hi All,

i have defined an attribute for each element (kindly see snippet below) but 
xmlbeans does not seem to generate the objects associated with the attributes.  
i am using wsdl2java of axis2 1.1.  any help is greatly appreciated.  thanks!


http://HMANS";
 xmlns:tns="http://HMANS"; xmlns="http://schemas.xmlsoap.org/wsdl/"; 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema";
 xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
 xmlns:ns2="http://HMANS/types";>
  
http://HMANS/types";
elementFormDefault="qualified"
xmlns:tns="http://HMANS/types";
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"; 
xmlns="http://www.w3.org/2001/XMLSchema"; 
xmlns:xmime="http://www.w3.org/2005/05/xmlmime";>
  http://schemas.xmlsoap.org/soap/encoding/"/>
  http://www.w3.org/2005/05/xmlmime";
  schemaLocation="http://www.w3.org/2005/05/xmlmime"/>
  

  

   

  


   

  
  
  

  

  


ErwinP




RE: [Axis2] Socket connection on Client and Server not disconnect ing

2006-09-19 Thread Pader, Erwin



one of 
the workaround i did to clean up conn and invalidate sessions is to add a custom 
handler in axis2.xml (phase operation in phase).  the custom handler 
gets a reference to the messagecontext thru the invoke method.  you can get 
the session context from msg context and invalidate your 
session.
 
code 
snippet:
 
    public void invoke(MessageContext msgContext) throws 
AxisFault {    SessionContext 
sessionContext = 
msgContext.getSessionContext();    
Object obj = 
msgContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST);    
if (obj != null) {    
 HttpServletRequest request = (HttpServletRequest) 
obj;    
 request.getSession().invalidate();    
}    }

  -Original Message-From: Brian Bacsu 
  [mailto:[EMAIL PROTECTED]Sent: Tuesday, September 19, 2006 3:16 
  PMTo: axis-user@ws.apache.orgSubject: Re: [Axis2] Socket 
  connection on Client and Server not 
  disconnectingRobert Is this an issue 
  with ServiceClient's finalizeInvoke() method not properly cleaning up the 
  connection?  Would I experience the same socket resource starvation with 
  Axis2 if I reverted to a simpler implementation using the 
  ServiceClient.sendReceive() method, rather than the OperationClient.execute() 
  method? Thanks,Brian 
  Bacsu
  


  "robert lazarski" 
<[EMAIL PROTECTED]> 
09/19/2006 01:42 PM 

  
  

  Please respond 
  toaxis-user@ws.apache.org
  

  
  

  To
axis-user@ws.apache.org 
  

  cc

  

  Subject
Re: [Axis2] Socket connection on 
  Client and Server not disconnecting

  
  

This is a known 
  issue:http://issues.apache.org/jira/browse/AXIS2-935There is a 
  patch submitted. If you could attach your test case to itI'll take a look 
  at the patch.RobertOn 9/19/06, Brian Bacsu 
  <[EMAIL PROTECTED]> wrote:>> Hi,>> We have 
  implemented an Axis2 client to call web services exposed through> both 
  .NET and Axis1 running on Microsoft Server 2003. I have encountered an> 
  issue with the Axis2 client with regard to disconnecting the client 
  and> server socket connections. The server-side connection will finally 
  time-out> and drop (It looks like Microsoft Server will hang onto 
  connections for 60> seconds, even after close requested), but the 
  client side connections> continue to collect until the server begins to 
  run out of> resources/connections. The client connections show 
  CLOSE_WAIT status when> viewed with netstat .>> Any 
  suggestions would be appreciated.>> Here is a sample of the 
  client code:>>          Options options 
  = new Options();>>> 
  options.setExceptionToBeThrownOnSOAPFault(Boolean.TRUE);>> 
          options.setTo(new 
  EndpointReference(url.toString()));>         
  ServiceClient serviceClient = null;>         
  MessageContext requestContext => 
  CFWsoapClient.getMessageContext(OM_Msg,this,soapRoot, logger, 
  traceLevel);>         
  requestContext.setSoapAction(action);>         try 
  {>>             
  options.setTransportInProtocol(Constants.TRANSPORT_HTTP);>   
            
  options.setProperty(HTTPConstants.SO_TIMEOUT,1000);>     
          
  options.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,> 
  Boolean.FALSE);>> 
  options.setProperty(HTTPConstants.CONNECTION_TIMEOUT,> 
  (int)timeout);>>             
  serviceClient = new ServiceClient();>         
      serviceClient.setOptions(options);>       
        OperationClient opClient => 
  serviceClient.createClient(ServiceClient.ANON_OUT_IN_OP);>   
            
  opClient.addMessageContext(requestContext);>       
        opClient.execute(true);>>     
          MessageContext resultContext => 
  opClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);>> 
              SOAPEnvelope resEnvelope = 
  resultContext.getEnvelope();>             
  SOAPBody body = resEnvelope.getBody();>>       
        opClient.complete(resultContext);>     
           return body;>       
    }>         catch (AxisFault e1) {> 
              e1.printStackTrace();>   
            throw new 
  AxisFault(e1.getMessage());>         }> 
           finally {>       
        try {>             
      serviceClient.finalizeInvoke();>       
        } catch (AxisFault axisFault) {>     
                  
  logger.error(axisFault.getMessage() +> axisFault.toString());> 
              } catch (Exception e) {> 
                      
  logger.error(e.getMessage() + e.toString());>       
        }>>         
  }>> Thanks,>>  Brian 
  Bacsu>-To 
  unsubscribe, e-mail: [EMAIL PROTECTED]For additional 
  commands, e-mail: 
[EMAIL PROTECTED]


RE: Tomcat + Axis2 + MySQL

2006-09-19 Thread Pader, Erwin



you 
probably need to add commit() for your change to take 
effect.

  -Original Message-From: Prótár Gábor 
  [mailto:[EMAIL PROTECTED]Sent: Tuesday, September 19, 2006 
  8:09 AMTo: axis-user@ws.apache.orgSubject: Tomcat + 
  Axis2 + MySQL
  
  Hello!
   
  I have a problem and I can’t find 
  the answer. (list archive, google J, …) 
  
   
  I am using Tomcat v5.5.17, Axis 2 
  v1.0, MySQL v5.0.24, MySQL Connector/J v5.0.3
   
  I tried to configure Tomcat’s 
  Datasources but it still not works.
   
  1.: put a context.xml file into 
  this directory: /webapps/axis2/meta-inf
   
  
  
  
  name="jdbc/TestDB"
  type="javax.sql.DataSource"
  username="wsuser"
  password="abc"
  driverClassName="com.mysql.jdbc.Driver"
  maxIdle="2"
  maxWait="5000"
  url=""
  maxActive="4"/>
  WEB-INF/web.xml
  
   
  2.: write new lines to the web.xml 
  file at /webapps/axis2/web-inf
   
    
  
    
  DB 
  Connection
    
  jdbc/TestDB
    
  javax.sql.DataSource
    
  Container
    
  
   
  3.: use 
  it
   
  Context envContext = 
  (Context)initContext.lookup("java:/comp/env");
  DataSource ds = 
  (DataSource)envContext.lookup("jdbc/TestDB");
  Connection conn = 
  ds.getConnection();
      
  
  Statement ins = 
  conn.createStatement();
  ins.execute("insert into w(name) 
  values('" + transactions[i].getName() + "')");
      
  
  conn.close();
   
  4.: No error, but there is nothing 
  changed in the database. Please help me solve this 
  problem.
   
  ---
   
  Also I have another problem, I 
  can’t see error messages from MySQL connector and when I use 
  System.out.println(); int he webservice code I can’t see it in any log files? 
  (stdout_.log and stderr__.log files are 
  created by the Tomcat server, but they are only holding information about 
  loading modules) How can I configure proper 
  logging?
   
  For 
  example:
   
  - Deploying module : 
  addressing-1.0
  - Deploying module : 
  soapmonitor-1.0
  Retrieving document at 
  ''.
   
  Thanks,
  Prótár 
  Gábor
   
  Ps.: sorry for my bad english 
  J


sessions are not destroyed using xmlbeans databinding

2006-09-07 Thread Pader, Erwin
Hi all,

My shop is planning to implement xmlbeans databinding.  however, i have
noticed that it does not seem to be destroying sessions in tomcat 5.5
The stub.cleanup() does not do the job either.  short of opening up axis2
source code and putting fixes, is there a solution out there?

thanks.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: need help with service design issue (more info)

2006-08-17 Thread Pader, Erwin
Thilina, thanks for the suggestion.  i tried fireandforget (client code
below) but it looks like it did not go over the wire.  also, i changed the
message receiver class to RawXMLINOnlyMessageReceiver for good measure.  i
checked to see the server log and nothing was out there.  i am using the
8/16 nightly build btw.  thanks.

OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace omNs =
fac.createOMNamespace("http://localhost/my";, "my");

OMElement method = fac.createOMElement("mtomService", omNs);
OMElement coid = fac.createOMElement("coid", omNs);
OMElement medRec = fac.createOMElement("medrec", omNs);
OMElement patAcct = fac.createOMElement("patacct", omNs);

coid.setText("803");
medRec.setText("0009039819");
patAcct.setText("4020233");

method.addChild(coid);
method.addChild(medRec);
method.addChild(patAcct);

fileName = fac.createOMElement("fileName", omNs);
file = fac.createOMElement("file", omNs);

inputFile = new File("c:\\icd9.txt");
fileName.setText(inputFile.getName());
expectedDH = new DataHandler(new FileDataSource(inputFile));
textData = fac.createOMText(expectedDH, true);
file.addChild(textData);

method.addChild(fileName);
method.addChild(file);  

Options options = new Options();
 
options.setSoapVersionURI(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI);
options.setTo(targetEPR);
//  enabling MTOM in the client side
options.setProperty(Constants.Configuration.ENABLE_MTOM,
Constants.VALUE_TRUE);
options.setTransportInProtocol(Constants.TRANSPORT_HTTP);
options.setAction("urn:mtomService");

ServiceClient sender = new ServiceClient();
    sender.setOptions(options);
sender.fireAndForget(method);   

-Original Message-
From: Pader, Erwin 
Sent: Wednesday, August 16, 2006 12:49 PM
To: 'axis-user@ws.apache.org'
Subject: RE: need help with service design issue (more info)
Importance: High


i just modified the code (see below) so that instead of passing the
OMElement to the ftp thread, i will just be passing the datahandler.
however, it is precisely in the data handler where the bottleneck occurs
which renders this solution useless.

public OMElement mtomService(OMElement element) throws Exception {
//ThreadedFTPService goFTP = new ThreadedFTPService(element);
//goFTP.start();

OMElement _fileNameEle = null;
OMElement _fileElement = null;

for (Iterator _iterator = element.getChildElements();
_iterator.hasNext();) {  
OMElement _ele = (OMElement) _iterator.next();

System.out.println("element: " + _ele.getLocalName());

if (_ele.getLocalName().equalsIgnoreCase("fileName")) {
_fileNameEle = _ele;
continue;
}

if (_ele.getLocalName().equalsIgnoreCase("file")) {
_fileElement = _ele;

if (_fileNameEle == null || _fileElement == null ) {
 try {
  throw new AxisFault("Either Image or
FileName is null");
   } catch (AxisFault e) {
  e.printStackTrace();
   }
}

String fileName = _fileNameEle.getText();

_fileElement.build();
_fileElement.buildNext();
  _fileElement.detach();

  OMText binaryNode = (OMText)
_fileElement.getFirstOMChild();

SimpleDateFormat timeFormat = new
SimpleDateFormat("HH:mm:ss");

System.out.println("start time: " +
timeFormat.format(new Date()));
DataHandler actualDH = (DataHandler)
binaryNode.getDataHandler();
System.out.println("end time: " + timeFormat.format(new
Date()));

ThreadedFTPService goFTP = new
ThreadedFTPService(fileName, actualDH);
goFTP.start();
}
}

OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace ns = fac.createOMNamesp

RE: need help with service design issue (more info)

2006-08-16 Thread Pader, Erwin
i just modified the code (see below) so that instead of passing the
OMElement to the ftp thread, i will just be passing the datahandler.
however, it is precisely in the data handler where the bottleneck occurs
which renders this solution useless.

public OMElement mtomService(OMElement element) throws Exception {
//ThreadedFTPService goFTP = new ThreadedFTPService(element);
//goFTP.start();

OMElement _fileNameEle = null;
OMElement _fileElement = null;

for (Iterator _iterator = element.getChildElements();
_iterator.hasNext();) {  
OMElement _ele = (OMElement) _iterator.next();

System.out.println("element: " + _ele.getLocalName());

if (_ele.getLocalName().equalsIgnoreCase("fileName")) {
_fileNameEle = _ele;
continue;
}

if (_ele.getLocalName().equalsIgnoreCase("file")) {
_fileElement = _ele;

if (_fileNameEle == null || _fileElement == null ) {
 try {
  throw new AxisFault("Either Image or
FileName is null");
   } catch (AxisFault e) {
  e.printStackTrace();
   }
}

String fileName = _fileNameEle.getText();

_fileElement.build();
_fileElement.buildNext();
  _fileElement.detach();

  OMText binaryNode = (OMText)
_fileElement.getFirstOMChild();

SimpleDateFormat timeFormat = new
SimpleDateFormat("HH:mm:ss");

System.out.println("start time: " +
timeFormat.format(new Date()));
DataHandler actualDH = (DataHandler)
binaryNode.getDataHandler();
System.out.println("end time: " + timeFormat.format(new
Date()));

ThreadedFTPService goFTP = new
ThreadedFTPService(fileName, actualDH);
goFTP.start();
}
}

OMFactory fac = OMAbstractFactory.getOMFactory();
OMNamespace ns = fac.createOMNamespace("urn://fakenamespace", "ns");
OMElement ele = fac.createOMElement("response", ns);
    ele.setText("File Saved");
return ele;
}

-Original Message-
From: Pader, Erwin [mailto:[EMAIL PROTECTED]
Sent: Wednesday, August 16, 2006 12:01 PM
To: axis-user@ws.apache.org
Subject: need help with service design issue


Hi All,

we are planning to use axis2 to send hospital patient info using mtom
(including scanned images, pdf docs, etc) to a service.  this service will
then start a new thread whose only function is to ftp the binary attachment
to an external system.  the service passes the whole OMElement to the ftp
thread.  the problem is it looks like the new thread closes or resets the
socket connection to the binary attachment causing an exception.  if i do
not start a new thread my service will be tied up as it tries to readin in
the attachment (DataHandler actualDH = (DataHandler)
binaryNode.getDataHandler();).  a 10 mb files takes 20 secs for my service
to get the data handler.  i need all your help please for a better solution
to this.  thanks!

Erwin Pader
HMA, Inc.
Naples FL

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



need help with service design issue

2006-08-16 Thread Pader, Erwin
Hi All,

we are planning to use axis2 to send hospital patient info using mtom
(including scanned images, pdf docs, etc) to a service.  this service will
then start a new thread whose only function is to ftp the binary attachment
to an external system.  the service passes the whole OMElement to the ftp
thread.  the problem is it looks like the new thread closes or resets the
socket connection to the binary attachment causing an exception.  if i do
not start a new thread my service will be tied up as it tries to readin in
the attachment (DataHandler actualDH = (DataHandler)
binaryNode.getDataHandler();).  a 10 mb files takes 20 secs for my service
to get the data handler.  i need all your help please for a better solution
to this.  thanks!

Erwin Pader
HMA, Inc.
Naples FL

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



question about a service receiving multiple mtom objects in one s end

2006-08-09 Thread Pader, Erwin
Hi,

i am not sure if axis2 allows for the multiple handling of mtom objects in
one send request, but i just tried doing this by way of this code snippet:

fileName = fac.createOMElement("fileName", omNs);
file = fac.createOMElement("file", omNs);

inputFile = new File("c:\\phpconfiguration.txt");
fileName.setText(inputFile.getName());
expectedDH = new DataHandler(new FileDataSource(inputFile));
textData = fac.createOMText(expectedDH, true);
file.addChild(textData);

method.addChild(fileName);
method.addChild(file);

fileName1 = fac.createOMElement("fileName1", omNs);
file1 = fac.createOMElement("file1", omNs);

inputFile = new File("c:\\ul4record.txt");
fileName1.setText(inputFile.getName());
expectedDH = new DataHandler(new FileDataSource(inputFile));
textData = fac.createOMText(expectedDH, true);
file1.addChild(textData);

method.addChild(fileName1);
method.addChild(file1);

i displayed the xml file before going out on the wire and i was able to see
both binary objects.  however, the mtom service only picked up the first
object.  it looks like axis2 does not handle two or mtom objects in one send
or am i missing something?   thanks in advance for any reply.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: question on how to save pdf file in mtom service

2006-08-09 Thread Pader, Erwin
i found the answer to my own question.  anyway, this is the code to use if
one were to write any binary mtom object to a file:

OMText binaryNode = (OMText) _imageElement.getFirstOMChild();
DataHandler actualDH;
actualDH = (DataHandler) binaryNode.getDataHandler();
actualDH.writeTo(new FileOutputStream("yourfilenamehere"));

thanks for all the responses.



>  -Original Message-
> From: Pader, Erwin  
> Sent: Friday, August 04, 2006 10:16 AM
> To:   axis-user@ws.apache.org
> Subject:  question on how to save pdf file in mtom service
> 
> Hi all,
> 
> i've been playing around MTOMService and added functionality that will let
> it read a pdf file and subsequently saving it.  this is a code snippet of
> what i added in MTOMService:
> 
> byte[] b = null;
> actualDH.getDataSource().getInputStream().read(b);
> FileOutputStream fileOutStream = new FileOutputStream(fileName);
> 
> fileOutStream.write(b);
> 
> for some reason i am getting this exception on the client side:
> 
> org.apache.axis2.AxisFault: unknown
>   at
> org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOpe
> ration.java:287)
>   at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457)
>   at
> org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399)
>   at
> sample.mtom.imagetransfer.client.MTOMPDFClient.main(MTOMPDFClient.java:106
> )
> Caused by: java.lang.Exception: org.apache.axis2.AxisFault
>   at
> org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(
> RawXMLINOutMessageReceiver.java:102)
>   at
> org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstra
> ctInOutSyncMessageReceiver.java:37)
>   at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)
>   at
> org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(
> HTTPTransportUtils.java:284)
>   at
> org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>   at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>   at
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicati
> onFilterChain.java:252)
>   at
> org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilter
> Chain.java:173)
>   at
> org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.
> java:213)
>   at
> org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.
> java:178)
>   at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:1
> 26)
>   at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:1
> 05)
>   at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.ja
> va:107)
>   at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148
> )
>   at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>   at
> org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.proces
> sConnection(Http11BaseProtocol.java:664)
>   at
> org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.j
> ava:527)
>   at
> org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollower
> WorkerThread.java:80)
>   at
> org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.j
> ava:684)
>   at java.lang.Thread.run(Unknown Source)
> 
>   at org.apache.axis2.AxisFault.(AxisFault.java:159)
>   ... 4 more
> 
> any help is greatly appreciated.
> 
> Erwin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



question on how to save pdf file in mtom service

2006-08-04 Thread Pader, Erwin
Hi all,

i've been playing around MTOMService and added functionality that will let
it read a pdf file and subsequently saving it.  this is a code snippet of
what i added in MTOMService:

byte[] b = null;
actualDH.getDataSource().getInputStream().read(b);
FileOutputStream fileOutStream = new FileOutputStream(fileName);

fileOutStream.write(b);

for some reason i am getting this exception on the client side:

org.apache.axis2.AxisFault: unknown
at
org.apache.axis2.description.OutInAxisOperationClient.execute(OutInAxisOpera
tion.java:287)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:457)
at
org.apache.axis2.client.ServiceClient.sendReceive(ServiceClient.java:399)
at
sample.mtom.imagetransfer.client.MTOMPDFClient.main(MTOMPDFClient.java:106)
Caused by: java.lang.Exception: org.apache.axis2.AxisFault
at
org.apache.axis2.receivers.RawXMLINOutMessageReceiver.invokeBusinessLogic(Ra
wXMLINOutMessageReceiver.java:102)
at
org.apache.axis2.receivers.AbstractInOutSyncMessageReceiver.receive(Abstract
InOutSyncMessageReceiver.java:37)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:454)
at
org.apache.axis2.transport.http.HTTPTransportUtils.processHTTPPostRequest(HT
TPTransportUtils.java:284)
at
org.apache.axis2.transport.http.AxisServlet.doPost(AxisServlet.java:136)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Application
FilterChain.java:252)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterCh
ain.java:173)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.ja
va:213)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.ja
va:178)
at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126
)
at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105
)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
:107)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
at
org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processC
onnection(Http11BaseProtocol.java:664)
at
org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.jav
a:527)
at
org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWo
rkerThread.java:80)
at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:684)
at java.lang.Thread.run(Unknown Source)

at org.apache.axis2.AxisFault.(AxisFault.java:159)
... 4 more

any help is greatly appreciated.

Erwin

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]