// Create the connection and the message factory.
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection connection = scf.createConnection();
MessageFactory msgFactory = MessageFactory.newInstance();
// Create a message
SOAPMessage msg = msgFactory.createMessage();
// Create an envelope in the message
SOAPEnvelope envelope = msg.getSOAPPart().getEnvelope();
// Get hold of the the body
SOAPBody body = envelope.getBody();
javax.xml.soap.SOAPBodyElement bodyElement = body.addBodyElement(envelope.createName("find_business", "",
"urn:uddi-org:api"));
bodyElement.addAttribute(envelope.createName("generic"), "1.0")
.addAttribute(envelope.createName("maxRows"), "100")
.addChildElement("name")
.addTextNode(name);
URLEndpoint endpoint = new URLEndpoint(url);
msg.saveChanges();
SOAPMessage reply = connection.call(msg, endpoint);
//System.out.println("Received reply from: " + endpoint);
//reply.writeTo(System.out);
connection.close();