Examples of SoapMessage


Examples of com.arjuna.webservices.SoapMessage

                client.invokeOneWay(soapBodyMessage, toURI) ;
                return null ;
            }
        }
       
        final SoapMessage response = client.invoke(soapBodyMessage, toURI) ;
        if (response instanceof SoapBodyMessage)
        {
            return ((SoapBodyMessage)response).getSoapBody() ;
        }
        throw new IOException(WSCLogger.log_mesg.getString("com.arjuna.webservices.wsaddr2005.client.WSAddr2005Client_5")) ;
View Full Code Here

Examples of com.consol.citrus.ws.message.SoapMessage

    @Override
    public void send(Message message, TestContext context) {
        Assert.notNull(message, "Message is empty - unable to send empty message");

        SoapMessage soapMessage;
        if (message instanceof SoapMessage) {
            soapMessage = (SoapMessage) message;
        } else {
            soapMessage = new SoapMessage(message);
        }

        String correlationKey = getEndpointConfiguration().getCorrelator().getCorrelationKey(soapMessage);
        context.saveCorrelationKey(correlationKey, this);

        String endpointUri;
        if (getEndpointConfiguration().getEndpointResolver() != null) {
            endpointUri = getEndpointConfiguration().getEndpointResolver().resolveEndpointUri(soapMessage, getEndpointConfiguration().getDefaultUri());
        } else { // use default uri
            endpointUri = getEndpointConfiguration().getDefaultUri();
        }

        log.info("Sending SOAP message to endpoint: '" + endpointUri + "'");

        if (log.isDebugEnabled()) {
            log.debug("Message to send is:\n" + soapMessage.toString());
        }

        if (!(soapMessage.getPayload() instanceof String)) {
            throw new CitrusRuntimeException("Unsupported payload type '" + soapMessage.getPayload().getClass() +
                    "' Currently only 'java.lang.String' is supported as payload type.");
        }

        SoapRequestMessageCallback requestCallback = new SoapRequestMessageCallback(soapMessage, getEndpointConfiguration());
View Full Code Here

Examples of com.izforge.soapdtc.SoapMessage

    }

    public void testSendReceive() throws DocumentException, IOException, XmlPullParserException, SoapTransportException
    {
        HttpSoapTransport soapTransport = new HttpSoapTransport();
        SoapMessage message = SoapMessageUtils.readSoapMessageFromStream(SoapMessageTest.class
                .getResourceAsStream("simple-soap-message.xml"));

        SoapMessage response = soapTransport.sendReceive("http://localhost:8085/dtc", message, null);
        assertEquals(0, nodeComparator.compare(message, response));
    }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

            out.println("\nOutbound message:");
        } else {
            out.println("\nInbound message:");
        }

        SOAPMessage message = smc.getMessage();
        try {
            message.writeTo(out);
            out.println();
        } catch (Exception e) {
            out.println("Exception in handler: " + e);
        }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        "<faultstring>Server did not recognize the value of HTTP Header SOAPAction: .</faultstring>"+
        "<detail/></soap:Fault></soap:Body></soap:Envelope>";

      java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
     
      SOAPMessage soapMessage=javax.xml.soap.MessageFactory.newInstance().createMessage(null,
                is);
     
      is.close();
     
      javax.wsdl.factory.WSDLFactory fact=
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
          "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";

        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
        System.out.println("Invoking server through Dispatch interface using SOAPMessage");
        SOAPMessage soapResp = dispatcher.invoke(soapReq1);
       
        String result=soapResp.getSOAPBody().getTextContent();
       
        System.out.println("Response from server: " + result);

            return result.contains("Hello World");
        } catch (Exception ex) {
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

       
        String str="<soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsdl=\"http://www.jboss.org/bpel/examples/wsdl\">"+
            "<soapenv:Header/><soapenv:Body><wsdl:hello><TestPart>Hello</TestPart></wsdl:hello></soapenv:Body></soapenv:Envelope>";
        java.io.InputStream is=new java.io.ByteArrayInputStream(str.getBytes());
       
        SOAPMessage soapReq1 = factory.createMessage(null, is);
       
          System.out.println("Invoking server through Dispatch interface using SOAPMessage");
          SOAPMessage soapResp = dispatcher.invoke(soapReq1);
          System.out.println("Response from server: " + soapResp.getSOAPBody().getTextContent());
         
        System.exit(0);
    }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        //We need to get a new mex from persistence layer.
        PartnerRoleMessageExchange mex = (PartnerRoleMessageExchange) engine.getBpelServer().getEngine().getMessageExchange(mexId);
            try
            {
              // Create SOAPMessage
              SOAPMessage soapRequestMessage = MessageFactory.newInstance().createMessage();
              if(log.isDebugEnabled())
                log.debug( "ODE outbound message: \n" +DOMWriter.printNode(mex.getRequest().getMessage(), true) );
             
              String soapAction=messageAdapter.createSoapRequest(soapRequestMessage,
                      new ODEMessageAdapter(mex.getRequest()), mex.getOperation());
             
              if (log.isDebugEnabled()) {
                log.debug("Riftsaw soap request message: \n" + JavaUtils.getSoapMessageASString(soapRequestMessage));
              }
             
              org.apache.ode.bpel.iapi.EndpointReference odeepr=mex.getEndpointReference();
              javax.xml.ws.EndpointReference epr=null;
             
              if (odeepr != null) {
                if (odeepr instanceof org.apache.ode.bpel.epr.URLEndpoint) {
                  org.apache.ode.bpel.epr.URLEndpoint url=(org.apache.ode.bpel.epr.URLEndpoint)odeepr;
                 
                  javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder builder=
                        new javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder();
                 
                  epr = builder.address(url.getUrl())
                          .serviceName(serviceName)
                          .endpointName(port)
                          .build();
                 
                  if (log.isDebugEnabled()) {
                    log.debug("EPR = " + epr);
                  }
                }
               
              } else if (log.isDebugEnabled()) {
                log.debug("ODE has no EPR for this message exchange");
              }
             
              // The actual WS invocation
              Dispatch<SOAPMessage> proxy = getDispatcher(epr, port);
              setEndpointFromUDDI(proxy);
             
              try {
                // Set SOAPAction
                if (soapAction != null) {
                  // Setting soap action using both approaches, as CXF needs one and JBossWS-Native the other
                  proxy.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, soapAction);
                  MimeHeaders hd = soapRequestMessage.getMimeHeaders();
                  hd.addHeader("SOAPAction", soapAction);
                } else if (log.isDebugEnabled()) {
                  log.debug("SOAPAction not set");
                }

                // Set client side timeout for the invocation
                proxy.getRequestContext().put("javax.xml.ws.client.receiveTimeout", Long.toString(timeout));
               
                  SOAPMessage soapResponseMessage = proxy.invoke(soapRequestMessage);

                  if (log.isDebugEnabled()) {
                    log.debug("Riftsaw soap response message: \n" + JavaUtils.getSoapMessageASString(soapResponseMessage));
                  }
                 
                  // Create ODE response
                  Message odeResponse = mex.createMessage(mex.getOperation().getOutput().getMessage().getQName());
                  if(soapResponseMessage.getSOAPBody().hasFault())
                  {
                    // fault handling
                    Document odeMsg = DOMUtils.newDocument();
                    Element odeMsgEl = odeMsg.createElementNS(null, "message");
                    odeMsg.appendChild(odeMsgEl);
                   
                    Fault fault = messageAdapter.parseSoapFault(odeMsgEl, soapResponseMessage, mex.getOperation());

                    handleFault(mex, fault, soapResponseMessage.getSOAPBody().getFault(), odeMsgEl);
                   
                  }
                  else
                  {
                    messageAdapter.parseSoapResponse(new ODEMessageAdapter(odeResponse),
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

            out.println("\nOutbound message:");
        } else {
            out.println("\nInbound message:");
        }

        SOAPMessage message = smc.getMessage();
        try {
            message.writeTo(out);
            out.println();
        } catch (Exception e) {
            out.println("Exception in handler: " + e);
        }
View Full Code Here

Examples of javax.xml.soap.SOAPMessage

        //We need to get a new mex from persistence layer.
        PartnerRoleMessageExchange mex = (PartnerRoleMessageExchange) engine.getBpelServer().getEngine().getMessageExchange(mexId);
                try
                {
                  // Create SOAPMessage
                  SOAPMessage soapRequestMessage = MessageFactory.newInstance().createMessage();
                  if(log.isDebugEnabled())
                    log.debug( "ODE outbound message: \n" +DOMWriter.printNode(mex.getRequest().getMessage(), true) );
                 
              String soapAction=messageAdapter.createSoapRequest(soapRequestMessage,
                          new ODEMessageAdapter(mex.getRequest()), mex.getOperation());

                  if (log.isDebugEnabled()) {
                    log.debug("Riftsaw soap request message: \n" + JavaUtils.getSoapMessageASString(soapRequestMessage));
                  }
                 
                org.apache.ode.bpel.iapi.EndpointReference odeepr=mex.getEndpointReference();
                javax.xml.ws.EndpointReference epr=null;
               
                if (odeepr != null) {
                  if (odeepr instanceof org.apache.ode.bpel.epr.URLEndpoint) {
                    org.apache.ode.bpel.epr.URLEndpoint url=(org.apache.ode.bpel.epr.URLEndpoint)odeepr;
                   
                    javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder builder=
                          new javax.xml.ws.wsaddressing.W3CEndpointReferenceBuilder();
                   
                    epr = builder.address(url.getUrl())
                            .serviceName(serviceName)
                            .endpointName(port)
                            .build();
                   
                    if (log.isDebugEnabled()) {
                      log.debug("EPR = " + epr);
                    }
                  }
                 
                } else if (log.isDebugEnabled()) {
                  log.debug("ODE has no EPR for this message exchange");
                }
               
                  // The actual WS invocation
                  Dispatch<SOAPMessage> proxy = getDispatcher(epr, port);
                  setEndpointFromUDDI(proxy);
                 
                  // Set SOAPAction
                  if (soapAction != null) {
                    // Setting soap action using both approaches, as CXF needs one and JBossWS-Native the other
                    proxy.getRequestContext().put(Dispatch.SOAPACTION_URI_PROPERTY, soapAction);
                    MimeHeaders hd = soapRequestMessage.getMimeHeaders();
                    hd.addHeader("SOAPAction", soapAction);
                  } else if (log.isDebugEnabled()) {
                    log.debug("SOAPAction not set");
                  }
                 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.