• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

soap change prefix for response

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 28371
99
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 577
Tomcat Server Notepad Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic