|
hi all...
i am hoping this is a simple request, but, i have developed a Java web service running under LINUX, and from what i can see, the service is coming up quite nicely... but...
i am using a C# app to call the web service, and i keep on getting a java.rmi.RemoteException coming up during debug, but no info on what that exception has in it...
is there any way of getting the exception message so i can handle it?
cheers and thanks in advance...
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
|
|
|
|
|
Where is the exception occuring? On the client or server? Unless the generated web service proxy also contains a definition of the java.rmi.RemoteException , this information wouldn't be available to the client because that exception doesn't exist in the .NET FCL. The exception on the client should've been wrapped in a generic Exception (typically). Depending on mappings, the Message property may or may not have a message associated with it (other than any generic, default message that might be configured).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hi heath...
thanks for the quick response...
long story short, the error is occuring at the server end (on a LINUX server running AXIS)...
i would suggest that the web service proxy doesn't have the definition as the Java2WSDL and WSDL2Java are, from my understanding, not designed with .NET clients in mind...
i am wondering 'how' i am meant to go about wrapping the exception, or if there is a better way you could suggest...
thanks again, i appreciate the help...
cheers
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
|
|
|
|
|
You don't wrap it. If an exception occurs, the client should see it, even if it's a generic error wrapped in an Exception class.
If you're getting an exception on the server, you'll simply need to debug what's going on.
There are problems when mixing Java and .NET for web services, typically when you use types that either aren't correctly defined in the WSDL. The class generator (same as wsdl.exe on the command-line) might not be generating the right classes.
Without specifics, it's hard to say.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
hmm... no probs...
please tell what specifics you need that will help you help me...
as for the class itself, the interface is from memory (as the code is at work)...
<br />
public interface SysReport extends (...)<br />
{<br />
java.lang.String[] runReport(java.lang.String var1,..., java.lang.String[] err);<br />
}<br />
there are whole lot of variables in the middle, which i just can't remember right now, but i will send them once i get to work...
cheers and thanks for your help so far...
nik
Nik Vogiatzis
PhD Candidate: University of South Australia
+++++++++++++++++++++++++++
Developing new generation Traffic Micro-simulation Tools for Traffic Engineers
|
|
|
|
|
Hi,
I was wondering if anyone has seen an example of how one can send an HTTPWebRequest, passing in a schema to define what information your sending and have an app, aspx? file retrieve process the request and send a response
Kind Regards,
Rik
|
|
|
|
|
You just need to upload the file via POST. If you look at the HttpWebRequest.GetRequestStream method documentation in the .NET Framework SDK, you'll find a nice example.
Note that this uses POST, though, not GET (which uses the query string). Sending a schema via GET is riddled with problems, one of which is size restrictions. A GET query string can only be so long (128 bytes, IIRC), and schemas can easily break that barrier.
In ASP.NET, there is an easy way to get files that are uploaded. See the HttpRequest.Files property documentation in the SDK. Use Page.Request to get the HttpRequest , then enumerate the Files property. Do what you need with the schema then send your response using the Page.Response property (an HttpResponse ).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi Guys,
I'm trying to compile my C# class into DLL but unfortunately, the csc command is missing. "csc is not recognized as internal/external command." Is there any other way to compile it. I developed the class using VS .net under c#. Please if you could help me by directing me to sites that has the solution...
thanks in advance i'm a little bit in a hurry becuase of the deadline.
regards
/dabuskol
|
|
|
|
|
Why not just go and change the properties of the solution. Change the output type to class library in the output type of the general tab in common properties. Build your solution, go to your debug folder and collect your dll from there.
Tarakeshwar
CCIE Q(Routing and Switching), MCSE Security
|
|
|
|
|
Thank you very much.... I didn't know that. I will to incorporate my dll to my new solution.
regards
/dabuskol
|
|
|
|
|
If you're not using VS.NET, you either need to type the fully qualified path to csc.exe or add the directory it's in to your PATH environment variable (recommended so you don't need to type the path all the time). For .NET 1.0 and 1.1, the paths are listed below:- .NET 1.0: %WINDIR%\Microsoft.NET\Framework\v1.0.3705
- .NET 1.1: %WINDIR%\Microsoft.NET\Framework\v1.1.4322
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Health,
Thank you. I will try this when I do the recompilation. Anyhow, I tried to incorporate it in my new porject and it's working perfectly. I'm happy to say that this is my first class that is 100% my own ops in C#. he!he!he! "reusable codes"....
Regards
/dabuskol
PS: I'm new to c#
|
|
|
|
|
Hi,
1. I Designed MyEditor inherited UITypeEditor
public class MyEditor: System.Drawing.Design.UITypeEditor
{
private IWindowsFormsEditorService edSvc = null;
public override object EditValue(ITypeDescriptorContext context,
IServiceProvider provider, object value)
{
if (context != null&& context.Instance != null
&& provider != null)
{
edSvc = (IWindowsFormsEditorService)provider.GetService(typeof
(IWindowsFormsEditorService));
if (edSvc != null)
{
// Form Create
FormMyEditor dlg = new FormMyEditor((string) value);
if( edSvc.ShowDialog(dlg) == DialogResult.OK)
{
context.OnComponentChanged();
}
}
}
return value;
}
public override UITypeEditorEditStyle GetEditStyle
(ITypeDescriptorContext context)
{
if (context != null && context.Instance != null)
{
return UITypeEditorEditStyle.Modal;
}
return base.GetEditStyle(context);
}
}
2. Mapped MyEditor at Property
public class UserInfo
{
private string userName = string.Empty;
[Category("UserInfo"),DesignOnly(false)]
[Editor(typeof(MyEditor), typeof(UITypeEditor))]
public string UserName
{
get {return userName;}
set { userName = value; }
}
public UserInfo(){}
}
3.At RunTime, generally, MyEditor worked well at form application.
but, MyEditor did not work in other form application.
.NET called default string editor.
why .NET didn't call MyEditor in some case ?
thanks to regards!
|
|
|
|
|
How is your editor being invoked? Design-time components are required in order to work with the ComponentModel features of .NET. This doesn't mean they're limited to use at design-time (we use them in our runtime application), but the write objects must exist.
For example, the PropertyGrid provides design-time facilities even at runtime, using the ComponentModel. If you are trying to invoke your editor programmatically, you must also provide implementations of the ITypeDescriptorContext , IServiceProvider (that can return an instance of what services you need, like the IWindowsFormsEditorService ), etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I have code that subtracts two variables (type: double). The problem happends when both variables have the same value (should get 0)...
change = grandTotal - totalPayments;
but result is: 1.4210854715202E-14
(found that out with the MessageBox)
It's mucking up my if statement:
if (change > 0)
thanks,
Ron
|
|
|
|
|
doubles are not accurate they will often contain rounding errors.
You should used double.Epsilon to deal with it.
For example code to test equality should do something like this:
if (Math.Abs(testValueA - testValueB) <= double.Epsilon)
{
}
So your if statement could be something like:
if (change > double.Epsilon)
{
}
Does this help?
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Thanks Colin,
I didn't realize that double would be so buggy.
Ron
|
|
|
|
|
myNameIsRon wrote:
I didn't realize that double would be so buggy
Its not buggy - That how double works. As the precision of floating point operations on processors increases the problem will decrease, but it will never go away completely.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
The Second EuroCPian Event will be in Brussels on the 4th of September
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
My Blog
|
|
|
|
|
Are you working with money (I can guess it from the variables)? So why use Double if you could use Decimal type for money.
Just my 1 cent
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Hi Serge,
Thanks, I thought that double would be sufficient...
but I guess not! Using decimal fixes the problem )
Ron
|
|
|
|
|
Hi Ron,
As far as I know, Decimal is the replacement for Currency data type that was in COM before, and it naturally fits in SQL Server's money datatype.
Regards,
Serge (Logic Software, Easy Projects .NET site)
|
|
|
|
|
Dir sir
+. I'm using FAXCOMLib and C#.net for developing an application.
+. In my Application I have send a fax. But when I click button SendFax
I recevice an Error: "The handle is invalid"
What should I do ?
|
|
|
|
|
I was messing around with this code to hide my taskbar
ShowWindow(FindWindow("Shell_TrayWnd", NULL), SW_HIDE);
I think it's C or C++, but I really don't know... anyways to make it work in my C# app I just put in 0 , instead of SW_HIDE . I know SW_HIDE is in winuser.h and equals 0 , so thats why I put 0 ...
So, my question... I feel like i'm cheating "hard coding" a 0 . I would like to know how to use SW_HIDE and other things such as -- SW_SHOWNORMAL, SW_MAX etc. in winuser.h -- in my C# program the correct way.
/\ |_ E X E GG
|
|
|
|
|
They are usually just int variables , so you can do it like this:
private int SW_HIDE = 0;
Mazy
"One who dives deep gets the pearls,the burning desire for realization brings the goal nearer." - Babuji
|
|
|
|
|
yeah, that's what i'm doing right now...
/\ |_ E X E GG
|
|
|
|