Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » The Generator does not produce the correct results from the first time!?
The Generator does not produce the correct results from the first time!? [message #504132] Thu, 17 December 2009 06:57
Wafi Dahman is currently offline Wafi Dahman
Messages: 15
Registered: November 2009
Junior Member
hello,

I generate java code out from UML. in order to get the correct and complete result, I have to run the workflow more than once

the first one :: incorrect
public Book getBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "getBook");
		rpcClient.getOptions().setAction("urn:getBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{Book.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after getBook invoke");

		Book book = (Book) response[0];

	}

	public String lendBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "lendBook");
		rpcClient.getOptions().setAction("urn:lendBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{String.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after lendBook invoke");

	}





the second one :: incorrect
public String lendBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "lendBook");
		rpcClient.getOptions().setAction("urn:lendBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{String.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after lendBook invoke");

		return (String) obj[0];
	}

	public Book getBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "getBook");
		rpcClient.getOptions().setAction("urn:getBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{Book.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after getBook invoke");

		Book book = (Book) response[0];

	}


the third one :: incorrect

	public String lendBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "lendBook");
		rpcClient.getOptions().setAction("urn:lendBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{String.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after lendBook invoke");

	}

	public Book getBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "getBook");
		rpcClient.getOptions().setAction("urn:getBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{Book.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after getBook invoke");

		Book book = (Book) response[0];

		if (book != null) {
			System.out.println(book.getBookInfo());
		} else {
			System.out.println("book is not found ...");
		}

		return (Book) response[0];
	}



another one >>> incorrect

another one >>> incorrect

the following one is correct .. !!

public String lendBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "lendBook");
		rpcClient.getOptions().setAction("urn:lendBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{String.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after lendBook invoke");

		return (String) obj[0];
	}

	public Book getBook(String isbn, RPCServiceClient rpcClient)
			throws AxisFault {
		QName opGet = new QName("http://service.webservice.sample", "getBook");
		rpcClient.getOptions().setAction("urn:getBook");
		ArrayList args = new ArrayList();
		Object[] opGetArgs = new Object[]{isbn};
		args.add(isbn);

		Class[] returnTypes = new Class[]{Book.class};
		Object[] response = rpcClient.invokeBlocking(opGet, opGetArgs,
				returnTypes);
		System.out.println("after getBook invoke");

		Book book = (Book) response[0];

		if (book != null) {
			System.out.println(book.getBookInfo());
		} else {
			System.out.println("book is not found ...");
		}

		return (Book) response[0];
	}


where this problem could be located?

Thanx in-advance
Previous Topic:[XPand] targetDef.proceed() fails
Next Topic:[XTEND] best practices cached extensions
Goto Forum:
  


Current Time: Fri Jul 25 05:10:18 EDT 2014

Powered by FUDForum. Page generated in 0.02203 seconds