SOAPEnvelope.addNamespaceDeclaration
Code IndexAdd Codota to your IDE (free)

Best code snippets using javax.xml.soap.SOAPEnvelope.addNamespaceDeclaration(Showing top 15 results out of 315)

  • Common ways to obtain SOAPEnvelope
private void myMethod () {
SOAPEnvelope s =
  • SOAPMessage sOAPMessage;sOAPMessage.getSOAPPart().getEnvelope()
  • SOAPPart sOAPPart;sOAPPart.getEnvelope()
  • SOAPPart sOAPPart;sOAPPart.getEnvelope()
  • Smart code suggestions by Codota
}
origin: org.jboss.ws.native/jbossws-native-core

/** Create the SOAP-1.1 message */
protected SOAPMessage createMessage(OperationMetaData opMetaData) throws SOAPException
{
 SOAPMessage soapMessage = msgFactory.createMessage();
 
 Use encStyle = opMetaData.getEndpointMetaData().getEncodingStyle();
 if (Use.ENCODED.equals(encStyle))
 {
   SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
   soapEnvelope.addNamespaceDeclaration(Constants.PREFIX_SOAP11_ENC, Constants.URI_SOAP11_ENC);
 }
    return soapMessage;
}
origin: org.keycloak/keycloak-services

public SoapMessageBuilder addNamespace(String prefix, String ns) {
  try {
    envelope.addNamespaceDeclaration(prefix, ns);
  } catch (SOAPException e) {
    throw new RuntimeException("Could not add namespace to SOAP Envelope.", e);
  }
  return this;
}
origin: stackoverflow.com

 SOAPEnvelope envelope = soapPart.getEnvelope();
envelope.addNamespaceDeclaration("xsi","http://www.w3.org/2001/XMLSchema-instance");
SOAPBody soapBody = envelope.getBody();
SOAPElement soapBodyElem = soapBody.addChildElement( "GetUserInfo" );
SOAPElement soapBodyElem1 = soapBodyElem.addChildElement( "ArgComKey" );
soapBodyElem1.addTextNode( "ComKey" ).setAttribute("xsi:type","xsd:integer");
SOAPElement soapBodyElem2 = soapBodyElem.addChildElement( "Arg" );
soapBodyElem2.addTextNode( "123" );
origin: stackoverflow.com

SOAPMessage message = factory.createMessage();
   SOAPPart soapPart = message.getSOAPPart();
   SOAPEnvelope envelope = soapPart.getEnvelope();
   //add declaration here
   envelope.addNamespaceDeclaration("env", "http://som.org");
   SOAPHeader header = envelope.getHeader();
   SOAPBody body = envelope.getBody();
   SOAPElement envio = body.addChildElement("envio");
   envio.setPrefix("env");
   //explicit declare it here for this element
   envio.addNamespaceDeclaration("env", "http://som.org");
   SOAPElement cabecera = envio.addChildElement("cabecera","env");
origin: stackoverflow.com

MessageFactory messageFactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL); 
 SOAPMessage soapMessage = messageFactory.createMessage(); 
 SOAPPart soapPart = soapMessage.getSOAPPart(); 
 SOAPEnvelope soapEnvelope = soapPart.getEnvelope(); 
 SOAPBody soapBody = soapEnvelope.getBody(); 
 soapEnvelope.removeNamespaceDeclaration(soapEnvelope.getPrefix()); 
 soapEnvelope.addNamespaceDeclaration("soap", "http://schemas.xmlsoap.org/soap/envelope/"); 
 soapEnvelope.setPrefix("soap"); 
 soapBody.setPrefix("soap"); 
 soapEnvelope.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance"); 
 soapEnvelope.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema");   soapMessage.getSOAPHeader().detachNode(); 
 soapMessage.getMimeHeaders().setHeader("SOAPAction", "http://www.example.com/TransactionProcess");
origin: stackoverflow.com

 SOAPEnvelope env = sp.getEnvelope();
env.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema");
env.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
origin: org.apache.cxf/cxf-rt-frontend-jaxws

  private SOAPMessage initSOAPMessage(InputStream is) throws SOAPException, IOException {
    SOAPMessage msg = null;
    if (is != null) {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage(null, is);
    } else {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage();
    }
    msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSD,
                                WSDLConstants.NS_SCHEMA_XSD);
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSI,
                                WSDLConstants.NS_SCHEMA_XSI);

    return msg;
  }
}
origin: stackoverflow.com

