Scientist Solutions: Life Science Discussions
 Refer a Friend    Link To Us    Bookmark Us       

      
 » Home » Bioinformatics » Workflows (Data Pipelines) » Problem with web-Service for Taverna

Other Topics
4/9/2008 07:39 PM
use Local java class on T ...
1/24/2008 08:13 PM
DataBiNS: a web-based too ...
1/4/2008 08:17 PM
A (Dilbert) example Taver ...
10/3/2007 01:31 AM
myExperiment.org - the fu ...
10/13/2006 11:13 PM
Protocol for using ARCHAN ...
7/20/2006 09:32 PM
1000s of bioinformatics " ...
7/19/2006 04:52 PM
Ensmart - Ensemble ID to ...
4/19/2006 01:57 PM
Is there an assay develop ...
Subscribet to topic
Add Reply  Add New Topic  Add New Poll
bottom of page RSS Feed 

Topic Feed

 

Problem with web-Service for Taverna

 [View Printable]
cybertop

Frog Egg

See
Similar
Scientists





Group: Member
Posts: 2
Joined: Apr 09, 2008







 Send a personal messsage to cybertop Reply with a quote from this post Go to the top of the page

Hi to all
I have a problrm with a web-service for taverna.

I java implemented in a web-service which takes in input two parameters (String) and returns a string.
With a client written in java always work, when the amount WSDL (AXIS2) Tavern sees only one parameter input.
Who knows?

Carryover the code of web service

public class Servizio {

private String pathInFile;

public String uploadFile(String name, String attchmentID) {


MessageContext inMessageContext = MessageContext.getCurrentMessageContext();

OperationContext operationContext = inMessageContext.getOperationContext();

MessageContext outMessageContext = null;
try {

outMessageContext = operationContext.getMessageContext(WSDLConstants.MESSAGE_LABEL_OUT_VALUE);

} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}



Attachments attachment = inMessageContext.getAttachmentMap();



pathInFile = getAttchment(attachment, attchmentID);


/*** Ho ricevuto tutti i dati necessari. Sono pronti per essere processati
*
* Dati necessari sono: inputFilePath indica il path del file ricevuto (formato zip)
* inputBean contiene i valori per l'elaborazion dei dati(+algoritmo scelto)
*
* ***/

//ProcessingInput processInput = new ProcessingInput(inputFilePath,inputBean);

/**
* Il metodo mi dovra tornare una stringa contente il path del file
* in cui sono stati scriti i riultati
*/

//String resultFilePath = processInput.esegui();

File f = new File(pathInFile);

String idFile = setAttchment(f, outMessageContext);




return f.getAbsolutePath()+"--Param :"+name+"---Idfile: "+idFile;



}

/**
*
* @param attachment
* @param attchmentID
* @return
*/
private String getAttchment(Attachments attachment, String attchmentID){

DataHandler dataHandler = null ;

File dir = null;

String extFile =".zip";

boolean trovato = true;

File outFilePath = null;

try{
int nome= 0;

dir = new File ("/media/DATI/Progetti/java/Linux/UniT/Servizio_MS-A/Server/Input");

/*** Controllo se esiste la cratella Temp ***/
if(!dir.exists())
dir.mkdir();

dataHandler = attachment.getDataHandler(attchmentID);

outFilePath = new File(dir+File.separator+"temp_00"+nome+"_DataSource"+extFile);

/**
* Verifico se esiste un file con lo stesso nome
*/

do{
if (!outFilePath.exists())
trovato = false;

else{
nome++;
outFilePath = new File(dir+File.separator+"temp_00"+nome+"_DataSource"+extFile);
}


}while(trovato);

if (dataHandler!=null){

FileOutputStream outputStream = new FileOutputStream(outFilePath);

dataHandler.writeTo(outputStream);

outputStream.flush();


}

} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

return outFilePath.getAbsolutePath();

}

/**
*
* @param f
* @param outMessageContext
* @return
*/
private String setAttchment(File f, MessageContext outMessageContext){

String idFile = null;

if(f!=null){

DataSource DataSource = new FileDataSource(f);

DataHandler DataHandler = new DataHandler(DataSource);

idFile = outMessageContext.addAttachment(DataHandler);
}

return idFile;


}

}



Thanks

.........................

Posted Jul 26, 2008, 11:14 AM
bgood

Frog Laureate

See
Similar
Scientists





Group: Moderators
Posts: 153
Joined: Apr 12, 2006







 Go to homepage of bgood Send a personal messsage to bgood Reply with a quote from this post Go to the top of the page

How are you testing it with your java client? Are you building directly from the same WSDL that taverna is using?

The problem of recognizing the inputs wouldn't be in the code, it would be in the WSDL document.

Hope that helps

.........................

Posted Aug 24, 2008, 13:16 PM
top of page Add Reply  Add New Topic  Add New Poll

Forum Jump