Value lost when transferring from server to client in silverlight - wcf-ria-services

I am making a Silverlight app using WCF. I want to get the status of the hard-disks from remote servers and I am able to do that on the server side using a Management object. I have defined a wrapper class to hold the data of the hard-disks and store the objects in a list which I return.
Earlier, when the wrapper class was in the server project, it worked fine. However, when I transferred the class to a class library project in the same solution, the asynchronous call-completed event handler on the client side now gives me an event argument that is empty, i.e. an empty list
I tried debugging both the server and client code, and I see that the server creates the list properly and accesses the disk objects nicely. But the client code simply shows the list to be of size 0.
My client code is:
private void getDiskStatus()
{
diskSpaceStatus.Text = "Running...";
if (server == string.Empty)
{
server = "localhost";
}
diskServer.Text = server;
LogReaderClient proxy = new LogReaderClient();
proxy.getDiskSpaceCompleted += new EventHandler<getDiskSpaceCompletedEventArgs>(proxy_getDiskSpaceCompleted);
proxy.getDiskSpaceAsync(server);
}
void proxy_getDiskSpaceCompleted(object sender, getDiskSpaceCompletedEventArgs e)
{
diskSpaceStatus.Text = "Completed";
try
{
List<uDisk> udisks = new List<uDisk>();
foreach (Disk d in e.Result)
{
uDisk ud = new uDisk(d);
udisks.Add(ud);
}
diskTable.ItemsSource = udisks;
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Where uDisk is another wrapper class for the client side.
My server code is:
[OperationContract]
public List<Disk> getDiskSpace(string server)
{
ConnectionOptions conn = new ConnectionOptions();
ManagementScope scope = new ManagementScope("\\\\" + server + "\\root\\cimv2", conn);
try
{
scope.Connect();
}
catch (Exception ex)
{
error = ex.Message;
}
ObjectQuery oq = new ObjectQuery("select FreeSpace, Size, Name from Win32_LogicalDisk where DriveType=3");
ManagementObjectSearcher search = new ManagementObjectSearcher(scope, oq);
ManagementObjectCollection moc = search.Get();
List<Disk> disks = new List<Disk>();
Disk d;
foreach (ManagementObject mo in moc)
{
d = new Disk(mo);
disks.Add(d);
}
return disks;
}
And the server wrapper class is:
namespace LogFilter.DataObjects
{
[DataContract]
public class Disk
{
[DataMember]
public string name;
[DataMember]
public double freeSpace;
[DataMember]
public double size;
[DataMember]
public double percentFree;
public Disk()
{}
public Disk(ManagementObject mo)
{
this.name = Convert.ToString(mo["Name"]);
this.freeSpace = Convert.ToDouble(mo["FreeSpace"]);
this.size = Convert.ToDouble(mo["Size"]);
this.percentFree = freeSpace * 100 / size;
}
}
}
The wrapper class is in the namespace LogFilter.DataObjects and the Server code is in the namespace LogFilter.Web.
Can anyone provide a solution to this?
Also can someone please give me a resource as to how to set the transfermode in a Silverlight application to Buffered?

Related

Message channels one or many?

I need to handle emails from about 30 addresses. I implement this in a way where all emails going to one DirectChannel and after to Receiver. In Receiver I can understand from what address is message comes, to do this I create CustomMessageSource that wraps javax.mail.Message to my own type that contains javax.mail.Message and some Enum. Looks like this is not a good decision, cause I can use #Transformer, but how can I use it if I have only 1 channel?
That was the first question.
Second question:
Should I use ONE channel and ONE receiver for all that addresses? Or better to have channel and receiver for each mail address? I don't understand Spring so deeply to feel the difference.
p.s. this question is continuation of Spring multiple imapAdapter
In each child context, you can add a header enricher to set a custom header to the URL from the adapter; with the output channel being the shared channel to the shared service.
In the service, use void foo(Message emailMessage, #Header("myHeader") String url)
I would generally recommend using a single service unless the service needs to do radically different things based on the source.
EDIT:
I modified my answer to your previous question to enhance the original message with the url in a header; each instance has its own header enricher and they all route the enriched message to the common emailChannel.
#Configuration
#EnableIntegration
public class GeneralImapAdapter {
#Value("${imap.url}")
String imapUrl;
#Bean
public static PropertySourcesPlaceholderConfigurer pspc() {
return new PropertySourcesPlaceholderConfigurer();
}
#Bean
#InboundChannelAdapter(value = "enrichHeadersChannel", poller = #Poller(fixedDelay = "10000") )
public MessageSource<javax.mail.Message> mailMessageSource(MailReceiver imapMailReceiver) {
return new MailReceivingMessageSource(imapMailReceiver);
}
#Bean
public MessageChannel enrichHeadersChannel() {
return new DirectChannel();
}
#Bean
#Transformer(inputChannel="enrichHeadersChannel", outputChannel="emailChannel")
public HeaderEnricher enrichHeaders() {
Map<String, ? extends HeaderValueMessageProcessor<?>> headersToAdd =
Collections.singletonMap("emailUrl", new StaticHeaderValueMessageProcessor<>(this.imapUrl));
HeaderEnricher enricher = new HeaderEnricher(headersToAdd);
return enricher;
}
#Bean
public MailReceiver imapMailReceiver() {
MailReceiver receiver = mock(MailReceiver.class);
Message message = mock(Message.class);
when(message.toString()).thenReturn("Message from " + this.imapUrl);
Message[] messages = new Message[] {message};
try {
when(receiver.receive()).thenReturn(messages);
}
catch (MessagingException e) {
e.printStackTrace();
}
return receiver;
}
}
...and I modified the receiving service so it gets access to the header...
#MessageEndpoint
public class EmailReceiverService {
#ServiceActivator(inputChannel="emailChannel")
public void handleMessage(Message message, #Header("emailUrl") String url) {
System.out.println(message + " header:" + url);
}
}
...hope that helps.
EDIT 2:
And this one's a bit more sophisticated; it pulls the from from the payload and puts it in a header; not needed for your use case since you have the full message, but it illustrates the technique...
#Bean
#Transformer(inputChannel="enrichHeadersChannel", outputChannel="emailChannel")
public HeaderEnricher enrichHeaders() {
Map<String, HeaderValueMessageProcessor<?>> headersToAdd = new HashMap<>();
headersToAdd.put("emailUrl", new StaticHeaderValueMessageProcessor<String>(this.imapUrl));
Expression expression = new SpelExpressionParser().parseExpression("payload.from[0].toString()");
headersToAdd.put("from", new ExpressionEvaluatingHeaderValueMessageProcessor<>(expression, String.class));
HeaderEnricher enricher = new HeaderEnricher(headersToAdd);
return enricher;
}
and
#ServiceActivator(inputChannel="emailChannel")
public void handleMessage(Message message, #Header("emailUrl") String url,
#Header("from") String from) {
System.out.println(message + " header:" + url + " from:" + from);
}

Check available connections in PoolingClientConnectionManager

Is there a way (and how) to know the status of a connection pool? Like, how many connections are being used, how many are available, ...
We are currently facing issues where the application cannot get a connection from the pool (ConnectionPoolTimeoutException: Timeout waiting for connection from pool) so to track down the cause we would like to log some pool stats each time a new connection is requested.
I have been browsing the Apache HTTPClient API but did not find a way to get this information.
We use PoolingClientConnectionManager.
You can use methods of the ConnPoolControl interface to control parameters of the internal pool
You can have a detailed information total and per route with the code below:
public static void main(String[] args) {
PoolingHttpClientConnectionManager connectionManager = HttpClientUtils.getConnectionManager();
System.out.println(createHttpInfo(connectionManager));
}
private static String createHttpInfo(PoolingHttpClientConnectionManager connectionManager) {
StringBuilder sb = new StringBuilder();
sb.append("=========================").append("\n");
sb.append("General Info:").append("\n");
sb.append("-------------------------").append("\n");
sb.append("MaxTotal: ").append(connectionManager.getMaxTotal()).append("\n");
sb.append("DefaultMaxPerRoute: ").append(connectionManager.getDefaultMaxPerRoute()).append("\n");
sb.append("ValidateAfterInactivity: ").append(connectionManager.getValidateAfterInactivity()).append("\n");
sb.append("=========================").append("\n");
PoolStats totalStats = connectionManager.getTotalStats();
sb.append(createPoolStatsInfo("Total Stats", totalStats));
Set<HttpRoute> routes = connectionManager.getRoutes();
if (routes != null) {
for (HttpRoute route : routes) {
sb.append(createRouteInfo(connectionManager, route));
}
}
return sb.toString();
}
private static String createRouteInfo(PoolingHttpClientConnectionManager connectionManager, HttpRoute route) {
PoolStats routeStats = connectionManager.getStats(route);
String info = createPoolStatsInfo(route.getTargetHost().toURI(), routeStats);
return info;
}
private static String createPoolStatsInfo(String title, PoolStats poolStats) {
StringBuilder sb = new StringBuilder();
sb.append(title + ":").append("\n");
sb.append("-------------------------").append("\n");
if (poolStats != null) {
sb.append("Available: ").append(poolStats.getAvailable()).append("\n");
sb.append("Leased: ").append(poolStats.getLeased()).append("\n");
sb.append("Max: ").append(poolStats.getMax()).append("\n");
sb.append("Pending: ").append(poolStats.getPending()).append("\n");
}
sb.append("=========================").append("\n");
return sb.toString();
}
Update (2019-01-07)
The connection manager is retrieved from an utilitarian class I've created (you can create it differently):
public class HttpClientUtils {
private static final PoolingHttpClientConnectionManager connectionManager = createConnectionManager();
private static PoolingHttpClientConnectionManager createConnectionManager() {
try {
SSLConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory(
SSLContext.getDefault(),
new String[] {"TLSv1", "TLSv1.1", "TLSv1.2"},
null,
SSLConnectionSocketFactory.getDefaultHostnameVerifier());
Registry<ConnectionSocketFactory> registry = RegistryBuilder.<ConnectionSocketFactory>create()
.register("http", PlainConnectionSocketFactory.INSTANCE)
.register("https", socketFactory)
.build();
PoolingHttpClientConnectionManager cm = new PoolingHttpClientConnectionManager(registry);
cm.setMaxTotal(200);
cm.setDefaultMaxPerRoute(20);
return cm;
} catch (NoSuchAlgorithmException | RuntimeException ex) {
Logger.getLogger(HttpClientUtils.class.getName()).log(Level.SEVERE, null, ex);
return null;
}
}
public static PoolingHttpClientConnectionManager getConnectionManager() {
return connectionManager;
}
}

Program crashes when exe is copied to different computer

I have written a program in c# on my Windows 7 computer with .NET 4.0 using Sharp Develop 4.2.
I then changed it to a release within Sharp Develop, built it, and copied the .exe in the bin\Release folder to another Windows 7 computer with .NET 4.0. It crashes immediately without loading the initial form and gives no specific error. My MainForm method is like this:
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using System.Data;
using System.Data.SqlClient;
using System.ComponentModel;
using System.Globalization;
using System.IO;
using System.Drawing.Printing;
using System.Diagnostics;
using System.Text;
namespace BiasTracker1._
{
public partial class MainForm : Form
{
//Here are my initial variables
public static SqlConnectionStringBuilder sqlBldr = new SqlConnectionStringBuilder();
public static DataSet ds = new DataSet();
public static DataTable DisplayTable = ds.Tables.Add("DisplayTable");
SqlDataAdapter RawDataDA;
SqlCommandBuilder RawSampleSCB;
public static DataTable InstrumentDetail = ds.Tables.Add("InstrumentDetail");
public static string DatabaseOwner;
System.Windows.Forms.DataVisualization.Charting.Chart CurrentChart;
public static DataTable ImportDataTable = new DataTable();
public static string NewTransfer;
public static bool ValidatePerCell = true;
public static Image chart1Image;
public static string Title;
public static string NIRLabString;
bool ChangesNotDisplayed = false;
Point PreviousChartLocation;
List<System.Windows.Forms.DataVisualization.Charting.DataPoint> SelectedPoints = new List<System.Windows.Forms.DataVisualization.Charting.DataPoint>();
List<DataRow> SelectedRows = new List<DataRow>();
static double EPS = 2.22045e-016;
double FPMIN = 2.22507e-308 / EPS;
public static CustomPrintDoc pd = new CustomPrintDoc();
int NumOfParametersInReport = 0;
public static SqlConnectionStringBuilder SimPlusConn;
public static string SimPlusProductGUID;
public static string SimPlusSiteCode;
public double[] cof = new double[] {-1.3026537197817904,0.64196979235649026,0.019476473204185836,-0.009561514786808631,-0.000946595344482036,0.000366839497852761,0.000042523324806907,-0.000020278578112534,-0.000001624290004647,0.00000130365583558,0.000000015626441722,-0.000000085238095915,0.000000006529054439,0.000000005059343495,-0.000000000991364156,-0.000000000227365122,0.000000000096467911,0.000000000002394038,-0.000000000006886027,0.000000000000894487,0.000000000000313092,-0.000000000000112708,0.000000000000000381,0.000000000000007106,-0.000000000000001523,-0.000000000000000094,0.000000000000000121,-0.000000000000000028};
Point? prevPosition = null;
ToolTip tooltip = new ToolTip();
public MainForm()
{
try
{
InitializeComponent();
}
catch(Exception ex)
{
MessageBox.Show("Failed in Initialization.\n" + ex.ToString());
}
//Test SQL Connection
FileStream ConnectionStream;
try
{
ConnectionStream = new FileStream(#"C:\BiasTracker\settings.ini",FileMode.OpenOrCreate);
}
catch(DirectoryNotFoundException ex)
{
MessageBox.Show("Not able to find ini... Creating one.");
Directory.CreateDirectory(#"C:\BiasTracker");
ConnectionStream = new FileStream(#"C:\BiasTracker\settings.ini",FileMode.OpenOrCreate);
}
try
{
StreamReader ConnectionRdr = new StreamReader(ConnectionStream);
string line = null;
if((line = ConnectionRdr.ReadLine()) != null)
{
sqlBldr.DataSource = line;
sqlBldr.Password = ConnectionRdr.ReadLine();
sqlBldr.UserID = ConnectionRdr.ReadLine();
sqlBldr.InitialCatalog = ConnectionRdr.ReadLine();
}
else
{
sqlBldr.DataSource = ".\\SQLEXPRESS";
sqlBldr.Password = "password";
sqlBldr.UserID = "sa";
sqlBldr.InitialCatalog = "BiasMaster";
StreamWriter ConnectionWtr = new StreamWriter(ConnectionStream);
ConnectionWtr.WriteLine(".\\SQLEXPRESS");
ConnectionWtr.WriteLine("password");
ConnectionWtr.WriteLine("sa");
ConnectionWtr.WriteLine("BiasMaster");
ConnectionWtr.WriteLine("applications\\SQLEXPRESS");
ConnectionWtr.WriteLine("password");
ConnectionWtr.WriteLine("sa");
ConnectionWtr.WriteLine("BiasMaster");
ConnectionWtr.Dispose();
}
ConnectionStream.Close();
ConnectionStream.Dispose();
ConnectionRdr.Dispose();
}
catch(Exception ex)
{
MessageBox.Show("Not Able to read connection string\n" + ex.ToString());
}
System.Data.SqlClient.SqlConnection tmpConn;
tmpConn = new SqlConnection(sqlBldr.ConnectionString);
try //Test the connection and existence of the database
{
tmpConn.Open();
tmpConn.Close();
}
catch
{
MessageBox.Show("Database Connection not Found.");
tmpConn.Close();
}
SqlDataAdapter SettingsDA = new SqlDataAdapter("SELECT * FROM Settings WHERE SettingDesc = 'Owner'",sqlBldr.ConnectionString);
DataTable SettingsTable = new DataTable();
SettingsDA.Fill(SettingsTable);
DatabaseOwner = SettingsTable.Rows[0][1].ToString();
MakeTreeView();
}
MakeTreeView is surrounded by a try catch with a messagebox.
My Form loads these controls:
privateSystem.Windows.Forms.ToolStripMenuItemsimPlusImportToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripStatusLabeltoolStripStatusLabel1;
privateSystem.Windows.Forms.ToolStripMenuItemsyncWithSharedServerToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemsyncToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemsetDBConnectionToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemtestToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemdetectOutliersToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemsaveToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemexcludeSelectedToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemgraphActionsToolStripMenuItem;
privateSystem.Windows.Forms.ComboBoxcomboBox7;
privateSystem.Windows.Forms.ToolStripMenuItemprintReportToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemaddToReportToolStripMenuItem;
privateSystem.Windows.Forms.DataVisualization.Charting.Chartchart4;
privateSystem.Windows.Forms.DataVisualization.Charting.Chartchart3;
privateSystem.Windows.Forms.Panelpanel2;
privateSystem.Windows.Forms.DataVisualization.Charting.Chartchart2;
privateSystem.Windows.Forms.ComboBoxcomboBox6;
privateSystem.Windows.Forms.Labellabel7;
privateSystem.Windows.Forms.Buttonbutton3;
privateSystem.Windows.Forms.DataVisualization.Charting.Chartchart1;
privateSystem.Windows.Forms.Buttonbutton2;
privateSystem.Windows.Forms.ToolStripMenuItemremoveProductFormInstrumentToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemcopyInstrumentProductListToAnotherInstrumentToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemaddProductToInstrumentToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemaddParameterToProductToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemtablesToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemtXTToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemcSVToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItembiasDataToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemimportToolStripMenuItem;
privateSystem.Windows.Forms.Labellabel1;
privateSystem.Windows.Forms.ComboBoxcomboBox1;
privateSystem.Windows.Forms.Labellabel2;
privateSystem.Windows.Forms.ComboBoxcomboBox2;
privateSystem.Windows.Forms.Labellabel3;
privateSystem.Windows.Forms.ComboBoxcomboBox3;
privateSystem.Windows.Forms.Labellabel4;
privateSystem.Windows.Forms.ComboBoxcomboBox4;
privateSystem.Windows.Forms.Labellabel5;
privateSystem.Windows.Forms.ComboBoxcomboBox5;
privateSystem.Windows.Forms.Labellabel6;
privateSystem.Windows.Forms.DateTimePickerdateTimePicker1;
privateSystem.Windows.Forms.DateTimePickerdateTimePicker2;
privateSystem.Windows.Forms.ToolStripMenuItemparameterToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemproductToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuIteminstrumentToolStripMenuItem1;
privateSystem.Windows.Forms.ToolStripMenuItemlocationToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemcompanyToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemnewToolStripMenuItem;
privateSystem.Windows.Forms.ToolStripMenuItemfileToolStripMenuItem;
privateSystem.Windows.Forms.MenuStripmenuStrip1;
privateSystem.Windows.Forms.StatusStripstatusStrip1;
privateSystem.Windows.Forms.TabPagetabPage2;
privateSystem.Windows.Forms.DataGridViewdataGridView1;
privateSystem.Windows.Forms.TreeViewtreeView1;
privateSystem.Windows.Forms.Buttonbutton1;
privateSystem.Windows.Forms.Panelpanel1;
privateSystem.Windows.Forms.TabPagetabPage1;
privateSystem.Windows.Forms.TabControltabControl1;
The only thing I can think is that I am using a reference to something that the other computer does not have access to. I thought it was the chart controls, but .NET 4.0 has those included. Any help would be immensely appreciated.
I found the culprit. It was the line:
DatabaseOwner = SettingsTable.Rows[0][1].ToString();
I found it using AppDomain.UnhandledException. It was a great tool if anyone else is running into a similar issue.
http://msdn.microsoft.com/en-us/library/system.appdomain.unhandledexception.aspx

Java WS file upload service

I am currently working on a Java Web Service project. It is deployed on an Apache Tomcat 7 server and I need to provide a service for uploading files to the server. Also, the web service should be available to systems that may not use java. Thus, I need to make my web service universally available for all clients (i.e. C#, php etc.).
After browsing the web, I have found many solutions, but none of them does not explain how can I fulfill the aforementioned criteria. To be more specific, I have come across MTOM and Java WS Annotations that are referenced to be essential in order to specify universally accepted data stuctures, such as Java's DataHandler.
Let me post a sample code of my web service:
public class DataFileServer extends AbstractFileServer {
private int _buffer_size;
public DataFileServer() {
_buffer_size = 100000;
}
public DataFileServer(int bufferSize) {
_buffer_size = bufferSize;
}
#Override
public void uploadFile(String AbsoluteFilePath, FileObject FileInfo) {
DataHandler _handler = FileInfo.getHandler();
try {
InputStream is = _handler.getInputStream();
OutputStream os = new FileOutputStream(new File(AbsoluteFilePath +
"/" + FileInfo.getName() + "." +
FileInfo.getType()));
byte[] b = new byte[_buffer_size];
int bytesRead = 0;
while((bytesRead = is.read()) != -1) {
os.write(b, 0, bytesRead);
}
}catch(IOException e) {
e.printStackTrace();
}
}
}
The DataFileServer is the class that will to the upload operation, and the Web Service interface will be as follows:
#WebService()
public class ETL_WS {
private DataHandler _handler;
private String server_dir = "/home/user/Desktop/FileServer";
public int fileUpload(String FileName, DataHandler CsvFile) {
FileObject _file = new FileObject(FileName, CsvFile);
_handler.uploadFile(this.server_dir, _file);
return 0;
}
}
My question is, how am I going to ensure that the DataHandler object provided to my web service is going to be of the right type. Also, can I improve the security and the performance of the file upload operation with any way?
Thank you

Send byte array from web service to client

I want to send a byte array from a web service to a client that requests an operation exposed via the service. In my method, I read an image into a byte array. I think place this byte array into a wrapper POJO. This is the return type for the operation.
#Override
public ImageWrapper getImage() {
File imageFile = new File("C:\\images\\car.jpg");
ImageWrapper wrapper = null;
try {
BufferedImage img = ImageIO.read(imageFile);
ByteArrayOutputStream baos = new ByteArrayOutputStream(1000);
ImageIO.write(img, "jpg", baos);
baos.flush();
byte[] result = baos.toByteArray();
baos.close();
wrapper = new ImageWrapper();
wrapper.setContent(result);
System.out.println("Service image wrapper: " + wrapper);
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return wrapper;
}
I can receive the ImageWrapper object in the client ok. It has a different id to the ImageWrapper instance that is created by the web service on the server, as I would expect. But, the problem is that when I try to get the byte[] array from the ImageWrapper, it is null... Any ideas why? The wrapper class looks like:
package soap.service.model;
public class ImageWrapper {
private byte[] content;
public void setContent(byte[] content) {
this.content = content;
}
public byte[] getImg() {
return this.content;
}
}
and the client looks like:
import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import soap.service.model.ImageWrapper;
import soap.service.sei.ImageSei;
public class ImageClient {
public static void main(String... args) throws MalformedURLException {
URL url = new URL("http://localhost:8080/image?wsdl");
QName qname = new QName("http://impl.service.soap/", "ImageImplService");
Service service = Service.create(url, qname);
ImageSei sei = service.getPort(ImageSei.class);
ImageWrapper iw = sei.getImage();// This is ok
System.out.println(iw.getImg()); // * This is null
}
}
========================================================================
Update Even if I change the byte array in ImageWrapper to a String, it
still comes back as 'null' in the client. I have my web service set to use
'Document' style also.
Your interface object (the one getting serialized and being transfered) does not contain public data (only a method to get private data). Your byte[] should be a public field or property to be included in the serialized data