Tom T
Tom T

Reputation: 273

Using a SOAP artifact in Java

I've been searching all over and I can't find a simple example for this. I need to call a Web service from my Java application using SOAP. I've run the utility to create all the Java artifacts from the WSDL. Let's say one is called "Customer", and these are the first few lines:

@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "Customer", propOrder = { "id" })
public class Customer {

I assume that I start by creating a new Customer object and setting all the attributes I need. What I need to know is how to take that object and pass it to the service as a SOAP envelope(?). I also have artifacts for submit, like "SubmitCustomer", but again I'm not sure how to take my Customer object and keep going with it.

I'm sure this is a basic question, but all I've been able to find in my searches are examples of creating your own XML, or basic "how to get started with SOAP", or how to generate artifacts, but that's all. If someone can point me to a good resource, that would be great.

Upvotes: 0

Views: 184

Answers (1)

Alexandr Ivanov
Alexandr Ivanov

Reputation: 399

Among generated classes must be one extends javax.xml.ws.Service.
Look through this class to find a method annotated with @WebEndpoint.
Open file with definition of return type of this method.
There you will find methods correspond to WSDL operations.

Upvotes: 1

Related Questions