本文整理了Java中com.sun.enterprise.deployment.WebService
类的一些代码示例,展示了WebService
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebService
类的具体详情如下:
包路径:com.sun.enterprise.deployment.WebService
类名称:WebService
[英]Information about a single webservice-description in webservices.xml
[中]关于webservices中单个webservice描述的信息。xml
代码示例来源:origin: org.glassfish.deployment/dol
public void accept(WebService webService) {
try {
ModuleDescriptor moduleDesc =
webService.getBundleDescriptor().getModuleDescriptor();
if( webService.hasWsdlFile() && (webService.getWsdlFileUrl()==null || forceWSDLURLs) ) {
String wsdlFileUri = webService.getWsdlFileUri();
URL wsdlFileURL=null;
try {
URL url = new URL(wsdlFileUri);
if (url.getProtocol()!=null && !url.getProtocol().equalsIgnoreCase("file")) {
wsdlFileURL=url;
wsdlFileURL = wsdlFile.toURI().toURL();
webService.setWsdlFileUrl(wsdlFileURL);
if( webService.hasMappingFile() ) {
String mappingFileUri = webService.getMappingFileUri();
File mappingFile = new File(getModuleLocation(moduleDesc), mappingFileUri);
webService.setMappingFile(mappingFile);
new Object[] {webService.getName() , rootLocation_});
代码示例来源:origin: stackoverflow.com
public synchronized static WebService getInstance()
{
if(instance == null)
instance = new WebService();
return instance;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* Adds a new DOL descriptor instance to the descriptor
* instance associated with this XMLNode
*
* @param descriptor the new descriptor
*/
@Override
public void addDescriptor(Object descriptor) {
WebServiceEndpoint endpoint = (WebServiceEndpoint) descriptor;
WebService webService = (WebService) getDescriptor();
webService.addEndpoint(endpoint);
}
代码示例来源:origin: stackoverflow.com
try {
WebService serviceConnexion = new WebService("http://tempuri.org/", "WebService1Soap");
result = serviceConnexion.getResult();
} catch (Exception e) {
e.printStackTrace();
}
代码示例来源:origin: stackoverflow.com
private class MyNetworkTask extends AsyncTask<String, String, String>{
@Override
protected void onPreExecute() {
super.onPreExecute();
webserviceResponse.setText("Requesting to server .....");
}
@Override
protected String doInBackground(String... params) {
//Create Webservice class object
WebService com = new WebService();
// Initialize variables
String weight = params[1];
String fromUnit = params[2];
String toUnit = params[3];
//Call Webservice class method and pass values and get response
return com.getConvertedWeight(params[0], weight, fromUnit, toUnit);
}
@Override
protected void onPostExecute(String aResponse) {
webserviceResponse.setText("Response : "+aResponse);
}
}
代码示例来源:origin: stackoverflow.com
// Notify user the web service is connecting
final ProgressDialog dialog = ProgressDialog.show(
Screen_GlobalLeaderboard.this, "Getting scores",
"Please wait...", true);
dialog.setCancelable(true);
WebService ws = new WebService(this) {
@Override
public void webServiceCallComplete(boolean success, Object data,
String errorMessage, WebMethods callingWebMethod) {
dialog.dismiss();
// Your complete code here
}
};
ws.getTopLeaderboardResults(top, gameMode);
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
Collection schemaRelativeImports = new HashSet();
Collection schemaIncludes = new HashSet();
if( webService.hasUrlPublishing() ) {
parseRelativeImports(wsdlFileUrl, wsdlRelativeImports,
wsdlIncludes, schemaRelativeImports, schemaIncludes);
Collection endpoints = webService.getEndpoints();
BundleDescriptor bundle = webService.getBundleDescriptor();
WebServicesDescriptor wsd = bundle.getWebServices();
Collection webServices = wsd.getWebServices();
for (Iterator wsIter = webServices.iterator();wsIter.hasNext();) {
WebService aWS = (WebService) wsIter.next();
if (webService.getName().equals(aWS.getName())) {
continue;
if ((webService.getWsdlFileUri() != null) &&
(aWS.getWsdlFileUri() != null) &&
(webService.getWsdlFileUri().equals(aWS.getWsdlFileUri()))) {
endpointsCopy.addAll(aWS.getEndpoints());
} else if ((webService.getWsdlFileUrl() != null) &&
(aWS.getWsdlFileUrl() != null) &&
((webService.getWsdlFileUrl().toString())
.equals(aWS.getWsdlFileUrl().toString()))) {
endpointsCopy.addAll(aWS.getEndpoints());
webService.pickEndpointForRelativeImports();
URL root= wsi.getWebServerRootURL(endpointForImport.isSecure());
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* Generate a URL pointing to the initial wsdl document for this
* endpoint's web service.
*/
public URL composeFinalWsdlUrl(URL root) throws MalformedURLException {
// WSDL for this webservice is published in a subcontext created
// under the endpoint address uri. The hierarchy under there mirrors
// the structure of the module file in which this endpoint's
// webservice is defined. This allows easy retrieval of the wsdl
// content using jar URLs.
URL context = composeEndpointAddress(root);
String mainFile = context.getFile() + "/" +
PUBLISHING_SUBCONTEXT + "/" + webService.getWsdlFileUri();
URL finalWsdlUrl = new URL(context.getProtocol(), context.getHost(),
context.getPort(), mainFile);
return finalWsdlUrl;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
String wsdlFileUri = webService.getWsdlFileUri();
if (!webService.hasWsdlFile()) {
BundleDescriptor bundle = webService.getBundleDescriptor();
if( !isWsdlContent(wsdlFileUri, bundle) ) {
String msg = localStrings.getLocalString(
"enterprise.deployment.util.wsdlpackagedinwrongservicelocation",
"wsdl file {0} for web service {1} must be packaged in or below {2}",
new Object[] {wsdlFileUri, webService.getName(), bundle.getWsdlDir()});
DOLUtils.getDefaultLogger().severe(msg);
throw new RuntimeException(msg);
String fullFileUri = webService.getBundleDescriptor().getWsdlDir() + "/" + wsdlFileUri;
wsdlFileInputStream = archive_.getEntry(fullFileUri);
webService.setWsdlFileUri(fullFileUri);
} else {
"enterprise.deployment.util.servicewsdlfilenotfound",
"wsdl file {0} does not exist for web service {1}",
new Object[] {wsdlFileUri, webService.getName()});
DOLUtils.getDefaultLogger().severe(msg);
throw new RuntimeException(msg);
"enterprise.deployment.util.servicewsdlfilenotreadable",
"wsdl file {0} for service-ref {1} cannot be opened : {2}",
new Object[] {webService.getWsdlFileUri(), webService.getName(), ioe.getMessage()});
DOLUtils.getDefaultLogger().severe(msg);
throw new RuntimeException(ioe);
代码示例来源:origin: stackoverflow.com
WebService web = new WebService();
private GridView gridView;
ProgressDialog dialog;
url = new URL(web.arr[i][2]);
icon = BitmapFactory.decodeStream(url.openConnection().getInputStream());
response = web.WebService1();
total = web.totalService;
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
webService.getBundleDescriptor().getModuleDescriptor();
if( wsdlPath.equals(webService.getWsdlFileUri())){
wsdlUrl = webService.getWsdlFileUrl();
} else if( isWsdlContent(wsdlPath,
webService.getBundleDescriptor()) ) {
URL finalWsdlUrl = webService.getWsdlFileUrl();
String finalWsdlPath = finalWsdlUrl.getPath();
String wsdlDirPath = finalWsdlPath.substring(0, finalWsdlPath.length()-webService.getWsdlFileUri().length());
File wsdlDir = new File(wsdlDirPath);
File wsdlFile = new File(wsdlDir, wsdlPath.replace('/', File.separatorChar));
} catch(MalformedURLException mue) {
logger.log(Level.INFO, "Failure serving WSDL for " +
webService.getName(), mue);
wsdlUrl = webService.getWsdlFileUrl();
if (wsdlUrl.toURI().equals(webService.getWsdlFileUrl().toURI())) {
URL url = webService.getWsdlFileUrl();
File originalWsdlFile = new File(url.getPath()+"__orig");
if(!originalWsdlFile.exists()) {
webService.getName(), e);
} finally {
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
ws.setWsdlFileUri(f.getAbsolutePath());
ws.setWsdlFileUrl(retVal);
retVal = new URL(mappedEntry);
if(ws != null) {
ws.setWsdlFileUrl(retVal);
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
logger.log(Level.SEVERE,"Error in resolving the catalog");
if (ws.hasWsdlFile()) {
if (ws.getWsdlFileUri().startsWith("http")) {
try {
wsdlFileUri = downloadWsdlsAndSchemas( new URL(ws.getWsdlFileUri()), wsdlDir);
} catch(Exception e) {
throw new DeploymentException(e.toString(), e);
wsdlFileUri = ws.getWsdlFileUri();
File wsdlFileAbs = new File(wsdlFileUri);
wsdlFile = wsdlFileAbs.isAbsolute()? wsdlFileAbs : new File(moduleDir, wsdlFileUri);
ws.getWsdlFileUri(), bundle.getModuleDescriptor().getArchiveUri());
logger.severe(errorMessage);
throw new DeploymentException(errorMessage);
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
myEndpoint.getDescriptor().getWebService().getName());
String classesDir;
try {
URL wsdlUrl = new URL(sb.toString());
Service service = Service.create(new URL(sb.toString()), serviceName);
if (service==null) {
throw new RuntimeException("Cannot load Service");
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
if (!webService.hasFilePublishing()) {
continue;
BundleDescriptor bundle = webService.getBundleDescriptor();
URI clientPublishURI = webService.getClientPublishUrl().toURI();
if(!clientPublishURI.isOpaque()) {
parent = new File(clientPublishURI);
} else {
parent = new File(webService.getClientPublishUrl().getPath());
parent = new File(webService.getClientPublishUrl().getPath());
代码示例来源:origin: org.glassfish.main.deployment/dol
public Node writeDescriptor(Node parent, String nodeName,
WebService descriptor) {
Node topNode =
super.writeDescriptor(parent, nodeName, descriptor);
//TODO is this needed?
//writeDisplayableComponentInfo(topNode, descriptor);
appendTextChild(topNode,
WebServicesTagNames.WEB_SERVICE_DESCRIPTION_NAME,
descriptor.getName());
appendTextChild(topNode, WLWebServicesTagNames.WEBSERVICE_TYPE,
descriptor.getType());
if (descriptor.getClientPublishUrl() != null) {
appendTextChild(topNode, WLWebServicesTagNames.WSDL_PUBLISH_FILE,
descriptor.getClientPublishUrl().toString());
}
WLWebServiceEndpointNode endpointNode = new WLWebServiceEndpointNode();
for (WebServiceEndpoint next : descriptor.getEndpoints()) {
endpointNode.writeDescriptor
(topNode, WebServicesTagNames.PORT_COMPONENT, next);
}
return topNode;
}
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
private JaxrpcMappingDescriptor getJaxrpcMappingInfo(URL mappingFileUrl,
Descriptor desc)
throws Exception {
JaxrpcMappingDescriptor mappingDesc = null;
InputStream is = null;
try {
is = mappingFileUrl.openStream();
JaxrpcMappingDeploymentDescriptorFile jaxrpcDD =
new JaxrpcMappingDeploymentDescriptorFile();
// useful for validation errors...
if (desc instanceof ServiceReferenceDescriptor) {
ServiceReferenceDescriptor srd = (ServiceReferenceDescriptor) desc;
jaxrpcDD.setDeploymentDescriptorPath(srd.getMappingFileUri());
jaxrpcDD.setErrorReportingString(srd.getBundleDescriptor().getModuleDescriptor().getArchiveUri());
}
if (desc instanceof WebService) {
WebService ws = (WebService) desc;
jaxrpcDD.setDeploymentDescriptorPath(ws.getMappingFileUri());
jaxrpcDD.setErrorReportingString(ws.getBundleDescriptor().getModuleDescriptor().getArchiveUri());
}
//jaxrpcDD.setXMLValidationLevel(Deployer.getValidationLevel());
jaxrpcDD.setXMLValidationLevel("none");
mappingDesc = jaxrpcDD.read(is);
} finally {
if( is != null ) {
is.close();
}
}
return mappingDesc;
}
代码示例来源:origin: org.glassfish.main.deployment/dol
public String getGeneratedWsdlFilePath() {
if (hasWsdlFile()) {
String xmlDir = getBundleDescriptor().getApplication().getGeneratedXMLDirectory();
if(!getBundleDescriptor().getModuleDescriptor().isStandalone()) {
String uri = getBundleDescriptor().getModuleDescriptor().getArchiveUri();
xmlDir = xmlDir + File.separator + uri.replaceAll("\\.", "_");
}
if(xmlDir == null) {
return null;
}
return xmlDir + File.separator + wsdlFileUri;
} else {
return getWsdlFileUrl().getPath();
}
}
代码示例来源:origin: org.glassfish.webservices/jsr109-impl
if (endpoint.getWebService().hasWsdlFile()) {
pkgedWsdl = servletContext.getResource('/' + endpoint.getWebService().getWsdlFileUri());
} catch (MalformedURLException e) {
logger.severe("Cannot load the wsdl from the aplication : " + e.getMessage());
pkgedWsdl = endpoint.getWebService().getWsdlFileUrl();
primaryWsdl.getSystemId().toString());
logger.log(Level.FINE, "Metadata documents:");
for (Object source : docs) {
logger.log(Level.FINE, ((SDDocumentSource) source).getSystemId().toString());
代码示例来源:origin: org.glassfish.main.deployment/dol
/**
* write the descriptor class to a DOM tree and return it
*
* @param parent node for the DOM tree
* @param node name for the descriptor
* @param the descriptor to write
* @return the DOM tree top node
*/
public Node writeDescriptor(Node parent, String nodeName,
WebService webService) {
Node webServiceNode =
super.writeDescriptor(parent, nodeName, webService);
appendTextChild(webServiceNode,
WebServicesTagNames.WEB_SERVICE_DESCRIPTION_NAME,
webService.getName());
if( webService.hasClientPublishUrl() ) {
URL url = webService.getClientPublishUrl();
appendTextChild(webServiceNode,
WebServicesTagNames.CLIENT_WSDL_PUBLISH_URL,
url.toExternalForm());
}
return webServiceNode;
}
内容来源于网络,如有侵权,请联系作者删除!