Search in sources :

Example 21 with WebServiceFeature

use of jakarta.xml.ws.WebServiceFeature in project metro-jax-ws by eclipse-ee4j.

the class BasicDatabindingTestBase method _testHelloEcho.

protected String _testHelloEcho() throws Exception {
    Class<?> endpointClass = HelloImpl.class;
    Class<?> proxySEIClass = HelloPort.class;
    DatabindingConfig srvConfig = new DatabindingConfig();
    srvConfig.setEndpointClass(endpointClass);
    srvConfig.setMetadataReader(new DummyAnnotations());
    DatabindingModeFeature dbm = databindingMode();
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setMetadataReader(new DummyAnnotations());
    cliConfig.setContractClass(proxySEIClass);
    // Honor system property if present, otherwise set feature.
    WebServiceFeature[] f = null;
    String dbProperty = System.getProperty(BindingContextFactory.JAXB_CONTEXT_FACTORY_PROPERTY);
    if (dbProperty == null)
        f = new WebServiceFeature[] { dbm };
    else
        f = new WebServiceFeature[0];
    srvConfig.setFeatures(f);
    cliConfig.setFeatures(f);
    HelloPort hp = createProxy(HelloPort.class, srvConfig, cliConfig, false);
    String req = "testInVM " + dbm.getMode();
    String res = hp.echoS(req);
    assertEquals(req, res);
    return srvConfig.properties().get(BindingContext.class.getName()).getClass().getName();
}
Also used : DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) DummyAnnotations(com.sun.xml.ws.base.DummyAnnotations) HelloImpl(com.sun.xml.ws.test.HelloImpl) HelloPort(com.sun.xml.ws.test.HelloPort) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) DatabindingModeFeature(com.oracle.webservices.api.databinding.DatabindingModeFeature) BindingContext(com.sun.xml.ws.spi.db.BindingContext)

Example 22 with WebServiceFeature

use of jakarta.xml.ws.WebServiceFeature in project metro-jax-ws by eclipse-ee4j.

the class EndpointFactory method create.

public <T> WSEndpoint<T> create(Class<T> implType, boolean processHandlerAnnotation, @Nullable Invoker invoker, @Nullable QName serviceName, @Nullable QName portName, @Nullable Container container, @Nullable WSBinding binding, @Nullable SDDocumentSource primaryWsdl, @Nullable Collection<? extends SDDocumentSource> metadata, EntityResolver resolver, boolean isTransportSynchronous, boolean isStandard) {
    if (implType == null)
        throw new IllegalArgumentException();
    MetadataReader metadataReader = getExternalMetadatReader(implType, binding);
    if (isStandard) {
        verifyImplementorClass(implType, metadataReader);
    }
    if (invoker == null) {
        invoker = InstanceResolver.createDefault(implType).createInvoker();
    }
    // Performance analysis indicates that reading and parsing imported schemas is
    // a major component of Endpoint creation time.  Therefore, modify SDDocumentSource
    // handling to delay iterating collection as long as possible.
    Collection<SDDocumentSource> md = new CollectionCollection<>();
    if (primaryWsdl != null) {
        if (metadata != null) {
            Iterator<? extends SDDocumentSource> it = metadata.iterator();
            if (it.hasNext() && primaryWsdl.equals(it.next()))
                md.addAll(metadata);
            else {
                md.add(primaryWsdl);
                md.addAll(metadata);
            }
        } else
            md.add(primaryWsdl);
    } else if (metadata != null)
        md.addAll(metadata);
    if (container == null)
        container = ContainerResolver.getInstance().getContainer();
    if (serviceName == null)
        serviceName = getDefaultServiceName(implType, metadataReader);
    if (portName == null)
        portName = getDefaultPortName(serviceName, implType, metadataReader);
    {
        // error check
        String serviceNS = serviceName.getNamespaceURI();
        String portNS = portName.getNamespaceURI();
        if (!serviceNS.equals(portNS)) {
            throw new ServerRtException("wrong.tns.for.port", portNS, serviceNS);
        }
    }
    // setting a default binding
    if (binding == null)
        binding = BindingImpl.create(BindingID.parse(implType));
    if (isStandard && primaryWsdl != null) {
        verifyPrimaryWSDL(primaryWsdl, serviceName);
    }
    QName portTypeName = null;
    if (isStandard && implType.getAnnotation(WebServiceProvider.class) == null) {
        portTypeName = RuntimeModeler.getPortTypeName(implType, metadataReader);
    }
    // Categorises the documents as WSDL, Schema etc
    Collection<SDDocumentImpl> docList = categoriseMetadata(md.iterator(), serviceName, portTypeName);
    // Finds the primary WSDL and makes sure that metadata doesn't have
    // two concrete or abstract WSDLs
    SDDocumentImpl primaryDoc = primaryWsdl != null ? SDDocumentImpl.create(primaryWsdl, serviceName, portTypeName) : findPrimary(docList);
    EndpointAwareTube terminal;
    WSDLPort wsdlPort = null;
    AbstractSEIModelImpl seiModel = null;
    // create WSDL model
    if (primaryDoc != null) {
        wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container, resolver);
    }
    WebServiceFeatureList features = ((BindingImpl) binding).getFeatures();
    if (isStandard) {
        features.parseAnnotations(implType);
    }
    PolicyMap policyMap = null;
    // create terminal pipe that invokes the application
    if (isUseProviderTube(implType, isStandard)) {
        // TODO incase of Provider, 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 Provider, merge all features configured via WSDL/Policy or deployment configuration
        Iterable<WebServiceFeature> configFtrs;
        if (wsdlPort != null) {
            policyMap = wsdlPort.getOwner().getParent().getPolicyMap();
            // Merge features from WSDL and other policy configuration
            configFtrs = wsdlPort.getFeatures();
        } else {
            // No WSDL, so try to merge features from Policy configuration
            policyMap = PolicyResolverFactory.create().resolve(new PolicyResolver.ServerContext(null, container, implType, false));
            configFtrs = PolicyUtil.getPortScopedFeatures(policyMap, serviceName, portName);
        }
        features.mergeFeatures(configFtrs, true);
        terminal = createProviderInvokerTube(implType, binding, invoker, container);
    } else {
        // Create runtime model for non Provider endpoints
        seiModel = createSEIModel(wsdlPort, implType, serviceName, portName, binding, primaryDoc);
        if (binding instanceof SOAPBindingImpl) {
            // set portKnownHeaders on Binding, so that they can be used for MU processing
            ((SOAPBindingImpl) binding).setPortKnownHeaders(((SOAPSEIModel) seiModel).getKnownHeaders());
        }
        // Generate WSDL for SEI endpoints(not for Provider endpoints)
        if (primaryDoc == null) {
            primaryDoc = generateWSDL(binding, seiModel, docList, container, implType);
            // create WSDL model
            wsdlPort = getWSDLPort(primaryDoc, docList, serviceName, portName, container, resolver);
            seiModel.freeze(wsdlPort);
        }
        policyMap = wsdlPort.getOwner().getParent().getPolicyMap();
        // New Features might have been added in WSDL through Policy.
        // Merge features from WSDL and other policy configuration
        // This sets only the wsdl features that are not already set(enabled/disabled)
        features.mergeFeatures(wsdlPort.getFeatures(), true);
        terminal = createSEIInvokerTube(seiModel, invoker, binding);
    }
    // Process @HandlerChain, if handler-chain is not set via Deployment Descriptor
    if (processHandlerAnnotation) {
        processHandlerAnnotation(binding, implType, serviceName, portName);
    }
    // Selects only required metadata for this endpoint from the passed-in metadata
    if (primaryDoc != null) {
        docList = findMetadataClosure(primaryDoc, docList, resolver);
    }
    ServiceDefinitionImpl serviceDefiniton = (primaryDoc != null) ? new ServiceDefinitionImpl(docList, primaryDoc) : null;
    return create(serviceName, portName, binding, container, seiModel, wsdlPort, implType, serviceDefiniton, terminal, isTransportSynchronous, policyMap);
}
Also used : BindingImpl(com.sun.xml.ws.binding.BindingImpl) SOAPBindingImpl(com.sun.xml.ws.binding.SOAPBindingImpl) AbstractSEIModelImpl(com.sun.xml.ws.model.AbstractSEIModelImpl) QName(javax.xml.namespace.QName) MetadataReader(com.sun.xml.ws.api.databinding.MetadataReader) WebServiceFeatureList(com.sun.xml.ws.binding.WebServiceFeatureList) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort) SDDocumentSource(com.sun.xml.ws.api.server.SDDocumentSource) PolicyMap(com.sun.xml.ws.policy.PolicyMap) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) SOAPBindingImpl(com.sun.xml.ws.binding.SOAPBindingImpl)

Example 23 with WebServiceFeature

use of jakarta.xml.ws.WebServiceFeature in project metro-jax-ws by eclipse-ee4j.

the class SwaMimeAttachmentTest method testAttachmentContentId.

public void testAttachmentContentId() throws Exception {
    WSDLPort wsdlPort = getWSDLPort(getResource("WSW2JDLSwaTestService.wsdl"));
    Class proxySEIClass = SwaTest1.class;
    WebServiceFeature[] f = { databindingMode() };
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(proxySEIClass);
    cliConfig.setFeatures(f);
    cliConfig.setWsdlPort(wsdlPort);
    cliConfig.setWsdlPort(wsdlPort);
    cliConfig.getMappingInfo().setServiceName(new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService"));
    Databinding cli = (Databinding) factory.createRuntime(cliConfig);
    URL url1 = getResource("attach.text");
    URL url2 = getResource("attach.html");
    URL url3 = getResource("attach.xml");
    URL url4 = getResource("attach.jpeg1");
    URL url5 = getResource("attach.jpeg2");
    DataHandler dh1 = new DataHandler(url1);
    DataHandler dh2 = new DataHandler(url2);
    DataHandler dh3 = new DataHandler(url3);
    // DataHandler dh4 = new DataHandler(url4);
    // DataHandler dh5 = new DataHandler(url5);
    jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach1 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
    attach1.value = dh1;
    jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach2 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
    attach2.value = dh2;
    jakarta.xml.ws.Holder<javax.xml.transform.Source> attach3 = new jakarta.xml.ws.Holder<javax.xml.transform.Source>();
    attach3.value = new StreamSource(dh3.getInputStream());
    jakarta.xml.ws.Holder<java.awt.Image> attach4 = new jakarta.xml.ws.Holder<java.awt.Image>();
    jakarta.xml.ws.Holder<java.awt.Image> attach5 = new jakarta.xml.ws.Holder<java.awt.Image>();
    attach4.value = javax.imageio.ImageIO.read(url4);
    attach5.value = javax.imageio.ImageIO.read(url5);
    VoidRequest request = new VoidRequest();
    Object[] args = { request, attach1, attach2, attach3, attach4, attach5 };
    Method method = findMethod(proxySEIClass, "echoAllAttachmentTypes");
    JavaCallInfo cliCall = cli.createJavaCallInfo(method, args);
    Packet cliSoapReq = (Packet) cli.serializeRequest(cliCall);
    SOAPMessageContextImpl smc = new SOAPMessageContextImpl(null, cliSoapReq, null);
    Map<String, DataHandler> smcAtts1 = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    smc.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, smcAtts1);
    assertEquals(5, smcAtts1.size());
    for (String cid : smcAtts1.keySet()) assertTrue(cid.charAt(0) != '<');
    for (com.sun.xml.ws.api.message.Attachment a : cliSoapReq.getMessage().getAttachments()) assertTrue(a.getContentId().charAt(0) != '<');
    Object s1 = cliSoapReq.getAsSOAPMessage();
    Object s2 = smc.getMessage();
    assertTrue(s1 == s2);
    for (com.sun.xml.ws.api.message.Attachment a : cliSoapReq.getMessage().getAttachments()) assertTrue(a.getContentId().charAt(0) != '<');
    // {
    // Map<String, DataHandler> atts = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    // AttachmentSet attSet = cliSoapReq.getMessage().getAttachments();
    // for(String cid : atts.keySet()){
    // if (attSet.get(cid) == null) {  // Otherwise we would be adding attachments twice
    // Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
    // attSet.add(att);
    // }
    // }
    // }
    Map<String, DataHandler> smcAtts2 = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    assertEquals(5, smcAtts1.size());
    for (String cid : smcAtts2.keySet()) assertTrue(cid.charAt(0) != '<');
}
Also used : DataHandler(jakarta.activation.DataHandler) Image(java.awt.Image) URL(java.net.URL) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort) Databinding(com.sun.xml.ws.api.databinding.Databinding) Attachment(com.sun.xml.ws.api.message.Attachment) JavaCallInfo(com.oracle.webservices.api.databinding.JavaCallInfo) Packet(com.sun.xml.ws.api.message.Packet) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) Method(java.lang.reflect.Method) SOAPMessageContextImpl(com.sun.xml.ws.handler.SOAPMessageContextImpl) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) HashMap(java.util.HashMap) Map(java.util.Map) MailcapCommandMap(jakarta.activation.MailcapCommandMap) CommandMap(jakarta.activation.CommandMap)

