How is your WSDL file? Is it something like this?
http://www.xyz.com/xy.../xy.../webservice
Where do you have the optional tag? Is it after the "webservice" in the above URL?
If yes, while creating the consumer proxy just give the URL till "webservice" and ignore the content after that.