ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am trying to add Customer to a database (which is on the webservice side) by sending a Customer Object to the webservice. When the webservice receives the Customer Object it only has NULL values. So , none of the information (name, surname, address etc.) is filled in when the Webservice receives it.
Sending an integer to the Webservice works fine, receiving an array filled with Customer Objects from the Webservice works perfect. But sending a Customer object to the Webservice doesn't work properly.
I am really clueless right now how I am supposed to send an Object to a webservice. Is there anyone here who has experience with this kind of stuff. Help would be really appreciated. Thanks in advance.
Some web services might accept Java objects; most (AFAIK) don't. How would you communicate a Java object, for example, to a .Net web server?
Is this some particular web service I might know about (for example, Google)? Or is the web service in question one that you and your team have designed and implemented yourself? Or are you just curious?
Think of the web service itself as "an object", with various "method calls" that communicate with *your* object(s).
For whatever it's worth, this article might be of help:
It's a WebService written in Java, it is indeed designed by my team and we implemented it ourself yes. The WebService has a method called "addCustomer". The client will add a Customer using a GUI, when pressing the "Add Customer" button, the client will fill a Customer object with the given info from the GUI and this object will than be send to the WebService by using the client interface Classes generated from the WebService WSDL. The Customer Object is filled with data when at the client side, but when it is received on the server side all the values for a Customer (name, address etc.) are NULL.
Please pay particular attention to the part about "Compound Data types" in Part 2. This might be your best bet.
And please consider that you should
Quote:
Think of the web service itself as "an object", with various "method calls" that communicate with *your* object(s).
What this means is that, even if you figure out how to pass an "object" (and I confess, I don't know how, or know if it's even possible or not), it's probably not a good idea. Because "objects" are (by definition) language- and platform- dependent, and introducing such dependencies defeats a large part of using web services in the first place!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.