/** * returns the soap constants. */ public SOAPConstants getSOAPConstants(){ if (soapConstants != null) return soapConstants; if (msgContext != null) { soapConstants = msgContext.getSOAPConstants(); return soapConstants; } else { return Constants.DEFAULT_SOAP_VERSION; } }
/** * returns the soap constants. */ public SOAPConstants getSOAPConstants(){ if (soapConstants != null) return soapConstants; if (msgContext != null) { soapConstants = msgContext.getSOAPConstants(); return soapConstants; } else { return Constants.DEFAULT_SOAP_VERSION; } }
/** * returns the soap constants. */ public SOAPConstants getSOAPConstants(){ if (soapConstants != null) return soapConstants; if (msgContext != null) { soapConstants = msgContext.getSOAPConstants(); return soapConstants; } else { return Constants.DEFAULT_SOAP_VERSION; } }
/** * set a fault code string that is turned into a qname * in the SOAP 1.1 or 1.2 namespace, depending on the current context * @param code fault code */ public void setFaultCodeAsString(String code) { SOAPConstants soapConstants = MessageContext.getCurrentContext() == null ? SOAPConstants.SOAP11_CONSTANTS : MessageContext.getCurrentContext().getSOAPConstants(); faultCode = new QName(soapConstants.getEnvelopeURI(), code); }
/** * set a fault code string that is turned into a qname * in the SOAP 1.1 or 1.2 namespace, depending on the current context * @param code fault code */ public void setFaultCodeAsString(String code) { SOAPConstants soapConstants = MessageContext.getCurrentContext() == null ? SOAPConstants.SOAP11_CONSTANTS : MessageContext.getCurrentContext().getSOAPConstants(); faultCode = new QName(soapConstants.getEnvelopeURI(), code); }
/** * set a fault code string that is turned into a qname * in the SOAP 1.1 or 1.2 namespace, depending on the current context * @param code fault code */ public void setFaultCodeAsString(String code) { SOAPConstants soapConstants = MessageContext.getCurrentContext() == null ? SOAPConstants.SOAP11_CONSTANTS : MessageContext.getCurrentContext().getSOAPConstants(); faultCode = new QName(soapConstants.getEnvelopeURI(), code); }
/** * Add this fault and any needed headers to the output context. * * @param context * @throws Exception */ public void output(SerializationContext context) throws Exception { SOAPConstants soapConstants = Constants.DEFAULT_SOAP_VERSION; if (context.getMessageContext() != null) { soapConstants = context.getMessageContext().getSOAPConstants(); } SOAPEnvelope envelope = new SOAPEnvelope(soapConstants); SOAPFault fault = new SOAPFault(this); envelope.addBodyElement(fault); // add any headers we need if (faultHeaders != null) { for (Iterator i = faultHeaders.iterator(); i.hasNext();) { SOAPHeaderElement header = (SOAPHeaderElement) i.next(); envelope.addHeader(header); } } envelope.output(context); }
/** * Add this fault and any needed headers to the output context. * * @param context * @throws Exception */ public void output(SerializationContext context) throws Exception { SOAPConstants soapConstants = Constants.DEFAULT_SOAP_VERSION; if (context.getMessageContext() != null) { soapConstants = context.getMessageContext().getSOAPConstants(); } SOAPEnvelope envelope = new SOAPEnvelope(soapConstants); SOAPFault fault = new SOAPFault(this); envelope.addBodyElement(fault); // add any headers we need if (faultHeaders != null) { for (Iterator i = faultHeaders.iterator(); i.hasNext();) { SOAPHeaderElement header = (SOAPHeaderElement) i.next(); envelope.addHeader(header); } } envelope.output(context); }
/** * Add this fault and any needed headers to the output context. * * @param context * @throws Exception */ public void output(SerializationContext context) throws Exception { SOAPConstants soapConstants = Constants.DEFAULT_SOAP_VERSION; if (context.getMessageContext() != null) { soapConstants = context.getMessageContext().getSOAPConstants(); } SOAPEnvelope envelope = new SOAPEnvelope(soapConstants); SOAPFault fault = new SOAPFault(this); envelope.addBodyElement(fault); // add any headers we need if (faultHeaders != null) { for (Iterator i = faultHeaders.iterator(); i.hasNext();) { SOAPHeaderElement header = (SOAPHeaderElement) i.next(); envelope.addHeader(header); } } envelope.output(context); }
/** * Set the operation use * @param operationUse */ public void setOperationUse(Use operationUse) { useExplicitlySet = true; if (operation == null) { operation = new OperationDesc(); } operation.setUse(operationUse); if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationUse == Use.ENCODED) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } }
/** * Set the operation use * @param operationUse */ public void setOperationUse(Use operationUse) { useExplicitlySet = true; if (operation == null) { operation = new OperationDesc(); } operation.setUse(operationUse); if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationUse == Use.ENCODED) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } }
/** * Set the operation use * @param operationUse */ public void setOperationUse(Use operationUse) { useExplicitlySet = true; if (operation == null) { operation = new OperationDesc(); } operation.setUse(operationUse); if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationUse == Use.ENCODED) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } }
/** * Set the operation style * * @param operationStyle */ public void setOperationStyle(Style operationStyle) { if (operation == null) { operation = new OperationDesc(); } operation.setStyle(operationStyle); // If no one has explicitly set the use, we should track // the style. If it's non-RPC, default to LITERAL. if (!useExplicitlySet) { if (operationStyle != Style.RPC) { operation.setUse(Use.LITERAL); } } // If no one has explicitly set the encodingStyle, we should // track the style. If it's RPC, default to SOAP-ENC, otherwise // default to "". if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationStyle == Style.RPC) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } }
/** * Set the operation style * * @param operationStyle */ public void setOperationStyle(Style operationStyle) { if (operation == null) { operation = new OperationDesc(); } operation.setStyle(operationStyle); // If no one has explicitly set the use, we should track // the style. If it's non-RPC, default to LITERAL. if (!useExplicitlySet) { if (operationStyle != Style.RPC) { operation.setUse(Use.LITERAL); } } // If no one has explicitly set the encodingStyle, we should // track the style. If it's RPC, default to SOAP-ENC, otherwise // default to "". if (!encodingStyleExplicitlySet) { String encStyle = ""; if (operationStyle == Style.RPC) { // RPC style defaults to encoded, otherwise default to literal encStyle = msgContext.getSOAPConstants().getEncodingURI(); } msgContext.setEncodingStyle(encStyle); } }
/** Subclasses can override */ protected void outputImpl(SerializationContext context) throws Exception { if (!alreadySerialized) { SOAPConstants soapVer = getSOAPConstants(); QName roleQName = soapVer.getRoleAttributeQName(); if (actor != null) { setAttribute(roleQName.getNamespaceURI(), roleQName.getLocalPart(), actor); } String val; if (context.getMessageContext() != null && context.getMessageContext().getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS) val = mustUnderstand ? "true" : "false"; else val = mustUnderstand ? "1" : "0"; setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_MUST_UNDERSTAND, val); if (soapVer == SOAPConstants.SOAP12_CONSTANTS && relay) { setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_RELAY, "true"); } } super.outputImpl(context); }
/** Subclasses can override */ protected void outputImpl(SerializationContext context) throws Exception { if (!alreadySerialized) { SOAPConstants soapVer = getSOAPConstants(); QName roleQName = soapVer.getRoleAttributeQName(); if (actor != null) { setAttribute(roleQName.getNamespaceURI(), roleQName.getLocalPart(), actor); } String val; if (context.getMessageContext() != null && context.getMessageContext().getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS) val = mustUnderstand ? "true" : "false"; else val = mustUnderstand ? "1" : "0"; setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_MUST_UNDERSTAND, val); if (soapVer == SOAPConstants.SOAP12_CONSTANTS && relay) { setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_RELAY, "true"); } } super.outputImpl(context); }
/** Subclasses can override */ protected void outputImpl(SerializationContext context) throws Exception { if (!alreadySerialized) { SOAPConstants soapVer = getSOAPConstants(); QName roleQName = soapVer.getRoleAttributeQName(); if (actor != null) { setAttribute(roleQName.getNamespaceURI(), roleQName.getLocalPart(), actor); } String val; if (context.getMessageContext() != null && context.getMessageContext().getSOAPConstants() == SOAPConstants.SOAP12_CONSTANTS) val = mustUnderstand ? "true" : "false"; else val = mustUnderstand ? "1" : "0"; setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_MUST_UNDERSTAND, val); if (soapVer == SOAPConstants.SOAP12_CONSTANTS && relay) { setAttribute(soapVer.getEnvelopeURI(), Constants.ATTR_RELAY, "true"); } } super.outputImpl(context); }
/** * Construct Deserializer * @param is is the InputSource * @param ctx is the MessageContext * @param messageType is the MessageType to construct an EnvelopeBuilder */ public DeserializationContext(InputSource is, MessageContext ctx, String messageType) { msgContext = ctx; EnvelopeBuilder builder = new EnvelopeBuilder(messageType, ctx != null ? ctx.getSOAPConstants() : null); // If high fidelity is required, record the whole damn thing. if (ctx == null || ctx.isHighFidelity()) recorder = new SAX2EventRecorder(); envelope = builder.getEnvelope(); envelope.setRecorder(recorder); pushElementHandler(new EnvelopeHandler(builder)); inputSource = is; }
/** * Construct Deserializer * @param is is the InputSource * @param ctx is the MessageContext * @param messageType is the MessageType to construct an EnvelopeBuilder */ public DeserializationContext(InputSource is, MessageContext ctx, String messageType) { msgContext = ctx; EnvelopeBuilder builder = new EnvelopeBuilder(messageType, ctx != null ? ctx.getSOAPConstants() : null); // If high fidelity is required, record the whole damn thing. if (ctx == null || ctx.isHighFidelity()) recorder = new SAX2EventRecorder(); envelope = builder.getEnvelope(); envelope.setRecorder(recorder); pushElementHandler(new EnvelopeHandler(builder)); inputSource = is; }
/** * Construct Deserializer * @param is is the InputSource * @param ctx is the MessageContext * @param messageType is the MessageType to construct an EnvelopeBuilder */ public DeserializationContext(InputSource is, MessageContext ctx, String messageType) { msgContext = ctx; EnvelopeBuilder builder = new EnvelopeBuilder(messageType, ctx != null ? ctx.getSOAPConstants() : null); // If high fidelity is required, record the whole damn thing. if (ctx == null || ctx.isHighFidelity()) recorder = new SAX2EventRecorder(); envelope = builder.getEnvelope(); envelope.setRecorder(recorder); pushElementHandler(new EnvelopeHandler(builder)); inputSource = is; }