• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

soap change prefix for response

 
stefano tud
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I need to consume a web service I cannot control
the problem is the ws needs a prefix like soapenv instead of default SOAP-ENV
I solved request creation using this code:

now the request is OK
but how can i change the prefix I read from SOAPEnvelop?
the response has soapenv instead of SOAP-ENV too

thanks
 
Paul Clapham
Sheriff
Posts: 21117
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
stefano tud wrote:the problem is the ws needs a prefix like soapenv instead of default SOAP-ENV


Why is that the case? Normally the choice of prefix is irrelevant, it's the namespace URI which is important. If you have written an application which depends on a specific prefix instead of a specific namespace URI, there's a good chance you haven't written that application correctly.
 
stefano tud
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As I wrote, I'm not controlling the ws, I need just to consume it and it wants a <soapenv> prefix for request and response.
don't ask me why...
the request was not working till I change prefix
and I cannot read response because functions look for <SOAP-ENV> prefix
In the response I removed namespace and added that ws required
 
Naren Chivukula
Ranch Hand
Posts: 577
Java Notepad Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Stefano,
the request was not working till I change prefix

This makes sense, if I presume the service provider is using some XML parser to read your request SOAP message than standard Web Services API.
but how can i change the prefix I read from SOAPEnvelop?

I'm sure if you are getting response SOAP message, it'd be conformed to SOAP specification and so it is a valid SOAP message. If so, it can be read by your Web Services API irrespective of whatever prefix it uses.

Otherwise, if the response SOAP message is not a valid SOAP message then use any XML parser to read it.
 
stefano tud
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm using a workaround:
is full while is empty, then I can get tags I need using and then traversal NodeList
 
Jim Akmer
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Naren Chivukula:
This makes sense, if I presume the service provider is using some XML parser to read your request SOAP message than standard Web Services API.

Otherwise, if the response SOAP message is not a valid SOAP message then use any XML parser to read it.


I am not sure I understand these comments.
SOAP is XML. So any XML parser can be used to parse SOAP messages. Standard Web Services API use regular XML parsers under the hood(DOM or StAX); so I am not sure what you are saying here
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic