Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 247535
Collapse All | Expand All

(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/binding/GenSampleWidgetBinding.java (-6 / +8 lines)
Lines 1-5 Link Here
1
/*******************************************************************************
1
/*******************************************************************************
2
 * Copyright (c) 2004, 2008 IBM Corporation and others.
2
 * Copyright (c) 2004, 2009 IBM Corporation and others.
3
 * All rights reserved. This program and the accompanying materials
3
 * All rights reserved. This program and the accompanying materials
4
 * are made available under the terms of the Eclipse Public License v1.0
4
 * are made available under the terms of the Eclipse Public License v1.0
5
 * which accompanies this distribution, and is available at
5
 * which accompanies this distribution, and is available at
Lines 21-26 Link Here
21
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
21
 * 20080425   221232 gilberta@ca.ibm.com - Gilbert Andrews
22
 * 20080616   237298 gilberta@ca.ibm.com - Gilbert Andrews
22
 * 20080616   237298 gilberta@ca.ibm.com - Gilbert Andrews
23
 * 20080619   237797 gilberta@ca.ibm.com - Gilbert Andrews
23
 * 20080619   237797 gilberta@ca.ibm.com - Gilbert Andrews
24
 * 20090324   247535 mahutch@ca.ibm.com - Mark Hutchinson, Wrong server instance(s) is chosen during JAX-RPC sample generation
24
 *******************************************************************************/
25
 *******************************************************************************/
25
package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
26
package org.eclipse.jst.ws.internal.consumption.ui.widgets.binding;
26
27
Lines 204-210 Link Here
204
	{    
205
	{    
205
		IEnvironment env = getEnvironment();
206
		IEnvironment env = getEnvironment();
206
	    IStatus status = Status.OK_STATUS;	
207
	    IStatus status = Status.OK_STATUS;	
207
	  
208
208
	    // Split up the project and module
209
	    // Split up the project and module
209
	    int index = module_.indexOf("/");
210
	    int index = module_.indexOf("/");
210
	    if (index!=-1){
211
	    if (index!=-1){
Lines 231-236 Link Here
231
	  	clientInfo.setState(WebServiceState.UNKNOWN_LITERAL);
232
	  	clientInfo.setState(WebServiceState.UNKNOWN_LITERAL);
232
	  	clientInfo.setWebServiceRuntimeId(typeRuntimeServer_.getRuntimeId());
233
	  	clientInfo.setWebServiceRuntimeId(typeRuntimeServer_.getRuntimeId());
233
	  	clientInfo.setWsdlURL(wsdlURI_);
234
	  	clientInfo.setWsdlURL(wsdlURI_);
235
	  	/*
234
	  	if (clientInfo.getServerInstanceId()==null)
236
	  	if (clientInfo.getServerInstanceId()==null)
235
	  	{
237
	  	{
236
	  		CreateServerCommand createServerCommand = new CreateServerCommand();
238
	  		CreateServerCommand createServerCommand = new CreateServerCommand();
Lines 251-259 Link Here
251
	  	}
253
	  	}
252
	  	else {
254
	  	else {
253
	  		canRunTestClient_ = true;
255
	  		canRunTestClient_ = true;
254
	  	}
256
	  	}*/
255
	  	
256
	  	
257
	  	
258
	  	canRunTestClient_ = true;
257
	  	IProject[] earproject = J2EEProjectUtilities.getReferencingEARProjects(project);
259
	  	IProject[] earproject = J2EEProjectUtilities.getReferencingEARProjects(project);
258
	  	boolean earNull = false;
260
	  	boolean earNull = false;
259
	  	if (earproject.length<1) earNull = true;
261
	  	if (earproject.length<1) earNull = true;
Lines 264-270 Link Here
264
	  	
266
	  	
265
	  	if (j2eeProject && earNull)
267
	  	if (j2eeProject && earNull)
266
	  		canRunTestClient_ = false;
268
	  		canRunTestClient_ = false;
267
	  		  	
269
	  /*		  	
268
		if (!earNull && clientInfo.getServerInstanceId() != null){
270
		if (!earNull && clientInfo.getServerInstanceId() != null){
269
	  		
271
	  		
270
	  		AddModuleToServerCommand command = new AddModuleToServerCommand();
272
	  		AddModuleToServerCommand command = new AddModuleToServerCommand();
Lines 277-283 Link Here
277
	  		{
279
	  		{
278
	  			env.getStatusHandler().reportError(status);
280
	  			env.getStatusHandler().reportError(status);
279
	  		}     
281
	  		}     
280
	  	}
282
	  	}*/
281
	  	webServiceClient_ = new TestWebServiceClient(clientInfo);
283
	  	webServiceClient_ = new TestWebServiceClient(clientInfo);
282
	  	return status;
284
	  	return status;
283
  	}
285
  	}
(-)src/org/eclipse/jst/ws/internal/consumption/ui/widgets/test/ClientTestWidget.java (-9 / +18 lines)
Lines 21-26 Link Here
21
 * 20080723   241303 gilberta@ca.ibm.com - Gilbert Andrews
21
 * 20080723   241303 gilberta@ca.ibm.com - Gilbert Andrews
22
 * 20080808   243602 rkklai@ca.ibm.com   - Raymond Lai, fix NPE when changing runtime (the server combo)
22
 * 20080808   243602 rkklai@ca.ibm.com   - Raymond Lai, fix NPE when changing runtime (the server combo)
23
 * 20090302   242462 ericdp@ca.ibm.com - Eric D. Peters, Save Web services wizard settings
23
 * 20090302   242462 ericdp@ca.ibm.com - Eric D. Peters, Save Web services wizard settings
24
 * 20090324   247535 mahutch@ca.ibm.com - Mark Hutchinson, Wrong server instance(s) is chosen during JAX-RPC sample generation
24
 *******************************************************************************/
25
 *******************************************************************************/
25
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
26
package org.eclipse.jst.ws.internal.consumption.ui.widgets.test;
26
27
Lines 423-435 Link Here
423
	  IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
424
	  IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
424
	  for(int j =0; j<servers.length;j++){
425
	  for(int j =0; j<servers.length;j++){
425
			String id = runtimes_.getId(selection);
426
			String id = runtimes_.getId(selection);
426
			if(id.equals(servers[j].getRuntime().getId())){
427
			if(id.equals(servers[j].getServerType().getId())){
427
				serverInstances_.add(servers[j].getId(), servers[j].getName());
428
				serverInstances_.add(servers[j].getId(), servers[j].getName());
428
				serverInstanceTypeCombo_.add(servers[j].getName());
429
				serverInstanceTypeCombo_.add(servers[j].getName());
429
			}
430
			}
430
	  }
431
	  }
431
	  serverInstanceTypeCombo_.select(0);
432
	  serverInstanceTypeCombo_.select(0);
432
	 
433
	  
434
	  serverInstanceTypeCombo_.setEnabled(serverInstances_.size() > 0 );
433
  }  
435
  }  
434
  
436
  
435
  // Here are the getters and setters for this widget.
437
  // Here are the getters and setters for this widget.
Lines 481-486 Link Here
481
	  return project;
483
	  return project;
482
  }
