本文整理汇总了Java中com.sun.xml.internal.ws.api.server.SDDocument类的典型用法代码示例。如果您正苦于以下问题:Java SDDocument类的具体用法?Java SDDocument怎么用?Java SDDocument使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SDDocument类属于com.sun.xml.internal.ws.api.server包,在下文中一共展示了SDDocument类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: publishWSDL
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
/**
* Sends out the WSDL (and other referenced documents)
* in response to the GET requests to URLs like "?wsdl" or "?xsd=2".
*
* @param con
* The connection to which the data will be sent.
*
* @throws java.io.IOException when I/O errors happen
*/
public void publishWSDL(@NotNull WSHTTPConnection con) throws IOException {
con.getInput().close();
SDDocument doc = wsdls.get(con.getQueryString());
if (doc == null) {
writeNotFoundErrorPage(con,"Invalid Request");
return;
}
con.setStatus(HttpURLConnection.HTTP_OK);
con.setContentTypeResponseHeader("text/xml;charset=utf-8");
OutputStream os = con.getProtocol().contains("1.1") ? con.getOutput() : new Http10OutputStream(con);
PortAddressResolver portAddressResolver = getPortAddressResolver(con.getBaseAddress());
DocumentAddressResolver resolver = getDocumentAddressResolver(portAddressResolver);
doc.writeTo(portAddressResolver, resolver, os);
os.close();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:HttpAdapter.java
示例2: WSDLGenResolver
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
public WSDLGenResolver(@NotNull List<SDDocumentImpl> docs,QName serviceName,QName portTypeName) {
this.docs = docs;
this.serviceName = serviceName;
this.portTypeName = portTypeName;
for (SDDocumentImpl doc : docs) {
if(doc.isWSDL()) {
SDDocument.WSDL wsdl = (SDDocument.WSDL) doc;
if(wsdl.hasPortType())
abstractWsdl = doc;
}
if(doc.isSchema()) {
SDDocument.Schema schema = (SDDocument.Schema) doc;
List<SDDocumentImpl> sysIds = nsMapping.get(schema.getTargetNamespace());
if (sysIds == null) {
sysIds = new ArrayList<SDDocumentImpl>();
nsMapping.put(schema.getTargetNamespace(), sysIds);
}
sysIds.add(doc);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:23,代码来源:WSDLGenResolver.java
示例3: verifyPrimaryWSDL
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
/**
* Verifies whether the given primaryWsdl contains the given serviceName.
* If the WSDL doesn't have the service, it throws an WebServiceException.
*/
private static void verifyPrimaryWSDL(@NotNull SDDocumentSource primaryWsdl, @NotNull QName serviceName) {
SDDocumentImpl primaryDoc = SDDocumentImpl.create(primaryWsdl,serviceName,null);
if (!(primaryDoc instanceof SDDocument.WSDL)) {
throw new WebServiceException(primaryWsdl.getSystemId()+
" is not a WSDL. But it is passed as a primary WSDL");
}
SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)primaryDoc;
if (!wsdlDoc.hasService()) {
if(wsdlDoc.getAllServices().isEmpty())
throw new WebServiceException("Not a primary WSDL="+primaryWsdl.getSystemId()+
" since it doesn't have Service "+serviceName);
else
throw new WebServiceException("WSDL "+primaryDoc.getSystemId()
+" has the following services "+wsdlDoc.getAllServices()
+" but not "+serviceName+". Maybe you forgot to specify a serviceName and/or targetNamespace in @WebService/@WebServiceProvider?");
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:22,代码来源:EndpointFactory.java
示例4: findPrimary
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
/**
* Finds the primary WSDL document from the list of metadata documents. If
* there are two metadata documents that qualify for primary, it throws an
* exception. If there are two metadata documents that qualify for porttype,
* it throws an exception.
*
* @return primay wsdl document, null if is not there in the docList
*
*/
private static @Nullable SDDocumentImpl findPrimary(@NotNull List<SDDocumentImpl> docList) {
SDDocumentImpl primaryDoc = null;
boolean foundConcrete = false;
boolean foundAbstract = false;
for(SDDocumentImpl doc : docList) {
if (doc instanceof SDDocument.WSDL) {
SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)doc;
if (wsdlDoc.hasService()) {
primaryDoc = doc;
if (foundConcrete) {
throw new ServerRtException("duplicate.primary.wsdl", doc.getSystemId() );
}
foundConcrete = true;
}
if (wsdlDoc.hasPortType()) {
if (foundAbstract) {
throw new ServerRtException("duplicate.abstract.wsdl", doc.getSystemId());
}
foundAbstract = true;
}
}
}
return primaryDoc;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:EndpointFactory.java
示例5: createDOM
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
private Document createDOM(SDDocument doc) {
// Get infoset
ByteArrayBuffer bab = new ByteArrayBuffer();
try {
doc.writeTo(null, resolver, bab);
} catch (IOException ioe) {
throw new WebServiceException(ioe);
}
// Convert infoset to DOM
Transformer trans = XmlUtil.newTransformer();
Source source = new StreamSource(bab.newInputStream(), null); //doc.getURL().toExternalForm());
DOMResult result = new DOMResult();
try {
trans.transform(source, result);
} catch(TransformerException te) {
throw new WebServiceException(te);
}
return (Document)result.getNode();
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:21,代码来源:AbstractSchemaValidationTube.java
示例6: WSDLGenResolver
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
public WSDLGenResolver(@NotNull Collection<SDDocumentImpl> docs,QName serviceName,QName portTypeName) {
this.docs = docs;
this.serviceName = serviceName;
this.portTypeName = portTypeName;
for (SDDocumentImpl doc : docs) {
if(doc.isWSDL()) {
SDDocument.WSDL wsdl = (SDDocument.WSDL) doc;
if(wsdl.hasPortType())
abstractWsdl = doc;
}
if(doc.isSchema()) {
SDDocument.Schema schema = (SDDocument.Schema) doc;
List<SDDocumentImpl> sysIds = nsMapping.get(schema.getTargetNamespace());
if (sysIds == null) {
sysIds = new ArrayList<SDDocumentImpl>();
nsMapping.put(schema.getTargetNamespace(), sysIds);
}
sysIds.add(doc);
}
}
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:23,代码来源:WSDLGenResolver.java
示例7: findPrimary
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
/**
* Finds the primary WSDL document from the list of metadata documents. If
* there are two metadata documents that qualify for primary, it throws an
* exception. If there are two metadata documents that qualify for porttype,
* it throws an exception.
*
* @return primay wsdl document, null if is not there in the docList
*
*/
private static @Nullable SDDocumentImpl findPrimary(@NotNull Collection<SDDocumentImpl> docList) {
SDDocumentImpl primaryDoc = null;
boolean foundConcrete = false;
boolean foundAbstract = false;
for(SDDocumentImpl doc : docList) {
if (doc instanceof SDDocument.WSDL) {
SDDocument.WSDL wsdlDoc = (SDDocument.WSDL)doc;
if (wsdlDoc.hasService()) {
primaryDoc = doc;
if (foundConcrete) {
throw new ServerRtException("duplicate.primary.wsdl", doc.getSystemId() );
}
foundConcrete = true;
}
if (wsdlDoc.hasPortType()) {
if (foundAbstract) {
throw new ServerRtException("duplicate.abstract.wsdl", doc.getSystemId());
}
foundAbstract = true;
}
}
}
return primaryDoc;
}
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:34,代码来源:EndpointFactory.java
示例8: ClientSchemaValidationTube
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
public ClientSchemaValidationTube(WSBinding binding, WSDLPort port, Tube next) {
super(binding, next);
this.port = port;
if (port != null) {
String primaryWsdl = port.getOwner().getParent().getLocation().getSystemId();
MetadataResolverImpl mdresolver = new MetadataResolverImpl();
Map<String, SDDocument> docs = MetadataUtil.getMetadataClosure(primaryWsdl, mdresolver, true);
mdresolver = new MetadataResolverImpl(docs.values());
Source[] sources = getSchemaSources(docs.values(), mdresolver);
for(Source source : sources) {
LOGGER.fine("Constructing client validation schema from = "+source.getSystemId());
//printDOM((DOMSource)source);
}
if (sources.length != 0) {
noValidation = false;
sf.setResourceResolver(mdresolver);
try {
schema = sf.newSchema(sources);
} catch(SAXException e) {
throw new WebServiceException(e);
}
validator = schema.newValidator();
return;
}
}
noValidation = true;
schema = null;
validator = null;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:ClientSchemaValidationTube.java
示例9: MetadataResolverImpl
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
public MetadataResolverImpl(Iterable<SDDocument> it) {
for(SDDocument doc : it) {
if (doc.isSchema()) {
docs.put(doc.getURL().toExternalForm(), doc);
nsMapping.put(((SDDocument.Schema)doc).getTargetNamespace(), doc);
}
}
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:AbstractSchemaValidationTube.java
示例10: resolve
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
@Override
public SDDocument resolve(String systemId) {
SDDocument sdi = docs.get(systemId);
if (sdi == null) {
SDDocumentSource sds;
try {
sds = SDDocumentSource.create(new URL(systemId));
} catch(MalformedURLException e) {
throw new WebServiceException(e);
}
sdi = SDDocumentImpl.create(sds, new QName(""), new QName(""));
docs.put(systemId, sdi);
}
return sdi;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:16,代码来源:AbstractSchemaValidationTube.java
示例11: getMetadataClosure
import com.sun.xml.internal.ws.api.server.SDDocument; //导入依赖的package包/类
/**
* Gets closure of all the referenced documents from the primary document(typically
* the service WSDL). It traverses the WSDL and schema imports and builds a closure
* set of documents.
*
* @param systemId primary wsdl or the any root document
* @param resolver used to get SDDocumentImpl for a document
* @param onlyTopLevelSchemas if true, the imported schemas from a schema would be ignored
* @return all the documents
*/
public static Map<String, SDDocument> getMetadataClosure(@NotNull String systemId,
@NotNull SDDocumentResolver resolver, boolean onlyTopLevelSchemas) {
Map <String, SDDocument> closureDocs = new HashMap<String, SDDocument>();
Set<String> remaining = new HashSet<String>();
remaining.add(systemId);
while(!remaining.isEmpty()) {
Iterator<String> it = remaining.iterator();
String current = it.next();
remaining.remove(current);
SDDocument currentDoc = resolver.resolve(current);
SDDocument old = closureDocs.put(currentDoc.getURL().toExternalForm(), currentDoc);
assert old == null;
Set<String> imports = currentDoc.getImports();
if (!currentDoc.isSchema() || !onlyTopLevelSchemas) {
for(String importedDoc : imports) {
if (closureDocs.get(importedDoc) == null) {
remaining.add(importedDoc);
}
}
}
}
return closureDocs;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:38,代码来源:MetadataUtil.java
注:本文中的com.sun.xml.internal.ws.api.server.SDDocument类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论