本文整理匯總了Java中javax.xml.soap.SOAPEnvelope.getNamespaceURI方法的典型用法代碼示例。如果您正苦於以下問題:Java SOAPEnvelope.getNamespaceURI方法的具體用法?Java SOAPEnvelope.getNamespaceURI怎麽用?Java SOAPEnvelope.getNamespaceURI使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類javax.xml.soap.SOAPEnvelope
的用法示例。
在下文中一共展示了SOAPEnvelope.getNamespaceURI方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
try
{
SOAPMessage soapMessage = msgContext.getMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
nsURI = soapEnvelope.getNamespaceURI();
return true;
}
catch (SOAPException ex)
{
throw new WebServiceException(ex);
}
}
示例2: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
try
{
SOAPMessage soapMessage = msgContext.getMessage();
SOAPEnvelope soapEnvelope = soapMessage.getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
SOAPElement soapElement = (SOAPElement)soapMessage.getSOAPBody().getChildElements().next();
soapElement = (SOAPElement)soapElement.getChildElements().next();
String value = soapElement.getValue();
soapElement.setValue(value + ":" + nsURI);
return true;
}
catch (SOAPException ex)
{
throw new WebServiceException(ex);
}
}
示例3: checkEnvelope
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
private void checkEnvelope(SOAPMessage soapMessage) throws SOAPException
{
SOAPPart part = soapMessage.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
String namespace = envelope.getNamespaceURI();
if (envelopeNamespace.equals(namespace) == false)
{
throw new RuntimeException("Expected '" + envelopeNamespace + "' namespace, actual '" + namespace + "'");
}
}
示例4: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
log.info("handleInbound");
ContentType contentType = getContentType(msgContext);
if (contentType != null)
{
log.info("contentType="+contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE))
{
return false;
}
}
else
{
return false;
}
try
{
SOAPEnvelope soapEnvelope = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI))
{
return false;
}
}
catch (SOAPException se)
{
throw new WebServiceException(se);
}
return true;
}
示例5: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
log.info("handleInbound");
ContentType contentType = getContentType(msgContext);
if (contentType != null)
{
log.info("contentType="+contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_2_CONTENT_TYPE))
{
return false;
}
}
else
{
return false;
}
try
{
SOAPEnvelope soapEnvelope = ((SOAPMessageContext)msgContext).getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(nsURI))
{
return false;
}
}
catch (SOAPException se)
{
throw new WebServiceException(se);
}
return true;
}
示例6: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
log.info("handleInbound");
try
{
SOAPEnvelope soapEnvelope = msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI))
{
return false;
}
}
catch (SOAPException se)
{
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null)
{
log.info("contentType="+contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE))
{
return false;
}
}
else
{
return false;
}
return true;
}
示例7: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
@Override
public boolean handleInbound(SOAPMessageContext msgContext)
{
log.info("handleInbound");
try
{
SOAPEnvelope soapEnvelope = msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_2_ENVELOPE.equals(nsURI))
{
return false;
}
}
catch (SOAPException se)
{
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null)
{
log.info("contentType="+contentType);
String startInfo = contentType.getParameter("start-info");
if (!startInfo.equals(SOAPConstants.SOAP_1_2_CONTENT_TYPE))
{
return false;
}
}
else
{
return false;
}
return true;
}
示例8: XMLPartBase
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
/**
* XMLPart should be constructed via the XMLPartFactory. This constructor creates an XMLPart from
* the specified root.
*
* @param root
* @throws WebServiceException
*/
XMLPartBase(SOAPEnvelope root) throws WebServiceException {
content = root;
contentType = SOAPENVELOPE;
String ns = root.getNamespaceURI();
if (ns.equals(SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
protocol = Protocol.soap11;
} else if (ns.equals(SOAP12Constants.SOAP_ENVELOPE_NAMESPACE_URI)) {
protocol = Protocol.soap12;
} else {
throw ExceptionFactory
.makeWebServiceException(Messages.getMessage("RESTIsNotSupported"));
}
}
示例9: handleInbound
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
public boolean handleInbound(SOAPMessageContext msgContext)
{
log.info("handleInbound");
try
{
SOAPEnvelope soapEnvelope = (SOAPEnvelope)msgContext.getMessage().getSOAPPart().getEnvelope();
String nsURI = soapEnvelope.getNamespaceURI();
log.info("nsURI=" + nsURI);
if (!SOAPConstants.URI_NS_SOAP_1_1_ENVELOPE.equals(nsURI))
{
throw new RuntimeException("Wrong NS uri: " + nsURI);
}
}
catch (SOAPException se)
{
throw new WebServiceException(se);
}
ContentType contentType = getContentType(msgContext);
if (contentType != null)
{
log.info("contentType="+contentType);
String startInfo = contentType.getParameter("start-info");
if (!checkMtom) {
if (startInfo != null) {
throw new RuntimeException("Unexpected multipart/related message!");
} else {
return true;
}
}
if (!startInfo.equals(SOAPConstants.SOAP_1_1_CONTENT_TYPE))
{
throw new RuntimeException("Wrong start info: " + startInfo);
}
}
else
{
throw new RuntimeException("Missing content type");
}
return true;
}
示例10: getSoapVersionURI
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
private String getSoapVersionURI(SOAPMessage soapMessage)throws SOAPException{
SOAPPart sp = soapMessage.getSOAPPart();
SOAPEnvelope envelope = sp.getEnvelope();
return envelope.getNamespaceURI();
}
示例11: getVersionURI
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
private String getVersionURI(SOAPMessage soapMessage)throws SOAPException{
SOAPPart sp = soapMessage.getSOAPPart();
SOAPEnvelope envelope = sp.getEnvelope();
return envelope.getNamespaceURI();
}
示例12: getQName
import javax.xml.soap.SOAPEnvelope; //導入方法依賴的package包/類
/**
* Get the QName of the envelope
*
* @param env
* @return QName
*/
private static QName getQName(SOAPEnvelope env) {
return new QName(env.getNamespaceURI(), env.getLocalName(), env.getPrefix());
}