Example 24 with WebServiceFeature

use of jakarta.xml.ws.WebServiceFeature in project metro-jax-ws by eclipse-ee4j.

the class SwaMimeAttachmentTest method testCTS_WsiDocLitSwaTest.

public void testCTS_WsiDocLitSwaTest() throws Exception {
    WSDLPort wsdlPort = getWSDLPort(getResource("WSW2JDLSwaTestService.wsdl"));
    Class endpointClass = SwaTestImpl1.class;
    Class proxySEIClass = SwaTest1.class;
    DatabindingConfig srvConfig = new DatabindingConfig();
    srvConfig.setEndpointClass(endpointClass);
    // srvConfig.setMetadataReader(new DummyAnnotations());
    WebServiceFeature[] f = { databindingMode() };
    srvConfig.setFeatures(f);
    srvConfig.setWsdlPort(wsdlPort);
    DatabindingConfig cliConfig = new DatabindingConfig();
    // cliConfig.setMetadataReader(new DummyAnnotations());
    cliConfig.setContractClass(proxySEIClass);
    cliConfig.setFeatures(f);
    cliConfig.setWsdlPort(wsdlPort);
    CommandMap map = CommandMap.getDefaultCommandMap();
    ((MailcapCommandMap) map).addMailcap("image/*;;x-java-content-handler=com.sun.xml.messaging.saaj.soap.ImageDataContentHandler");
    SwaTest1 port = createProxy(SwaTest1.class, srvConfig, cliConfig, false);
    {
        URL url1 = getResource("attach.text");
        URL url2 = getResource("attach.html");
        URL url3 = getResource("attach.xml");
        URL url4 = getResource("attach.jpeg1");
        URL url5 = getResource("attach.jpeg2");
        DataHandler dh1 = new DataHandler(url1);
        DataHandler dh2 = new DataHandler(url2);
        DataHandler dh3 = new DataHandler(url3);
        DataHandler dh4 = new DataHandler(url4);
        DataHandler dh5 = new DataHandler(url5);
        jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach1 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
        attach1.value = dh1;
        jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach2 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
        attach2.value = dh2;
        jakarta.xml.ws.Holder<javax.xml.transform.Source> attach3 = new jakarta.xml.ws.Holder<javax.xml.transform.Source>();
        attach3.value = new StreamSource(dh3.getInputStream());
        jakarta.xml.ws.Holder<java.awt.Image> attach4 = new jakarta.xml.ws.Holder<java.awt.Image>();
        jakarta.xml.ws.Holder<java.awt.Image> attach5 = new jakarta.xml.ws.Holder<java.awt.Image>();
        attach4.value = javax.imageio.ImageIO.read(url4);
        attach5.value = javax.imageio.ImageIO.read(url5);
        VoidRequest request = new VoidRequest();
        OutputResponseAll response = port.echoAllAttachmentTypes(request, attach1, attach2, attach3, attach4, attach5);
        assertTrue(ValidateRequestResponseAttachmentsEchoAllTestCase(request, response, attach1, attach2, attach3, attach4, attach5));
    }
    {
        InputRequestGet request = new InputRequestGet();
        URL url1 = getResource("attach.text");
        URL url2 = getResource("attach.html");
        request.setMimeType1("text/plain");
        request.setMimeType2("text/html");
        request.setUrl1(url1.toString());
        request.setUrl2(url2.toString());
        jakarta.xml.ws.Holder<DataHandler> attach1 = new jakarta.xml.ws.Holder<DataHandler>();
        jakarta.xml.ws.Holder<DataHandler> attach2 = new jakarta.xml.ws.Holder<DataHandler>();
        jakarta.xml.ws.Holder<OutputResponse> response = new jakarta.xml.ws.Holder<OutputResponse>();
        port.getMultipleAttachments(request, response, attach1, attach2);
        assertTrue(ValidateRequestResponseAttachmentsGetTestCase(request, response.value, attach1, attach2));
    }
    {
        jakarta.xml.ws.Holder<byte[]> data = new jakarta.xml.ws.Holder<byte[]>();
        // InputStream in = getSwaAttachmentURL("attach.jpeg1").openStream();
        // java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
        // byte[] bytes = new byte[4096];
        // int read = in.read(bytes);
        // while (read != -1) {
        // baos.write(bytes, 0, read);
        // read = in.read(bytes);
        // }
        java.awt.Image image = javax.imageio.ImageIO.read(getResource("attach.jpeg1"));
        java.io.ByteArrayOutputStream baos = new java.io.ByteArrayOutputStream();
        javax.imageio.ImageIO.write((java.awt.image.RenderedImage) image, "jpeg", baos);
        data.value = baos.toByteArray();
        byte[] bytes = baos.toByteArray();
        port.echoData("EnableMIMEContent = false", data);
    // for ( int i = 0; i < data.value.length; i++ ) {
    // assertTrue(bytes[i] == data.value[i]);
    // }
    }
}
Also used : MailcapCommandMap(jakarta.activation.MailcapCommandMap) DataHandler(jakarta.activation.DataHandler) Image(java.awt.Image) URL(java.net.URL) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort) StreamSource(javax.xml.transform.stream.StreamSource) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) MailcapCommandMap(jakarta.activation.MailcapCommandMap) CommandMap(jakarta.activation.CommandMap)

