File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to remove prefix from target namespace

 
Hemant Aggarwal
Greenhorn
Posts: 2
Chrome Java Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

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.


Thanks
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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.
Best wishes!
 
Hemant Aggarwal
Greenhorn
Posts: 2
Chrome Java Redhat
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"
 
Ivan Krizsan
Ranch Hand
Posts: 2198
1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
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).
Best wishes!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic