<cftry>
<cfscript>
jaxWS_URL=CreateObject("Java","java.net.URL").init("http://mail.welikeit.net/Services/svcUserAdmin.asmx?wsdl");
jaxWS_QName=CreateObject("Java","javax.xml.namespace.QName").init("http://tempuri.org/","svcUserAdmin");
jaxWS_Service=createObject("Java", "javax.xml.ws.Service").create(jaxWS_URL,jaxWS_QName);
writeOutput("<div>Connected To: "&jaxWS_Service.getWSDLDocumentLocation()&"</div>");
writeDump(jaxWS_Service);
jaxWS_Ports=jaxWS_Service.getPorts();
do {
jaxWS_Port=jaxWS_Ports.next();
//writeDump(jaxWS_Port);
writeOutput("<hr><div>toString:"&jaxWS_Port.toString()&"</div>");
writeOutput("<div>getNamespaceURI:"&jaxWS_Port.getNamespaceURI()&"</div>");
writeOutput("<div>getPrefix:"&jaxWS_Port.getPrefix()&"</div>");
writeOutput("<div>getLocalPart:"&jaxWS_Port.getLocalPart()&"</div>");
} while (jaxWS_Ports.hasNext());
</cfscript>
<cfcatch type="any">
<cfdump var="#cfcatch#" />
</cfcatch>
</cftry>
With that code I am almost there, except for the connection to the port.
Java Example:
URL wsdlUrl = new URL("http://localhost:8888/service/order?wsdl");
QName qname = new QName("http://ws.memorynotfound.com/", "OrderServiceImplService");
Service service = Service.create(wsdlUrl, qname);
OrderService orderService = service.getPort(OrderService.class);
System.out.println(Arrays.toString(orderService.getOrders()));
System.out.println("Order completed: " + orderService.addOrder("Mother Board"));
Do you see: “getPort(OrderService.class)” above… ? I just can’t replicate that call in coldfusion script. In my case I am trying to connect and call the function GetUsers so if it were strictly java, I would use GetUsers.class but that is not a solution in cfscript.
I tried:
oClass = createObject("java", "java.lang.Class");
bClass = oClass.forName("GetUsers");
But the above code does not create a named class object … It tries to connect to an already existing class.
Please Help