private static SOAPMessage createSOAPRequest(String documentId,
 String fileToUpdate) throws Exception { 
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage soapMessage = messageFactory.createMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
String serverURI = "urn:WSFS";                      // change form "WSFS" to "urn:WSFS"
SOAPEnvelope envelope = soapPart.getEnvelope();
envelope.addNamespaceDeclaration("urn", serverURI); // this line will add namespece in your envelope
...
origin: stackoverflow.com

 MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage soapMessage = messageFactory.createMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();

SOAPEnvelope envelope = soapPart.getEnvelope();
envelope.addNamespaceDeclaration("ns", "website");
envelope.addNamespaceDeclaration("com", "website/Common");
envelope.addNamespaceDeclaration("xm", "http://www.w3.org/2005/05/xmlmime");
SOAPBody soapBody = envelope.getBody();
SOAPElement element = soapBody.addChildElement("RequestName", "ns");
SOAPElement modelElement = element.addChildElement("model", "ns");
SOAPElement soapElement = modelElement.addChildElement("keys", "ns");
soapElement.addAttribute(envelope.createName("query"), "myquery;");
modelElement.addChildElement("instance", "ns");

soapMessage.saveChanges();
soapMessage.writeTo(System.out);
origin: stackoverflow.com

 SOAPEnvelope envelope = soapPart.getEnvelope();
envelope.addNamespaceDeclaration("sh", serverURI );

//added code here
envelope.addNamespaceDeclaration("user", "http://www.website.com/ems/soap/sh/userdata" );
envelope.addNamespaceDeclaration("ser", "http://www.website.com/ems/soap/sh/servicedata" );
origin: org.keycloak/keycloak-services

public SoapMessageBuilder addNamespace(String prefix, String ns) {
  try {
    envelope.addNamespaceDeclaration(prefix, ns);
  } catch (SOAPException e) {
    throw new RuntimeException("Could not add namespace to SOAP Envelope.", e);
  }
  return this;
}
origin: org.keycloak/keycloak-services

public SoapMessageBuilder addNamespace(String prefix, String ns) {
  try {
    envelope.addNamespaceDeclaration(prefix, ns);
  } catch (SOAPException e) {
    throw new RuntimeException("Could not add namespace to SOAP Envelope.", e);
  }
  return this;
}
origin: stackoverflow.com

 SOAPEnvelope env = sp.getEnvelope();
env.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema");
env.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance");
origin: org.apache.cxf/cxf-bundle

  private SOAPMessage initSOAPMessage(InputStream is) throws SOAPException, IOException {
    SOAPMessage msg = null;
    if (is != null) {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage(null, is);
    } else {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage();
    }
    msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSD,
                                WSDLConstants.NS_SCHEMA_XSD);
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSI,
                                WSDLConstants.NS_SCHEMA_XSI);

    return msg;
  }  
}
origin: org.apache.cxf/cxf-bundle-minimal

  private SOAPMessage initSOAPMessage(InputStream is) throws SOAPException, IOException {
    SOAPMessage msg = null;
    if (is != null) {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage(null, is);
    } else {
      msg = SAAJFactoryResolver.createMessageFactory(null).createMessage();
    }
    msg.setProperty(SOAPMessage.WRITE_XML_DECLARATION, "true");
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSD,
                                WSDLConstants.NS_SCHEMA_XSD);
    msg.getSOAPPart().getEnvelope().addNamespaceDeclaration(WSDLConstants.NP_SCHEMA_XSI,
                                WSDLConstants.NS_SCHEMA_XSI);

    return msg;
  }  
}
javax.xml.soapSOAPEnvelopeaddNamespaceDeclaration

Popular methods of SOAPEnvelope

  • getBody
    Returns the SOAPBody object associated with this SOAPEnvelope object. A new SOAPMessage object is b
  • getHeader
    Returns the SOAPHeader object for this SOAPEnvelope object. A new SOAPMessage object is by default
  • addHeader
    Creates a SOAPHeader object and sets it as the SOAPHeader object for this SOAPEnvelope object. It
  • createName
    Creates a new Name object initialized with the given local name, namespace prefix, and namespace URI
  • getNamespaceURI
  • getPrefix
  • getOwnerDocument
  • getAttributes
  • getElementName
  • addBody
    Creates a SOAPBody object and sets it as the SOAPBody object for this SOAPEnvelope object. It is i
  • getElementsByTagNameNS
  • setEncodingStyle
  • getElementsByTagNameNS,
  • setEncodingStyle,
  • createQName,
  • getDefaultNamespace,
  • getElementQName,
  • getFirstChild,
  • getLocalName,
  • getNamespacePrefixes,
  • getOMFactory

Popular classes and methods

  • getSystemService (Context)
  • setContentView (Activity)
  • getContentResolver (Context)
  • Container (java.awt)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Time (java.sql)
    Java representation of an SQL TIME value. Provides utilities to format and parse the time's represen
  • AtomicInteger (java.util.concurrent.atomic)
    An int value that may be updated atomically. See the java.util.concurrent.atomic package specificati
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • JPanel (javax.swing)

For IntelliJ IDEA,
Android Studio or Eclipse

  • Codota IntelliJ IDEA pluginCodota Android Studio pluginCode IndexSign in
  • EnterpriseFAQAboutContact Us
  • Terms of usePrivacy policyCodeboxFind Usages
Add Codota to your IDE (free)