You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Rares Pop <ra...@axz.ro> on 2010/04/15 08:50:09 UTC
How to configure the namespace prefix for a request stub ?
Hello,
I am writing a client to a .NET based webservice I have no control over and I am using Axis 1.5.1 and XmlBeans.
It requires the method request node to have an empty namespace prefix otherwise it returns a "Bad request".
Is there a way to enforce that? By default the request stub is associated with an "ns:" prefix:
It writes <ns:GetRespondents ... and I want <GetRespondents.
I've googled for many hours and only got this hint: http://wiki.apache.org/xmlbeans/XmlBeansFaq#suggestedPrefixes
HashMap suggestedPrefixes = new HashMap();
suggestedPrefixes.put("http://foo.com/", "");
XmlOptions opts = new XmlOptions();
opts.setSaveSuggestedPrefixes(suggestedPrefixes);
String output = document.xmlText(opts)
But I do not know how to configure the stub (or Axis in general) to use the custom XmlOptions.
Can you please help or point me to the right direction?
Thank you,
Rares
Re: How to configure the namespace prefix for a request stub ?
Posted by Amila Suriarachchi <am...@gmail.com>.
Axis2 does not support this option. you may need to change the generated
code.
thanks,
Amila.
On Thu, Apr 15, 2010 at 12:20 PM, Rares Pop <ra...@axz.ro> wrote:
> Hello,
>
> I am writing a client to a .NET based webservice I have no control over and
> I am using Axis 1.5.1 and XmlBeans.
> It requires the method request node to have an empty namespace prefix
> otherwise it returns a "Bad request".
>
> Is there a way to enforce that? By default the request stub is associated
> with an "ns:" prefix:
> It writes <ns:GetRespondents ... and I want <GetRespondents.
>
> I've googled for many hours and only got this hint:
> http://wiki.apache.org/xmlbeans/XmlBeansFaq#suggestedPrefixes
>
> HashMap suggestedPrefixes = new HashMap();
> suggestedPrefixes.put("http://foo.com/", "");
> XmlOptions opts = new XmlOptions();
> opts.setSaveSuggestedPrefixes(suggestedPrefixes);
>
> String output = document.xmlText(opts)
>
> But I do not know how to configure the stub (or Axis in general) to use
> the custom XmlOptions.
>
> Can you please help or point me to the right direction?
>
> Thank you,
> Rares
>
--
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/