Using the UDDI Inquiry API
UDDI is a deprecated technology and might not be supported
in future releases of PowerBuilder.
The UDDIProxy PowerBuilder extension class enables you to
search UDDI registries for a Web service that you want to access.
For a description of this extension class and its methods, see the PowerBuilder
Extension Reference or the online Help.
Example code
The following is example code using all the methods in the
UDDIProxy class. It searches an IBM UDDI registry by service name
(Weather) and business name (IBM), using the same search options
(case sensitivity and a maximum of 5 rows returned):
1 |
uddiproxy proxy |
1 |
int ret |
1 |
proxy = create uddiproxy |
1 |
ret = proxy.setinquiryurl   ("http:/www–3.ibm.com/services/uddi/inquiryapi") |
1 |
ret = proxy.setoption (false, true, 0, 5) |
1 |
int count, count2 |
1 |
string businessName[], businessDescription[] |
1 |
string businessKey [] |
1 |
string servicename[], servicedescription[] |
1 |
string servicekey [], wsdl [ ] |
1 |
ret = proxy.findService("Weather",count,serviceName, &<br>  serviceDescription, serviceKey, businessName, wsdl) |
1 |
int i, j |
1 |
FOR i = 1 TO count |
1 |
   messagebox(servicename[i], &<br>     servicedescription[i]+servicekey[i]+wsdl[i]) |
1 |
NEXT |
1 |
1 |
proxy.findbusiness("IBM", count, businessName, &<br>  businessDescription, businessKey) |
1 |
FOR i = 1 TO count |
1 |
   messagebox(businessName[i], &<br>     businessDescription[i] + businessKey[i]) |
1 |
  proxy.getbusinessdetail (businessKey [i], count2, &<br>     servicename, servicedescription, servicekey, wsdl) |
1 |
  FOR j = 1 TO count2 |
1 |
   messagebox(servicename[j], &<br>     servicedescription[j]+servicekey[j]+wsdl[j]) |
1 |
  NEXT |
1 |
NEXT |
1 |
destroy proxy |
Troubleshooting UDDI API calls
You can turn on logging to track down any failures on method
calls to the UDDIProxy object. The PowerBuilder Java service class
path must include the log4j.properties configuration
file to turn on logging. The following is an example of a log configuration
file for a UDDI search:
1 |
#log4j.debug=true |
1 |
#log all level |
1 |
#log4j.rootCategory=DEBUG, lf5 |
1 |
#only log com.sybase.powerbuilder.uddi |
1 |
log4j.category.com.sybase.powerbuilder.uddi=DEBUG,     dest2, lf5 |
1 |
#dest1 |
1 |
#log4j.appender.dest1=org.apache.log4j.ConsoleAppender |
1 |
#log4j.appender.dest1.layout=<br>    org.apache.log4j.PatternLayout |
1 |
#log4j.appender.dest1.layout.ConversionPattern=<br>    %-5p: %-5r: %-5c: %l: %m%n |
1 |
#dest2 |
1 |
log4j.appender.dest2=org.apache.log4j.FileAppender |
1 |
log4j.appender.dest2.layout=<br>    org.apache.log4j.PatternLayout |
1 |
log4j.appender.dest2.layout.ConversionPattern=<br>    %-5p: %l: %m%n |
1 |
log4j.appender.dest2.File=c:/mylog.txt |
1 |
#lf5 |
1 |
log4j.appender.lf5=<br>    org.apache.log4j.RollingFileAppender |
1 |
log4j.appender.lf5.File=c:/mylog.lf5 |
1 |
log4j.appender.lf5.layout=<br>    org.apache.log4j.PatternLayout |
1 |
log4j.appender.lf5.layout.ConversionPattern=<br>    [slf5s.start]%d{DATE}[slf5s.DATE]%n<br>    %p[slf5s.PRIORITY]%n%x[slf5s.NDC]<br>    %n%t[slf5s.THREAD]%n\%c[slf5s.CATEGORY]<br>    %n%l[slf5s.LOCATION]%n%m[slf5s.MESSAGE]%n%n |
1 |
log4j.appender.lf5.MaxFileSize=500KB |