本文整理汇总了Java中com.sun.xml.internal.ws.wsdl.parser.WSDLConstants类的典型用法代码示例。如果您正苦于以下问题:Java WSDLConstants类的具体用法?Java WSDLConstants怎么用?Java WSDLConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
WSDLConstants类属于com.sun.xml.internal.ws.wsdl.parser包,在下文中一共展示了WSDLConstants类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: handleEndElement
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
@Override
protected void handleEndElement() throws XMLStreamException {
QName name = in.getName();
if (name.equals(WSDLConstants.QNAME_SERVICE)) {
serviceName = null;
} else if (name.equals(WSDLConstants.QNAME_PORT)) {
portName = null;
} else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)
|| name.equals(MemberSubmissionAddressingConstants.WSA_EPR_QNAME)) {
if (inEpr) {
inEpr = false;
}
} else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)
|| name.equals(MemberSubmissionAddressingConstants.WSA_ADDRESS_QNAME)) {
if (inEprAddress) {
String value = getAddressLocation();
if (value != null) {
logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
+ " address with "+value);
out.writeCharacters(value);
}
inEprAddress = false;
}
}
super.handleEndElement();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:27,代码来源:WSDLPatcher.java
示例2: handleEndElement
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
@Override
protected void handleEndElement() throws XMLStreamException {
QName name = in.getName();
if (name.equals(WSDLConstants.QNAME_SERVICE)) {
serviceName = null;
} else if (name.equals(WSDLConstants.QNAME_PORT)) {
portName = null;
} else if (name.equals(W3CAddressingConstants.WSA_EPR_QNAME)) {
if (inEpr) {
inEpr = false;
}
} else if (name.equals(W3CAddressingConstants.WSA_ADDRESS_QNAME)) {
if (inEprAddress) {
String value = getAddressLocation();
if (value != null) {
logger.fine("Fixing EPR Address for service:"+serviceName+ " port:"+portName
+ " address with "+value);
out.writeCharacters(value);
}
inEprAddress = false;
}
}
super.handleEndElement();
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:25,代码来源:WSDLPatcher.java
示例3: writeWsdl
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
private static void writeWsdl(StreamWriterBufferCreator writer, QName service, String wsdlAddress) throws XMLStreamException {
// Inline-wsdl
writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
WSDLConstants.QNAME_DEFINITIONS.getLocalPart(),
WSDLConstants.NS_WSDL);
writer.writeNamespace(WSDLConstants.PREFIX_NS_WSDL, WSDLConstants.NS_WSDL);
writer.writeStartElement(WSDLConstants.PREFIX_NS_WSDL,
WSDLConstants.QNAME_IMPORT.getLocalPart(),
WSDLConstants.NS_WSDL);
writer.writeAttribute("namespace", service.getNamespaceURI());
writer.writeAttribute("location", wsdlAddress);
writer.writeEndElement();
writer.writeEndElement();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:15,代码来源:WSEndpointReference.java
示例4: toWSDLSource
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
/**
* Constructs a Source containing the wsdl from the MemberSubmissionEndpointReference
*
* @return Source A source object containing the wsdl in the MemeberSubmissionEndpointReference, if present.
*/
public Source toWSDLSource() {
Element wsdlElement = null;
for (Element elem : elements) {
if (elem.getNamespaceURI().equals(WSDLConstants.NS_WSDL) &&
elem.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart())) {
wsdlElement = elem;
}
}
return new DOMSource(wsdlElement);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:18,代码来源:MemberSubmissionEndpointReference.java
示例5: handleAttribute
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
@Override
protected void handleAttribute(int i) throws XMLStreamException {
QName name = in.getName();
String attLocalName = in.getAttributeLocalName(i);
if((name.equals(SCHEMA_INCLUDE_QNAME) && attLocalName.equals("schemaLocation"))
|| (name.equals(SCHEMA_IMPORT_QNAME) && attLocalName.equals("schemaLocation"))
|| (name.equals(SCHEMA_REDEFINE_QNAME) && attLocalName.equals("schemaLocation"))
|| (name.equals(WSDLConstants.QNAME_IMPORT) && attLocalName.equals("location"))) {
// patch this attribute value.
String relPath = in.getAttributeValue(i);
String actualPath = getPatchedImportLocation(relPath);
if (actualPath == null) {
return; // skip this attribute to leave it up to "implicit reference".
}
logger.fine("Fixing the relative location:"+relPath
+" with absolute location:"+actualPath);
writeAttribute(i, actualPath);
return;
}
if (name.equals(WSDLConstants.NS_SOAP_BINDING_ADDRESS) ||
name.equals(WSDLConstants.NS_SOAP12_BINDING_ADDRESS)) {
if(attLocalName.equals("location")) {
portAddress = in.getAttributeValue(i);
String value = getAddressLocation();
if (value != null) {
logger.fine("Service:"+serviceName+ " port:"+portName
+ " current address "+portAddress+" Patching it with "+value);
writeAttribute(i, value);
return;
}
}
}
super.handleAttribute(i);
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:41,代码来源:WSDLPatcher.java
示例6: createDocumentMap
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
private Map<String,String> createDocumentMap(MetadataFinder forest, File baseDir, final String rootWsdl, Set<String> externalReferences) {
Map<String,String> map = new HashMap<String,String>();
String rootWsdlFileName = rootWsdl;
String rootWsdlName;
int slashIndex = rootWsdl.lastIndexOf("/");
if( slashIndex >= 0) {
rootWsdlFileName = rootWsdl.substring(slashIndex+1);
}
if(!rootWsdlFileName.endsWith(WSDL_FILE_EXTENSION)) {
Document rootWsdlDoc = forest.get(rootWsdl);
NodeList serviceNodes = rootWsdlDoc.getElementsByTagNameNS(WSDLConstants.QNAME_SERVICE.getNamespaceURI(),WSDLConstants.QNAME_SERVICE.getLocalPart());
if (serviceNodes.getLength() == 0) {
rootWsdlName = "Service";
} else {
Node serviceNode = serviceNodes.item(0);
String serviceName = ((Element)serviceNode).getAttribute( WSDLConstants.ATTR_NAME);
rootWsdlName = serviceName;
}
rootWsdlFileName = rootWsdlName+ WSDL_FILE_EXTENSION;
} else {
rootWsdlName = rootWsdlFileName.substring(0,rootWsdlFileName.length()-5);
}
map.put(rootWsdl,sanitize(rootWsdlFileName));
int i =1;
for(String ref: externalReferences) {
Document refDoc = forest.get(ref);
Element rootEl = refDoc.getDocumentElement();
String fileExtn;
String fileName = null;
int index = ref.lastIndexOf("/");
if (index >= 0) {
fileName = ref.substring(index + 1);
}
if(rootEl.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart()) && rootEl.getNamespaceURI().equals(WSDLConstants.NS_WSDL)) {
fileExtn = WSDL_FILE_EXTENSION;
} else if(rootEl.getLocalName().equals(WSDLConstants.QNAME_SCHEMA.getLocalPart()) && rootEl.getNamespaceURI().equals(WSDLConstants.NS_XMLNS)) {
fileExtn = SCHEMA_FILE_EXTENSION;
} else {
fileExtn = ".xml";
}
if(fileName != null && (fileName.endsWith(WSDL_FILE_EXTENSION) || fileName.endsWith(SCHEMA_FILE_EXTENSION))) {
map.put(ref, rootWsdlName+"_"+fileName);
} else {
map.put(ref, rootWsdlName+"_metadata"+ (i++) + fileExtn);
}
}
return map;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:52,代码来源:WSDLFetcher.java
示例7: createDocumentMap
import com.sun.xml.internal.ws.wsdl.parser.WSDLConstants; //导入依赖的package包/类
private Map<String,String> createDocumentMap(MetadataFinder forest, File baseDir, final String rootWsdl, Set<String> externalReferences) {
Map<String,String> map = new HashMap<String,String>();
String rootWsdlFileName = rootWsdl;
String rootWsdlName;
int slashIndex = rootWsdl.lastIndexOf("/");
if( slashIndex >= 0) {
rootWsdlFileName = rootWsdl.substring(slashIndex+1);
}
if(!rootWsdlFileName.endsWith(WSDL_FILE_EXTENSION)) {
Document rootWsdlDoc = forest.get(rootWsdl);
NodeList serviceNodes = rootWsdlDoc.getElementsByTagNameNS(WSDLConstants.QNAME_SERVICE.getNamespaceURI(),WSDLConstants.QNAME_SERVICE.getLocalPart());
if(serviceNodes.getLength() == 0)
rootWsdlName = "Service";
else {
Node serviceNode = serviceNodes.item(0);
String serviceName = ((Element)serviceNode).getAttribute( WSDLConstants.ATTR_NAME);
rootWsdlName = serviceName;
}
rootWsdlFileName = rootWsdlName+ WSDL_FILE_EXTENSION;
} else {
rootWsdlName = rootWsdlFileName.substring(0,rootWsdlFileName.length()-5);
}
map.put(rootWsdl,sanitize(rootWsdlFileName));
int i =1;
for(String ref: externalReferences) {
Document refDoc = forest.get(ref);
Element rootEl = refDoc.getDocumentElement();
String fileExtn;
String fileName = null;
int index = ref.lastIndexOf("/");
if (index >= 0) {
fileName = ref.substring(index + 1);
}
if(rootEl.getLocalName().equals(WSDLConstants.QNAME_DEFINITIONS.getLocalPart()) && rootEl.getNamespaceURI().equals(WSDLConstants.NS_WSDL)) {
fileExtn = WSDL_FILE_EXTENSION;
} else if(rootEl.getLocalName().equals(WSDLConstants.QNAME_SCHEMA.getLocalPart()) && rootEl.getNamespaceURI().equals(WSDLConstants.NS_XMLNS)) {
fileExtn = SCHEMA_FILE_EXTENSION;
} else {
fileExtn = ".xml";
}
if(fileName != null && (fileName.endsWith(WSDL_FILE_EXTENSION) || fileName.endsWith(SCHEMA_FILE_EXTENSION))) {
map.put(ref, rootWsdlName+"_"+fileName);
} else {
map.put(ref, rootWsdlName+"_metadata"+ (i++) + fileExtn);
}
}
return map;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:52,代码来源:WSDLFetcher.java
注:本文中的com.sun.xml.internal.ws.wsdl.parser.WSDLConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论