/** * Specifies the URL where the proxy can find the WSDL defining the * service the proxy implements. * * @param wsdlURL a string containing the WSDL's URL */ public void setWsdlLocation(String wsdlURL) { setWsdlURL(wsdlURL); }
/** * Specifies the URL where the proxy can find the WSDL defining the * service the proxy implements. * * @param wsdlURL a string containing the WSDL's URL */ public void setWsdlLocation(String wsdlURL) { setWsdlURL(wsdlURL); }
@Test public void testSimpleClientWithWsdl() throws Exception { QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstServicePort"); QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstService"); ClientProxyFactoryBean factory = new ClientProxyFactoryBean(); factory.setWsdlURL(ServerMisc.DOCLIT_CODEFIRST_URL + "?wsdl"); factory.setServiceName(servName); factory.setServiceClass(DocLitWrappedCodeFirstService.class); factory.setEndpointName(portName); DocLitWrappedCodeFirstService port = (DocLitWrappedCodeFirstService) factory.create(); assertNotNull(port); String echoMsg = port.echo("Hello"); assertEquals("Hello", echoMsg); }
@Test public void testSimpleClientWithWsdlAndBindingId() throws Exception { QName portName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstServicePort"); QName servName = new QName("http://cxf.apache.org/systest/jaxws/DocLitWrappedCodeFirstService", "DocLitWrappedCodeFirstService"); ClientProxyFactoryBean factory = new ClientProxyFactoryBean(); factory.setBindingId("http://cxf.apache.org/bindings/xformat"); factory.setWsdlURL(ServerMisc.DOCLIT_CODEFIRST_URL_XMLBINDING + "?wsdl"); factory.setServiceName(servName); factory.setServiceClass(DocLitWrappedCodeFirstService.class); factory.setEndpointName(portName); factory.setAddress(ServerMisc.DOCLIT_CODEFIRST_URL_XMLBINDING); DocLitWrappedCodeFirstService port = (DocLitWrappedCodeFirstService) factory.create(); assertNotNull(port); assertEquals(factory.getBindingId(), "http://cxf.apache.org/bindings/xformat"); assertTrue(ClientProxy.getClient(port).getEndpoint().getBinding() instanceof XMLBinding); String echoMsg = port.echo("Hello"); assertEquals("Hello", echoMsg); }