Netbeans and .NET Network Services

I am not an experienced Java developer, so any comments would be welcome ...

I wrote a web service using C #, and I wanted to use this service from java - Netbeans was used for this.

All methods work well next to one: a method that expects a type of BusinessDataField2 - this type contains 2 fields: name (string) and value (object)

These fields are filled using get, set methods - this works easily in the .NET environment.

But...

I see that Java requires different parameters for the get and set methods - parameter:

JAXBElement JAXBElement

The question is: how do I instantiate this object? I tried many different ways, but nothing worked ...

Thanks, Ofer

+1
source share
2 answers

You cannot use an object type. It can be any actual type, but you are not telling the Java side what to expect. Thus, the best he can do is process the actual XML values.

Consider: an object can be int, or it can be some complex structure. How does the Java side know what to do with it? The Java side would not even have proxy classes for a complex structure, because you never told it that you could ever return a complex structure.

+2
source

I would recommend using the CXF web services framework to use your web service. It can scan your wsdl file and generate Java objects matching your .net objects.

They have a HOWTO on their website.

0
source

All Articles