Search in sources :

Example 1 with WSDLServiceFactory

use of org.apache.cxf.wsdl11.WSDLServiceFactory in project cxf by apache.

the class BareInInterceptorTest method setUpUsingHelloWorld.

private void setUpUsingHelloWorld() throws Exception {
    String ns = "http://apache.org/hello_world_soap_http";
    WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource("/wsdl/jaxb/hello_world.wsdl").toString(), new QName(ns, "SOAPService"));
    service = factory.create();
    endpointInfo = service.getServiceInfos().get(0).getEndpoint(new QName(ns, "SoapPort"));
    endpoint = new EndpointImpl(bus, service, endpointInfo);
    JAXBDataBinding db = new JAXBDataBinding();
    db.setContext(JAXBContext.newInstance(new Class[] { GreetMe.class, GreetMeResponse.class }));
    service.setDataBinding(db);
    operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
    operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(GreetMe.class);
    operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(GreetMeResponse.class);
    message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    message.setExchange(exchange);
    exchange.put(Service.class, service);
    exchange.put(Endpoint.class, endpoint);
    exchange.put(Binding.class, endpoint.getBinding());
}
Also used : GreetMe(org.apache.hello_world_soap_http.types.GreetMe) Exchange(org.apache.cxf.message.Exchange) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) GreetMeResponse(org.apache.hello_world_soap_http.types.GreetMeResponse) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 2 with WSDLServiceFactory

use of org.apache.cxf.wsdl11.WSDLServiceFactory in project cxf by apache.

the class BareInInterceptorTest method setUpUsingDocLit.

private void setUpUsingDocLit() throws Exception {
    String ns = "http://apache.org/hello_world_doc_lit_bare";
    WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource("/wsdl/jaxb/doc_lit_bare.wsdl").toString(), new QName(ns, "SOAPService"));
    service = factory.create();
    endpointInfo = service.getServiceInfos().get(0).getEndpoint(new QName(ns, "SoapPort"));
    endpoint = new EndpointImpl(bus, service, endpointInfo);
    JAXBDataBinding db = new JAXBDataBinding();
    db.setContext(JAXBContext.newInstance(new Class[] { TradePriceData.class }));
    service.setDataBinding(db);
    operation = endpointInfo.getBinding().getOperation(new QName(ns, "SayHi"));
    operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
    operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
    message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    message.setExchange(exchange);
    exchange.put(Service.class, service);
    exchange.put(Endpoint.class, endpoint);
    exchange.put(Binding.class, endpoint.getBinding());
}
Also used : Exchange(org.apache.cxf.message.Exchange) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) TradePriceData(org.apache.hello_world_doc_lit_bare.types.TradePriceData) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 3 with WSDLServiceFactory

use of org.apache.cxf.wsdl11.WSDLServiceFactory in project cxf by apache.

the class DocLiteralInInterceptorTest method setUpUsingHelloWorld.

private void setUpUsingHelloWorld() throws Exception {
    String ns = "http://apache.org/hello_world_soap_http";
    WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource("/wsdl/jaxb/hello_world.wsdl").toString(), new QName(ns, "SOAPService"));
    service = factory.create();
    endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPort"));
    endpoint = new EndpointImpl(bus, service, endpointInfo);
    JAXBDataBinding db = new JAXBDataBinding();
    db.setContext(JAXBContext.newInstance(new Class[] { GreetMe.class, GreetMeResponse.class }));
    service.setDataBinding(db);
    operation = endpointInfo.getBinding().getOperation(new QName(ns, "greetMe"));
    operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(GreetMe.class);
    operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(GreetMeResponse.class);
    message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    message.setExchange(exchange);
    exchange.put(Service.class, service);
    exchange.put(Endpoint.class, endpoint);
    exchange.put(Binding.class, endpoint.getBinding());
}
Also used : GreetMe(org.apache.hello_world_soap_http.types.GreetMe) Exchange(org.apache.cxf.message.Exchange) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) GreetMeResponse(org.apache.hello_world_soap_http.types.GreetMeResponse) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Example 4 with WSDLServiceFactory

