Skip to main content


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 11:57
Wafi Dahman is currently offline Wafi DahmanFriend
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: Sun Oct 06 23:08:40 GMT 2024

Powered by FUDForum. Page generated in 0.03527 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top