I am new to this forum.
I am working on java web services. I am using "wsdl2java" tool to create a java stub file.
In my wsdl file value of targetnamespace is "urn:HPD_IncidentInterface_Create_WS" but i want to remove this urn prefix from java stub file.
I can't change wsdl file as it is application generated so is there any way to do this.
First of all, why do you want to remove the namespace prefix?
Second, in JAX-WS, there is the concept of handlers. A handler can be used to process requests and responses going in and/or out of a web service or a web service client.
Note that handlers do introduce a certain overhead.
I want to remove prefixes because when server is sending response, its without "urn" prefix but when it matches this response with namespace with "urn" prefix in java stub file using "getreadername()" function and at that time it gives me error "unexpected subelement"
Joined: Oct 04, 2006
I would suspect that there is some problem with the API you use for XML binding, assuming you are generating these classes from the WSDL. What is the API you are using?
Anyway, if you are not at liberty to swap the API out, then a handler may be your solution (as in previous post).
subject: How to remove prefix from target namespace