/** * Creates an instance of {@link WSBinding} (which is conceptually an "use" * of {@link BindingID}) from a {@link BindingID}. * * @return * Always a new instance. */ public final @NotNull WSBinding createBinding() { return BindingImpl.create(this); }
Codec getCodec() { if (codec == null) { codec = ((BindingImpl) seiModel.getWSBinding()).createCodec(); } return codec; }
@Override public final W3CEndpointReference getEndpointReference() { if (binding.getBindingID().equals(HTTPBinding.HTTP_BINDING)) { throw new java.lang.UnsupportedOperationException( ClientMessages.UNSUPPORTED_OPERATION("BindingProvider.getEndpointReference()", "XML/HTTP Binding", "SOAP11 or SOAP12 Binding")); } return getEndpointReference(W3CEndpointReference.class); }
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface, BindingImpl existingBinding) { if (existingBinding != null) { webServiceFeatures.addAll(existingBinding.getFeatures()); } Iterable<WebServiceFeature> configFeatures; //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving // ability to turn off the WSDL/Policy based features and its associated tubes. //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration if (portModel != null) { // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(), // So, using here WsdlModel for merging is right. // merge features from WSDL configFeatures = portModel.getFeatures(); } else { configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName); } webServiceFeatures.mergeFeatures(configFeatures, false); // merge features from interceptor webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false); BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray()); owner.getHandlerConfigurator().configureHandlers(this,bindingImpl); return bindingImpl; }
@Override Source toReturnValue(Packet response) { Message msg = response.getMessage(); try { return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream()); } catch (IOException e) { throw new RuntimeException(e); } }
private void configureRequestPacket(Packet packet, RequestContext requestContext) { // fill in Packet packet.proxy = this; packet.handlerConfig = binding.getHandlerConfig(); // to make it multi-thread safe we need to first get a stable snapshot Header[] hl = userOutboundHeaders; if (hl != null) { MessageHeaders mh = packet.getMessage().getHeaders(); for (Header h : hl) { mh.add(h); } } requestContext.fill(packet, (binding.getAddressingVersion() != null)); packet.addSatellite(wsdlProperties); if (addrVersion != null) { // populate request WS-Addressing headers MessageHeaders headerList = packet.getMessage().getHeaders(); AddressingUtils.fillRequestAddressingHeaders(headerList, wsdlPort, binding, packet); // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled, // but the EPR has ReferenceParameters. // Current approach: Add ReferenceParameters only if addressing enabled. if (endpointReference != null) { endpointReference.addReferenceParametersToList(packet.getMessage().getHeaders()); } } }
ComponentFeature cf = binding.getFeature(ComponentFeature.class); if (cf != null && Target.STUB.equals(cf.getTarget())) { components.add(cf.getComponent()); ComponentsFeature csf = binding.getFeature(ComponentsFeature.class); if (csf != null) { for (ComponentFeature cfi : csf.getComponentFeatures()) { addrVersion = binding.getAddressingVersion();
/** * Creates a {@link Tube} that invokes protocol and logical handlers. */ public @NotNull Tube createHandlerTube(@NotNull Tube next) { if (!binding.getHandlerChain().isEmpty()) { HandlerTube cousin = new ServerLogicalHandlerTube(binding, seiModel, wsdlModel, next); next = cousin; if (binding instanceof SOAPBinding) { //Add SOAPHandlerTube next = cousin = new ServerSOAPHandlerTube(binding, next, cousin); //Add MessageHandlerTube next = new ServerMessageHandlerTube(seiModel, binding, next, cousin); } } return next; }
public static void initializeJavaActivationHandlers() { // DataHandler.writeTo() may search for DCH. So adding some default ones. try { CommandMap map = CommandMap.getDefaultCommandMap(); if (map instanceof MailcapCommandMap) { MailcapCommandMap mailMap = (MailcapCommandMap) map; // registering our DCH since javamail's DCH doesn't handle if (!cmdMapInitialized(mailMap)) { mailMap.addMailcap("text/xml;;x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); mailMap.addMailcap("application/xml;;x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); mailMap.addMailcap("image/*;;x-java-content-handler=com.sun.xml.internal.ws.encoding.ImageDataContentHandler"); mailMap.addMailcap("text/plain;;x-java-content-handler=com.sun.xml.internal.ws.encoding.StringDataContentHandler"); } } } catch (Throwable t) { // ignore the exception. } }
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface, BindingImpl existingBinding) { if (existingBinding != null) { webServiceFeatures.addAll(existingBinding.getFeatures()); } Iterable<WebServiceFeature> configFeatures; //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving // ability to turn off the WSDL/Policy based features and its associated tubes. //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration if (portModel != null) { // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(), // So, using here WsdlModel for merging is right. // merge features from WSDL configFeatures = portModel.getFeatures(); } else { configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName); } webServiceFeatures.mergeFeatures(configFeatures, false); // merge features from interceptor webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false); BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray()); owner.getHandlerConfigurator().configureHandlers(this,bindingImpl); return bindingImpl; }
@Override Source toReturnValue(Packet response) { Message msg = response.getMessage(); try { return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream()); } catch (IOException e) { throw new RuntimeException(e); } }
private void configureRequestPacket(Packet packet, RequestContext requestContext) { // fill in Packet packet.proxy = this; packet.handlerConfig = binding.getHandlerConfig(); // to make it multi-thread safe we need to first get a stable snapshot Header[] hl = userOutboundHeaders; if (hl != null) { MessageHeaders mh = packet.getMessage().getHeaders(); for (Header h : hl) { mh.add(h); } } requestContext.fill(packet, (binding.getAddressingVersion() != null)); packet.addSatellite(wsdlProperties); if (addrVersion != null) { // populate request WS-Addressing headers MessageHeaders headerList = packet.getMessage().getHeaders(); AddressingUtils.fillRequestAddressingHeaders(headerList, wsdlPort, binding, packet); // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled, // but the EPR has ReferenceParameters. // Current approach: Add ReferenceParameters only if addressing enabled. if (endpointReference != null) { endpointReference.addReferenceParametersToList(packet.getMessage().getHeaders()); } } }
ComponentFeature cf = binding.getFeature(ComponentFeature.class); if (cf != null && Target.STUB.equals(cf.getTarget())) { components.add(cf.getComponent()); ComponentsFeature csf = binding.getFeature(ComponentsFeature.class); if (csf != null) { for (ComponentFeature cfi : csf.getComponentFeatures()) { addrVersion = binding.getAddressingVersion();
/** * Creates a {@link Tube} that invokes protocol and logical handlers. */ public @NotNull Tube createHandlerTube(@NotNull Tube next) { if (!binding.getHandlerChain().isEmpty()) { HandlerTube cousin = new ServerLogicalHandlerTube(binding, seiModel, wsdlModel, next); next = cousin; if (binding instanceof SOAPBinding) { //Add SOAPHandlerTube next = cousin = new ServerSOAPHandlerTube(binding, next, cousin); //Add MessageHandlerTube next = new ServerMessageHandlerTube(seiModel, binding, next, cousin); } } return next; }
public static void initializeJavaActivationHandlers() { // DataHandler.writeTo() may search for DCH. So adding some default ones. try { CommandMap map = CommandMap.getDefaultCommandMap(); if (map instanceof MailcapCommandMap) { MailcapCommandMap mailMap = (MailcapCommandMap) map; // registering our DCH since javamail's DCH doesn't handle if (!cmdMapInitialized(mailMap)) { mailMap.addMailcap("text/xml;;x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); mailMap.addMailcap("application/xml;;x-java-content-handler=com.sun.xml.internal.ws.encoding.XmlDataContentHandler"); mailMap.addMailcap("image/*;;x-java-content-handler=com.sun.xml.internal.ws.encoding.ImageDataContentHandler"); mailMap.addMailcap("text/plain;;x-java-content-handler=com.sun.xml.internal.ws.encoding.StringDataContentHandler"); } } } catch (Throwable t) { // ignore the exception. } }
/** * Creates an instance of {@link WSBinding} (which is conceptually an "use" * of {@link BindingID}) from a {@link BindingID}. * * @return * Always a new instance. */ public final @NotNull WSBinding createBinding() { return BindingImpl.create(this); }
public BindingImpl createBinding(WebServiceFeatureList webServiceFeatures, Class<?> portInterface, BindingImpl existingBinding) { if (existingBinding != null) { webServiceFeatures.addAll(existingBinding.getFeatures()); } Iterable<WebServiceFeature> configFeatures; //TODO incase of Dispatch, provide a way to User for complete control of the message processing by giving // ability to turn off the WSDL/Policy based features and its associated tubes. //Even in case of Dispatch, merge all features configured via WSDL/Policy or deployment configuration if (portModel != null) { // could have merged features from this.policyMap, but some features are set in WSDLModel which are not there in PolicyMap // for ex: <wsaw:UsingAddressing> wsdl extn., and since the policyMap features are merged into WSDLModel anyway during postFinished(), // So, using here WsdlModel for merging is right. // merge features from WSDL configFeatures = portModel.getFeatures(); } else { configFeatures = PolicyUtil.getPortScopedFeatures(policyMap, owner.getServiceName(),portName); } webServiceFeatures.mergeFeatures(configFeatures, false); // merge features from interceptor webServiceFeatures.mergeFeatures(owner.serviceInterceptor.preCreateBinding(this, portInterface, webServiceFeatures), false); BindingImpl bindingImpl = BindingImpl.create(bindingId, webServiceFeatures.toArray()); owner.getHandlerConfigurator().configureHandlers(this,bindingImpl); return bindingImpl; }
Codec getCodec() { if (codec == null) { codec = ((BindingImpl) seiModel.getWSBinding()).createCodec(); } return codec; }
@Override Source toReturnValue(Packet response) { Message msg = response.getMessage(); try { return new StreamSource(XMLMessage.getDataSource(msg, binding.getFeatures()).getInputStream()); } catch (IOException e) { throw new RuntimeException(e); } }
private void configureRequestPacket(Packet packet, RequestContext requestContext) { // fill in Packet packet.proxy = this; packet.handlerConfig = binding.getHandlerConfig(); // to make it multi-thread safe we need to first get a stable snapshot Header[] hl = userOutboundHeaders; if (hl != null) { MessageHeaders mh = packet.getMessage().getHeaders(); for (Header h : hl) { mh.add(h); } } requestContext.fill(packet, (binding.getAddressingVersion() != null)); packet.addSatellite(wsdlProperties); if (addrVersion != null) { // populate request WS-Addressing headers MessageHeaders headerList = packet.getMessage().getHeaders(); AddressingUtils.fillRequestAddressingHeaders(headerList, wsdlPort, binding, packet); // Spec is not clear on if ReferenceParameters are to be added when addressing is not enabled, // but the EPR has ReferenceParameters. // Current approach: Add ReferenceParameters only if addressing enabled. if (endpointReference != null) { endpointReference.addReferenceParametersToList(packet.getMessage().getHeaders()); } } }