Example 25 with WebServiceFeature

use of jakarta.xml.ws.WebServiceFeature in project metro-jax-ws by eclipse-ee4j.

the class SwaMimeAttachmentTest method testCustomAttachmentContentId.

public void testCustomAttachmentContentId() throws Exception {
    WSDLPort wsdlPort = getWSDLPort(getResource("WSW2JDLSwaTestService.wsdl"));
    Class proxySEIClass = SwaTest1.class;
    WebServiceFeature[] f = { databindingMode() };
    DatabindingConfig cliConfig = new DatabindingConfig();
    cliConfig.setContractClass(proxySEIClass);
    cliConfig.setFeatures(f);
    cliConfig.setWsdlPort(wsdlPort);
    cliConfig.setWsdlPort(wsdlPort);
    cliConfig.getMappingInfo().setServiceName(new QName("http://SwaTestService.org/wsdl", "WSIDLSwaTestService"));
    Databinding cli = (Databinding) factory.createRuntime(cliConfig);
    URL url1 = getResource("attach.text");
    URL url2 = getResource("attach.html");
    URL url3 = getResource("attach.xml");
    URL url4 = getResource("attach.jpeg1");
    URL url5 = getResource("attach.jpeg2");
    DataHandler dh1 = new DataHandler(url1);
    DataHandler dh2 = new DataHandler(url2);
    DataHandler dh3 = new DataHandler(url3);
    DataHandler dh4 = new DataHandler(url4);
    // DataHandler dh5 = new DataHandler(url5);
    jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach1 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
    attach1.value = dh1;
    jakarta.xml.ws.Holder<jakarta.activation.DataHandler> attach2 = new jakarta.xml.ws.Holder<jakarta.activation.DataHandler>();
    attach2.value = dh2;
    jakarta.xml.ws.Holder<javax.xml.transform.Source> attach3 = new jakarta.xml.ws.Holder<javax.xml.transform.Source>();
    attach3.value = new StreamSource(dh3.getInputStream());
    jakarta.xml.ws.Holder<java.awt.Image> attach4 = new jakarta.xml.ws.Holder<java.awt.Image>();
    jakarta.xml.ws.Holder<java.awt.Image> attach5 = new jakarta.xml.ws.Holder<java.awt.Image>();
    attach4.value = javax.imageio.ImageIO.read(url4);
    attach5.value = javax.imageio.ImageIO.read(url5);
    VoidRequest request = new VoidRequest();
    Object[] args = { request, attach1, attach2, attach3, attach4, attach5 };
    Method method = findMethod(proxySEIClass, "echoAllAttachmentTypes");
    JavaCallInfo cliCall = cli.createJavaCallInfo(method, args);
    Packet cliSoapReq = (Packet) cli.serializeRequest(cliCall);
    String customContentId = "<abcd@example.org>";
    Map<String, DataHandler> attMap = new HashMap<String, DataHandler>();
    attMap.put(customContentId, dh4);
    cliSoapReq.invocationProperties.put(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS, attMap);
    SOAPMessageContextImpl smc = new SOAPMessageContextImpl(null, cliSoapReq, null);
    Map<String, DataHandler> smcAtts1 = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    assertEquals(6, smcAtts1.size());
    assertNotNull(smcAtts1.get(customContentId));
    {
        // ClientSOAPHandlerTube.callHandlersOnRequest
        Map<String, DataHandler> atts = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
        AttachmentSet attSet = cliSoapReq.getMessage().getAttachments();
        for (String cid : atts.keySet()) {
            if (attSet.get(cid) == null) {
                // Otherwise we would be adding attachments twice
                Attachment att = new DataHandlerAttachment(cid, atts.get(cid));
                attSet.add(att);
            }
        }
    }
    int attCount = 0;
    for (com.sun.xml.ws.api.message.Attachment a : cliSoapReq.getMessage().getAttachments()) {
        // assertTrue(a.getContentId().charAt(0)!='<');
        attCount++;
    }
    assertEquals(6, attCount);
    Object s1 = cliSoapReq.getAsSOAPMessage();
    Object s2 = smc.getMessage();
    assertTrue(s1 == s2);
    int attCountSaaj = 0;
    for (com.sun.xml.ws.api.message.Attachment a : cliSoapReq.getMessage().getAttachments()) {
        assertTrue(a.getContentId().charAt(0) != '<');
        attCountSaaj++;
    }
    assertEquals(6, attCountSaaj);
    Map<String, DataHandler> smcAtts2 = (Map<String, DataHandler>) smc.get(MessageContext.OUTBOUND_MESSAGE_ATTACHMENTS);
    assertEquals(6, smcAtts2.size());
    // System.out.println(smcAtts2.size() + " " + smcAtts2);
    assertNotNull(smcAtts2.get(customContentId));
}
Also used : DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) HashMap(java.util.HashMap) DataHandlerAttachment(com.sun.xml.ws.message.DataHandlerAttachment) Attachment(com.sun.xml.ws.api.message.Attachment) DataHandler(jakarta.activation.DataHandler) Image(java.awt.Image) URL(java.net.URL) StreamSource(javax.xml.transform.stream.StreamSource) Source(javax.xml.transform.Source) WSDLPort(com.sun.xml.ws.api.model.wsdl.WSDLPort) Databinding(com.sun.xml.ws.api.databinding.Databinding) AttachmentSet(com.sun.xml.ws.api.message.AttachmentSet) Attachment(com.sun.xml.ws.api.message.Attachment) JavaCallInfo(com.oracle.webservices.api.databinding.JavaCallInfo) Packet(com.sun.xml.ws.api.message.Packet) QName(javax.xml.namespace.QName) StreamSource(javax.xml.transform.stream.StreamSource) Method(java.lang.reflect.Method) SOAPMessageContextImpl(com.sun.xml.ws.handler.SOAPMessageContextImpl) DatabindingConfig(com.sun.xml.ws.api.databinding.DatabindingConfig) WebServiceFeature(jakarta.xml.ws.WebServiceFeature) HashMap(java.util.HashMap) Map(java.util.Map) MailcapCommandMap(jakarta.activation.MailcapCommandMap) CommandMap(jakarta.activation.CommandMap)

