javax.wsdl.Import.getNamespaceURI()方法的使用及代码示例

x33g5p2x  于2022-01-21 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(237)

本文整理了Java中javax.wsdl.Import.getNamespaceURI()方法的一些代码示例,展示了Import.getNamespaceURI()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Import.getNamespaceURI()方法的具体详情如下:
包路径:javax.wsdl.Import
类名称:Import
方法名:getNamespaceURI

Import.getNamespaceURI介绍

[英]Get the namespace URI of this import.
[中]获取此导入的命名空间URI。

代码示例

代码示例来源:origin: wsdl4j/wsdl4j

/**
 * Remove an import from this WSDL description.
 *
 * @param importDef the import to be removed
 */
public Import removeImport(Import importDef)
{
 String namespaceURI = importDef.getNamespaceURI();
 List importList = (List)imports.get(namespaceURI);
 Import removed = null;
 if (importList != null && importList.remove(importDef))
 {
  removed = importDef;
 }
 return removed;
}

代码示例来源:origin: wsdl4j/wsdl4j

/**
 * Add an import to this WSDL description.
 *
 * @param importDef the import to be added
 */
public void addImport(Import importDef)
{
 String namespaceURI = importDef.getNamespaceURI();
 List importList = (List)imports.get(namespaceURI);
 if (importList == null)
 {
  importList = new Vector();
  imports.put(namespaceURI, importList);
 }
 importList.add(importDef);
}

代码示例来源:origin: wsdl4j/wsdl4j

importDef.getNamespaceURI(),
            pw);
