本文整理汇总了Java中com.sun.xml.internal.ws.api.server.PortAddressResolver类的典型用法代码示例。如果您正苦于以下问题:Java PortAddressResolver类的具体用法?Java PortAddressResolver怎么用?Java PortAddressResolver使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PortAddressResolver类属于com.sun.xml.internal.ws.api.server包,在下文中一共展示了PortAddressResolver类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: publishWSDL
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的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: createPortAddressResolver
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
/**
* Creates a PortAddressResolver that maps portname to its address
*
* @param endpointImpl application endpoint Class that eventually serves the request.
*/
public PortAddressResolver createPortAddressResolver(final String baseAddress, final Class<?> endpointImpl) {
return new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
String urlPattern = addressMap.get(new PortInfo(serviceName,portName, endpointImpl));
if (urlPattern == null) {
//if a WSDL defines more ports, urlpattern is null (portName does not match endpointImpl)
//so fallback to the default behaviour where only serviceName/portName is checked
for (Entry<PortInfo, String> e : addressMap.entrySet()) {
if (serviceName.equals(e.getKey().serviceName) && portName.equals(e.getKey().portName)) {
urlPattern = e.getValue();
break;
}
}
}
return (urlPattern == null) ? null : baseAddress+urlPattern;
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:HttpAdapterList.java
示例3: getDocumentAddressResolver
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public DocumentAddressResolver getDocumentAddressResolver(
PortAddressResolver portAddressResolver) {
final String address = portAddressResolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
assert address != null;
return new DocumentAddressResolver() {
@Override
public String getRelativeAddressFor(@NotNull SDDocument current, @NotNull SDDocument referenced) {
// the map on endpoint should account for all SDDocument
assert revWsdls.containsKey(referenced);
return address+'?'+ revWsdls.get(referenced);
}
};
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:HttpAdapter.java
示例4: getEPRAddress
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public @Override @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
if(address==null) {
throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
}
return address;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:9,代码来源:PortableConnectionImpl.java
示例5: getEPRAddress
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
//return WSHttpHandler.getRequestAddress(httpExchange);
PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress(), endpoint.getImplementationClass());
String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
if(address==null)
throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
return address;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:ServerConnectionImpl.java
示例6: createPortAddressResolver
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
/**
* Creates a PortAddressResolver that maps portname to its address
*/
public PortAddressResolver createPortAddressResolver(final String baseAddress) {
return new PortAddressResolver() {
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
String urlPattern = addressMap.get(new PortInfo(serviceName,portName));
return (urlPattern == null) ? null : baseAddress+urlPattern;
}
};
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:12,代码来源:HttpAdapterList.java
示例7: getEPRAddress
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress());
String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
if(address==null)
throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
return address;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:8,代码来源:PortableConnectionImpl.java
示例8: getEPRAddress
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public @NotNull String getEPRAddress(Packet request, WSEndpoint endpoint) {
//return WSHttpHandler.getRequestAddress(httpExchange);
PortAddressResolver resolver = adapter.owner.createPortAddressResolver(getBaseAddress());
String address = resolver.getAddressFor(endpoint.getServiceName(), endpoint.getPortName().getLocalPart());
if(address==null)
throw new WebServiceException(WsservletMessages.SERVLET_NO_ADDRESS_AVAILABLE(endpoint.getPortName()));
return address;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:11,代码来源:ServerConnectionImpl.java
示例9: fetchFile
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
//XMLInputFactory readerFactory = XMLInputFactory.newInstance();
//XMLStreamReader xsr = readerFactory.createXMLStreamReader(new DOMSource(forest.get(rootWsdl)));
XMLStreamReader xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
XMLOutputFactory writerfactory = XMLOutputFactory.newInstance();
String resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
OutputStream os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
XMLStreamWriter xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
xsr.close();
xsw.close();
os.close();
options.addGeneratedFile(outFile);
return resolvedRootWsdl;
}
开发者ID:alexkasko,项目名称:openjdk-icedtea7,代码行数:35,代码来源:WSDLFetcher.java
示例10: getPortAddressResolver
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
public PortAddressResolver getPortAddressResolver(String baseAddress) {
return owner.createPortAddressResolver(baseAddress, endpoint.getImplementationClass());
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:4,代码来源:HttpAdapter.java
示例11: fetchFile
import com.sun.xml.internal.ws.api.server.PortAddressResolver; //导入依赖的package包/类
private String fetchFile(final String doc, DOMForest forest, final Map<String, String> documentMap, File destDir) throws IOException, XMLStreamException {
DocumentLocationResolver docLocator = createDocResolver(doc, forest, documentMap);
WSDLPatcher wsdlPatcher = new WSDLPatcher(new PortAddressResolver() {
@Override
public String getAddressFor(@NotNull QName serviceName, @NotNull String portName) {
return null;
}
}, docLocator);
XMLStreamReader xsr = null;
XMLStreamWriter xsw = null;
OutputStream os = null;
String resolvedRootWsdl = null;
try {
XMLOutputFactory writerfactory;
xsr = SourceReaderFactory.createSourceReader(new DOMSource(forest.get(doc)), false);
writerfactory = XMLOutputFactory.newInstance();
resolvedRootWsdl = docLocator.getLocationFor(null, doc);
File outFile = new File(destDir, resolvedRootWsdl);
os = new FileOutputStream(outFile);
if(options.verbose) {
listener.message(WscompileMessages.WSIMPORT_DOCUMENT_DOWNLOAD(doc,outFile));
}
xsw = writerfactory.createXMLStreamWriter(os);
//DOMForest eats away the whitespace loosing all the indentation, so write it through
// indenting writer for better readability of fetched documents
IndentingXMLStreamWriter indentingWriter = new IndentingXMLStreamWriter(xsw);
wsdlPatcher.bridge(xsr, indentingWriter);
options.addGeneratedFile(outFile);
} finally {
try {
if (xsr != null) {xsr.close();}
if (xsw != null) {xsw.close();}
} finally {
if (os != null) {os.close();}
}
}
return resolvedRootWsdl;
}
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:43,代码来源:WSDLFetcher.java
注:本文中的com.sun.xml.internal.ws.api.server.PortAddressResolver类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论