當前位置: 首頁>>代碼示例>>Java>>正文


Java SOAPEnvelope.getNamespaceURI方法代碼示例

本文整理匯總了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);
   }
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:17,代碼來源:ServerHandler.java

示例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);
   }
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:22,代碼來源:ClientHandler.java

示例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 + "'");
   }
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:12,代碼來源:TestHandler.java

示例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;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:40,代碼來源:SOAP11ServerHandler.java

示例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;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:40,代碼來源:SOAP12ServerHandler.java

示例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;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:41,代碼來源:SOAP11ClientHandler.java

示例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;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:41,代碼來源:SOAP12ClientHandler.java

示例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"));
    }
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:21,代碼來源:XMLPartBase.java

示例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;
}
 
開發者ID:jbossws,項目名稱:jbossws-cxf,代碼行數:47,代碼來源:ClientHandler.java

示例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();
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:6,代碼來源:SOAPBindingProvider.java

示例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();
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:6,代碼來源:SOAPBindingProviderTests.java

示例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());
}
 
開發者ID:wso2,項目名稱:wso2-axis2,代碼行數:10,代碼來源:SOAPEnvelopeBlockImpl.java


注:本文中的javax.xml.soap.SOAPEnvelope.getNamespaceURI方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。