DOMUtils.printAttribute(Constants.ATTR_LOCATION,

代码示例来源:origin: org.wso2.wsdl4j/wsdl4j

/**
 * Remove an import from this WSDL description.
 *
 * @param importDef the import to be removed
 */
public Import removeImport(Import importDef)
{
 String namespaceURI = importDef.getNamespaceURI();
 List importList = (List)imports.get(namespaceURI);
 Import removed = null;
 if (importList != null && importList.remove(importDef))
 {
  removed = importDef;
 }
 return removed;
}

代码示例来源:origin: org.wso2.wsdl4j/wsdl4j

/**
 * Add an import to this WSDL description.
 *
 * @param importDef the import to be added
 */
public void addImport(Import importDef)
{
 String namespaceURI = importDef.getNamespaceURI();
 List importList = (List)imports.get(namespaceURI);
 if (importList == null)
 {
  importList = new Vector();
  imports.put(namespaceURI, importList);
 }
 importList.add(importDef);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

public void visit(Import im, Object parent, WSDLTraversalContext ctx)
{
 importFound = true;
 Definition def = im.getDefinition();
 if (def != null)
 {
  if (!NullUtil.equals(im.getNamespaceURI(), def.getTargetNamespace()))
   errors.add(
    new QName(im.getNamespaceURI(), im.getLocationURI()),
    new QName(def.getTargetNamespace(), def.getDocumentBaseURI()));
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

public void visit(Import im, Object parent, WSDLTraversalContext ctx)
{
 importFound = true;
 Definition def = im.getDefinition();
 if (def != null)
 {
  if (!NullUtil.equals(im.getNamespaceURI(), def.getTargetNamespace()))
   errors.add(
    new QName(im.getNamespaceURI(), im.getLocationURI()),
    new QName(def.getTargetNamespace(), def.getDocumentBaseURI()));
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

/** 
 * (non-Javadoc)
 * @see org.eclipse.wst.wsi.wsdl.traversal.WSDLVisitor#visit(Import, Object, WSDLTraversalContext)
 */
public void visit(Import obj, Object parent, WSDLTraversalContext ctx)
{
 if(obj != null)
 {
  if(isRelativeURI(obj.getNamespaceURI()) || 
    isRelativeURI(obj.getLocationURI()))
  {
   errorList.add(obj.getNamespaceURI(), obj.getLocationURI());
  }
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

/** 
 * (non-Javadoc)
 * @see org.eclipse.wst.wsi.wsdl.traversal.WSDLVisitor#visit(Import, Object, WSDLTraversalContext)
 */
public void visit(Import obj, Object parent, WSDLTraversalContext ctx)
{
 if(obj != null)
 {
  if(isRelativeURI(obj.getNamespaceURI()) || 
    isRelativeURI(obj.getLocationURI()))
  {
   errorList.add(obj.getNamespaceURI(), obj.getLocationURI());
  }
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

if (im.getNamespaceURI() == null)
URI uri = new URI(im.getNamespaceURI());
if (!uri.isAbsolute())
  im.getNamespaceURI() + " is relative URI.");

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

if (im.getNamespaceURI() == null)
URI uri = new URI(im.getNamespaceURI());
if (!uri.isAbsolute())
  im.getNamespaceURI() + " is relative URI.");

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

public void visit(Import im, Object parent, WSDLTraversalContext ctx)
{
 importFound = true;
 try
 {
 // by the way : WSDL4J throws Exception if imported WSDL is not resolved
 // but documentation says that im.getDefinition() will be equal to null
 if (im.getDefinition() == null)
  errors.add(
   im.getNamespaceURI()
    + ":"
    + im.getLocationURI()
    + "\nImport element does not reference a WSDL definition.");
 }
 catch (Exception e)
 {
  errors.add(
   im.getNamespaceURI()
    + ":"
    + im.getLocationURI()
    + "\nImport element does not reference a WSDL definition.");
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

public void visit(Import im, Object parent, WSDLTraversalContext ctx)
{
 importFound = true;
 try
 {
 // by the way : WSDL4J throws Exception if imported WSDL is not resolved
 // but documentation says that im.getDefinition() will be equal to null
 if (im.getDefinition() == null)
  errors.add(
   im.getNamespaceURI()
    + ":"
    + im.getLocationURI()
    + "\nImport element does not reference a WSDL definition.");
 }
 catch (Exception e)
 {
  errors.add(
   im.getNamespaceURI()
    + ":"
    + im.getLocationURI()
    + "\nImport element does not reference a WSDL definition.");
 }
}

代码示例来源:origin: org.wso2.wsdl4j/wsdl4j

importDef.getNamespaceURI(),
            pw);
DOMUtils.printAttribute(Constants.ATTR_LOCATION,

代码示例来源:origin: org.jboss.ws.native/jbossws-native-core

private static void replaceWSDL11PortAddress(WSDLDefinitions wsdlDefinitions, QName portQName, String serviceEndpointURL)
{
 Definition wsdlOneOneDefinition = wsdlDefinitions.getWsdlOneOneDefinition();
 String tnsURI = wsdlOneOneDefinition.getTargetNamespace();
 // search for matching portElement and replace the address URI
 if (modifyPortAddress(tnsURI, portQName, serviceEndpointURL, wsdlOneOneDefinition.getServices()))
 {
   return;
 }
 // recursively process imports if none can be found
 if (!wsdlOneOneDefinition.getImports().isEmpty())
 {
   Iterator<?> imports = wsdlOneOneDefinition.getImports().values().iterator();
   while (imports.hasNext())
   {
    List<?> l = (List<?>)imports.next();
    Iterator<?> importsByNS = l.iterator();
    while (importsByNS.hasNext())
    {
      Import anImport = (Import)importsByNS.next();
      if (modifyPortAddress(anImport.getNamespaceURI(), portQName, serviceEndpointURL, anImport.getDefinition().getServices()))
      {
       return;
      }
    }
   }
 }
 
 throw MESSAGES.cannotFindPortInWsdl2(portQName);
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

public AssertionResult validate(
  TestAssertion testAssertion,
  EntryContext entryContext)
  throws WSIException
 {
  result = AssertionResult.RESULT_FAILED;

  Import im = (Import) entryContext.getEntry().getEntryDetail();
  // suppose that if location is invalid, the definition equals to null
  if (im.getLocationURI() == null || im.getLocationURI() == "")
   errors.add(im.getNamespaceURI(), im.getLocationURI());

  if (!errors.isEmpty())
  {
   result = AssertionResult.RESULT_FAILED;
   failureDetail = this.validator.createFailureDetail(errors.toString(), entryContext);
  }
  else
   result = AssertionResult.RESULT_PASSED;

  return validator.createAssertionResult(testAssertion, result, failureDetail);
 }
}

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

public AssertionResult validate(
  TestAssertion testAssertion,
  EntryContext entryContext)
  throws WSIException
 {
  result = AssertionResult.RESULT_FAILED;

  Import im = (Import) entryContext.getEntry().getEntryDetail();
  // suppose that if location is invalid, the definition equals to null
  if (im.getLocationURI() == null || im.getLocationURI() == "")
   errors.add(im.getNamespaceURI(), im.getLocationURI());

  if (!errors.isEmpty())
  {
   result = AssertionResult.RESULT_FAILED;
   failureDetail = this.validator.createFailureDetail(errors.toString(), entryContext);
  }
  else
   result = AssertionResult.RESULT_PASSED;

  return validator.createAssertionResult(testAssertion, result, failureDetail);
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

entry.setReferenceID(wsdlImport.getNamespaceURI());
entry.setEntryDetail(wsdlImport);

代码示例来源:origin: org.wso2.wsdl.validator/wsdl-validator

errors.add(WSDL_INPUT, ((Output) parent).getName());
else if (parent instanceof Import)
 errors.add(WSDL_IMPORT, ((Import) parent).getNamespaceURI());
else if (parent instanceof Input)
 errors.add(WSDL_INPUT, ((Input) parent).getName());

代码示例来源:origin: org.eclipse/org.eclipse.wst.wsi

errors.add(WSDL_INPUT, ((Output) parent).getName());
else if (parent instanceof Import)
 errors.add(WSDL_IMPORT, ((Import) parent).getNamespaceURI());
else if (parent instanceof Input)
 errors.add(WSDL_INPUT, ((Input) parent).getName());

相关文章