public void setEncodingStyle(String arg0) throws SOAPException { delegateElement.setEncodingStyle(arg0); }
public void setEncodingStyle(String arg0) throws SOAPException { delegateElement.setEncodingStyle(arg0); }
public void setEncodingStyle(String arg0) throws SOAPException { delegateHeader.setEncodingStyle(arg0); }
public void setEncodingStyle(String string) throws SOAPException { delegateElement.setEncodingStyle(string); }
/** * Utility method for creating the root element for the body of a SOAP * message. */ protected SOAPElement addRootElement(SOAPMessage message, final QName name) throws SOAPException { SOAPBody body = message.getSOAPBody(); SOAPElement rootElement = body.addChildElement(name); rootElement.setEncodingStyle(NS_SOAP_ENCODING); rootElement.addNamespaceDeclaration("xsi", NS_XMLSCHEMA_INSTANCE); rootElement.addNamespaceDeclaration("xsd", NS_XMLSCHEMA); rootElement.addNamespaceDeclaration("act", NS_ACTIVEBPEL_ADMIN); return rootElement; }
@Test public void test() throws Exception { MessageFactory messageFactory = MessageFactory.newInstance(); SOAPMessage soapMessage = messageFactory.createMessage(); SOAPPart soapPart = soapMessage.getSOAPPart(); SOAPEnvelope soapEnvelope = soapPart.getEnvelope(); soapEnvelope.addNamespaceDeclaration("xsd", "http://www.w3.org/2001/XMLSchema"); soapEnvelope.addNamespaceDeclaration("xsi", "http://www.w3.org/2001/XMLSchema-instance"); soapEnvelope.addNamespaceDeclaration("bran", "BDetail"); SOAPBody soapBody = soapEnvelope.getBody(); SOAPElement soapElement = soapBody.addChildElement( "sentIbBTyp", "bran"); soapElement .setEncodingStyle("http://schemas.xmlsoap.org/soap/encoding/"); SOAPElement elementBankCode = soapElement.addChildElement("pBnCode"); // added missing attribute QName qname = new QName("xsi:type"); elementBankCode.addAttribute(qname, "xsd:string"); elementBankCode.setValue("234"); soapMessage.writeTo(System.out); }