[JBossWS] - Re: Enabling MTOM-Support at JBossWS client fails
by kosulin
The following code works for me (java 6, JBoss 5.0.0CR1, jbossws Core 3.02):
@WebService(...)
@EndpointConfig(...)
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT, parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
@MTOM(enabled = true)
@BindingType(value = "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true")
public class StatementService
{
...
@WebMethod(operationName = "GetStatementContent")
public StatementListDO getStatementContent(@WebParam(name = "FileName") final String fileName)
{
StatementListDO sldo = new StatementListDO();
...
ArrayList statements = new ArrayList(1);
final File f7z = new File(fileName);
StatementDO statement = new StatementDO();
statement.setStmtContent(new DataHandler(new FileDataSource(f7z)));
statements.add(statement);
sldo.setStatements(statements);
return sldo;
}
...
}
@XmlType
@XmlRootElement(name = "StatementList")
public class StatementListDO
implements Serializable
{
private ArrayList statements;
@XmlElement(name = "Statements", nillable = true, required = false)
public final ArrayList getStatements()
{
return this.statements;
}
public final void setStatements(ArrayList statements)
{
this.statements = statements;
}
}
@XmlType
public final class StatementDO
implements Serializable
{
...
private DataHandler stmtContent;
@XmlElement(name = "StatementContent", required = false)
@XmlMimeType("application/zip")
public final DataHandler getStmtContent()
{
return this.stmtContent;
}
public final void setStmtContent(DataHandler stmtContent)
{
this.stmtContent = stmtContent;
}
...
}
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4170135#4170135
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4170135
16 years, 4 months