Just to give a big context of my idea.
I have to consume a Java Service. And some methods have value types as parameters like int, decimal.
I generated a proxy through the svcutil.exe
and of course it generates the methods with the respective types, but I want to generate them as nullables...
Instead of decimal
, I want them to be decimal?
, you may asky why?
Well the reason is because that Java Service is an autogenerated service through JBoss, they just make an oracle package and expose it through Jboss and generate the Service. So some procedures do things like this...
WHERE COLUMN = NVL(PARAM_NOT_MARKED_AS_NULLABLE_IN_SERVICE, COLUMN)
AND COLUMN2 = NVL(ANOTHER_PARAM_NOT_NULLABLE_IN_SERVICE, COLUMN2)
So you must know that is not the same if a consume the service like this
WSClient.somemethod(0, 0,0);
than like this
WSClient.somemethod(null, null,null);
This last one will return some result when the first one not.
I cannot change the service, I cannot request them to change the definition of the WSDL because is autogenerated for them. They know nothing about Java, just pl-sql.
I manually changed my autogenerated proxy to test, if this idea would work, and changed the parameter types of a method to nullables, I tested it, and, as guessed, it worked like a charm.
The service is continously changing, some parameters are added, deleted, improved, etc, so when is a change on the service I generate the proxy again and just copy and paste it to my project
I generate the service like this:
svcutil /ct:System.Collections.Generic.List`1 http://Myurl?wsdl
I think it would be really painful if I have to manually change every method every time I regenerate my proxy
I'm open to use another software, to use an special command of svcutil, to use another tool, whatever, but I'm looking a way to change the value paremeter types of the methods to nullable types, I have to remark that just method parameters not all the parameters, because some objects definition, in fact have properties with nullable types and they can be null from the origin.
I know I'm asking something that is wrong, the real solution should be that the service would be interoperable, but as I said, I cannot ask that.
I don't think a manually Find and Replace to look that is a method and change it to "? " should be the best idea.
I would really appreciate any help.
Regards,