484
  }
483
  
485
  
486
  private String getServerTypeIdForRuntime(IRuntime rt) {
487
	  IServerType[] serverTypes = ServerCore.getServerTypes();
488
	  for (IServerType sType : serverTypes) {
489
		  if (sType.getRuntimeType() == rt.getRuntimeType() ){
490
			  return sType.getId();
491
492
		  }
493
	  }
494
	  return null;
495
  }
484
  
496
  
485
  public void initServersTypes() 
497
  public void initServersTypes() 
486
  {
498
  {
Lines 488-496 Link Here
488
		runtimes_ = new LabelsAndIds();
500
		runtimes_ = new LabelsAndIds();
489
	IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
501
	IServer[] servers = org.eclipse.wst.server.core.ServerCore.getServers();
490
	IRuntime[] runtimes = org.eclipse.wst.server.core.ServerCore.getRuntimes();
502
	IRuntime[] runtimes = org.eclipse.wst.server.core.ServerCore.getRuntimes();
491
	IServerType[] serverTypes = ServerCore.getServerTypes();
492
	
493
	
494
	
503
	
495
	String projectName = projectCombo_.getText();
504
	String projectName = projectCombo_.getText();
496
	
505
	
Lines 513-524 Link Here
513
			if(isWebProject){
522
			if(isWebProject){
514
				org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime = FacetUtil.getRuntime(runtimes[i]);
523
				org.eclipse.wst.common.project.facet.core.runtime.IRuntime runtime = FacetUtil.getRuntime(runtimes[i]);
515
				if(FacetUtils.doesRuntimeSupportFacets(runtime, projectFacets)){
524
				if(FacetUtils.doesRuntimeSupportFacets(runtime, projectFacets)){
516
					runtimes_.add(runtimes[i].getId(), runtimes[i].getName());
525
					runtimes_.add(getServerTypeIdForRuntime(runtimes[i]), runtimes[i].getName());
517
					runtimesCombo.add( runtimes[i].getName() );
526
					runtimesCombo.add( runtimes[i].getName() );
518
				}
527
				}
519
			}
528
			}
520
			else{
529
			else{
521
				runtimes_.add(runtimes[i].getId(), runtimes[i].getName());
530
				runtimes_.add(getServerTypeIdForRuntime(runtimes[i]), runtimes[i].getName());
522
				runtimesCombo.add( runtimes[i].getName() );	
531
				runtimesCombo.add( runtimes[i].getName() );	
523
			}
532
			}
524
		}
533
		}
Lines 532-539 Link Here
532
	String id = runtimes_.getId(0);
541
	String id = runtimes_.getId(0);
533
	if(id != null){
542
	if(id != null){
534
		for(int k =0; k<servers.length;k++){
543
		for(int k =0; k<servers.length;k++){
535
			if(servers[k].getRuntime() != null){
544
			if(servers[k].getServerType() != null){
536
				if(id.equals(servers[k].getRuntime().getId())&& canRunTestClient_){
545
				if(id.equals(servers[k].getServerType().getId())&& canRunTestClient_){
537
					serverInstances_.add(servers[k].getId(), servers[k].getName());
546
					serverInstances_.add(servers[k].getId(), servers[k].getName());
538
					serverInstanceTypeCombo_.add(servers[k].getName());
547
					serverInstanceTypeCombo_.add(servers[k].getName());
539
				}
548
				}

Return to bug 247535