Aggregations

WebServiceFeature (jakarta.xml.ws.WebServiceFeature)52 DatabindingModeFeature (com.oracle.webservices.api.databinding.DatabindingModeFeature)19 DatabindingConfig (com.sun.xml.ws.api.databinding.DatabindingConfig)19 QName (javax.xml.namespace.QName)13 BindingImpl (com.sun.xml.ws.binding.BindingImpl)6 SchemaInfo (com.sun.xml.ws.db.sdo.SchemaInfo)6 SOAPMessage (jakarta.xml.soap.SOAPMessage)6 File (java.io.File)6 Method (java.lang.reflect.Method)6 Map (java.util.Map)6 WSDLPort (com.sun.xml.ws.api.model.wsdl.WSDLPort)5 MTOMFeature (jakarta.xml.ws.soap.MTOMFeature)5 HashMap (java.util.HashMap)5 Databinding (com.oracle.webservices.api.databinding.Databinding)4 DatabindingFactory (com.oracle.webservices.api.databinding.DatabindingFactory)4 JavaCallInfo (com.oracle.webservices.api.databinding.JavaCallInfo)4 ImpliesWebServiceFeature (com.sun.xml.ws.api.ImpliesWebServiceFeature)4 MemberSubmissionAddressingFeature (com.sun.xml.ws.developer.MemberSubmissionAddressingFeature)4 BindingContext (com.sun.xml.ws.spi.db.BindingContext)4 HelperContext (commonj.sdo.helper.HelperContext)4