use of org.apache.cxf.wsdl11.WSDLServiceFactory in project cxf by apache.

the class TestUtils method setupServiceInfo.

public EndpointInfo setupServiceInfo(String ns, String wsdl, String serviceName, String portName) throws Exception {
    URL wsdlUrl = getClass().getResource(wsdl);
    WSDLServiceFactory f = new WSDLServiceFactory(bus, wsdlUrl.toString(), new QName(ns, serviceName));
    Service service = f.create();
    return service.getEndpointInfo(new QName(ns, portName));
}
Also used : WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) QName(javax.xml.namespace.QName) Service(org.apache.cxf.service.Service) URL(java.net.URL)

Example 5 with WSDLServiceFactory

use of org.apache.cxf.wsdl11.WSDLServiceFactory in project cxf by apache.

the class DocLiteralInInterceptorTest method setUpUsingDocLit.

private void setUpUsingDocLit() throws Exception {
    String ns = "http://apache.org/hello_world_doc_lit_bare";
    WSDLServiceFactory factory = new WSDLServiceFactory(bus, getClass().getResource("/wsdl/jaxb/doc_lit_bare.wsdl").toString(), new QName(ns, "SOAPService"));
    service = factory.create();
    endpointInfo = service.getEndpointInfo(new QName(ns, "SoapPort"));
    endpoint = new EndpointImpl(bus, service, endpointInfo);
    JAXBDataBinding db = new JAXBDataBinding();
    db.setContext(JAXBContext.newInstance(new Class[] { TradePriceData.class }));
    service.setDataBinding(db);
    operation = endpointInfo.getBinding().getOperation(new QName(ns, "SayHi"));
    operation.getOperationInfo().getInput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
    operation.getOperationInfo().getOutput().getMessagePartByIndex(0).setTypeClass(TradePriceData.class);
    message = new MessageImpl();
    Exchange exchange = new ExchangeImpl();
    message.setExchange(exchange);
    exchange.put(Service.class, service);
    exchange.put(Endpoint.class, endpoint);
    exchange.put(Binding.class, endpoint.getBinding());
}
Also used : Exchange(org.apache.cxf.message.Exchange) WSDLServiceFactory(org.apache.cxf.wsdl11.WSDLServiceFactory) QName(javax.xml.namespace.QName) EndpointImpl(org.apache.cxf.endpoint.EndpointImpl) TradePriceData(org.apache.hello_world_doc_lit_bare.types.TradePriceData) MessageImpl(org.apache.cxf.message.MessageImpl) ExchangeImpl(org.apache.cxf.message.ExchangeImpl)

Aggregations

WSDLServiceFactory (org.apache.cxf.wsdl11.WSDLServiceFactory)19 QName (javax.xml.namespace.QName)14 Service (org.apache.cxf.service.Service)12 EndpointImpl (org.apache.cxf.endpoint.EndpointImpl)8 EndpointInfo (org.apache.cxf.service.model.EndpointInfo)7 URL (java.net.URL)6 Exchange (org.apache.cxf.message.Exchange)5 ExchangeImpl (org.apache.cxf.message.ExchangeImpl)5 MessageImpl (org.apache.cxf.message.MessageImpl)5 ServiceInfo (org.apache.cxf.service.model.ServiceInfo)5 SourceDataBinding (org.apache.cxf.databinding.source.SourceDataBinding)4 ClientImpl (org.apache.cxf.endpoint.ClientImpl)4 Endpoint (org.apache.cxf.endpoint.Endpoint)4 Definition (javax.wsdl.Definition)3 ExtensibilityElement (javax.wsdl.extensions.ExtensibilityElement)3 WSDLManager (org.apache.cxf.wsdl.WSDLManager)3 IOException (java.io.IOException)2 ArrayList (java.util.ArrayList)2 WebService (javax.jws.WebService)2 Schema (javax.wsdl.extensions.schema.Schema)2