Can i use JAXM to run a UDDI Query against say IBM's UDDI Registry?

Davanum Srinivas

Here's a stand-alone JAXM Client that can connect to IBM's UDDI Registry found at https://www-3.ibm.com/services/uddi/protect/registry.html.

import javax.xml.soap.*;
import javax.xml.messaging.*;
import java.util.*;
import java.io.*;

public class UddiPing {
public static void main(String[] args) {
    try {
        if (args.length != 1)  {
            System.err.println("Usage: UddiPing business-name");

        // 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();
        body.addChildElement(envelope.createName("find_business", "",
        URLEndpoint endpoint
            = new URLEndpoint("http://www-3.ibm.com/services/uddi/testregistry/inquiryapi");
        SOAPMessage reply = connection.call(msg, endpoint);
        System.out.println("Received reply from: "+endpoint);
    } catch (Exception ex) {
0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.



About | Sitemap | Contact