Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Web Services / February 2005

Tip: Looking for answers? Try searching our database.

Namespace Prefix problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Anirudh - 07 Feb 2005 09:42 GMT
Hi,
   i have a SOAP XML which is similar to this:

<request xmlns="http://www.someurl.com">
 <abc>
   <xyz></xyz>
   <xyz></xyz>
 </abc>

I need the same namespace for 'request' and 'abc' but i want to
maintain the default namespace for 'xyz'. i.e, i want the xml to look
something like this:

<prefix:request xmlns:prefix="http://www.someurl.com">
 <prefix:abc>
   <xyz></xyz> // These do NOT come under 'prefix'.
   <xyz></xyz> //  They are xmlns = "".
 </prefix:abc>

Is there any way i can achieve this? What do i need to specify in the
attribute tags? Thanks in advance.
Dilip Krishnan - 07 Feb 2005 13:41 GMT
Hello anirudh.chandrakant@gmail.com,
  you need to add [XmlElement("xyz", Namespace="")] to the xyz type declaration

HTH
Regards,
Dilip Krishnan
MCAD, MCSD.net
dkrishnan at geniant dot com
http://www.geniant.com

> Hi,
> i have a SOAP XML which is similar to this:
[quoted text clipped - 14 lines]
> Is there any way i can achieve this? What do i need to specify in the
> attribute tags? Thanks in advance.
Anirudh - 08 Feb 2005 16:08 GMT
Hi Dilip,
  Thanks for the info. Could also also tell me how i can attach a
prefix to a tag (in this case, 'request' and 'abc' and omit that prefix
for 'xyz'). Thanks again.
-Anirudh
Dan Rogers - 15 Feb 2005 22:38 GMT
Unless you use a namespace manager, it is up to the serializer to resolve
whether it uses prefixes or inline default namespace markup.  The two are
equivalent, and to be XML compliant, a parser must be albe to treat both as
if they were the same.

Some of the pretty basic WS tools and hand-coded XML crackers attached to
port listeners have problems because they try to treat XML as if it were a
string.  I wouldn't worry about the on-the wire format.

--------------------
>From: "Anirudh" <anirudh.chandrakant@gmail.com>
>Newsgroups: microsoft.public.dotnet.framework.aspnet.webservices
[quoted text clipped - 9 lines]
>Content-Type: text/plain; charset="iso-8859-1"
>X-Trace: posting.google.com 1107878903 31115 127.0.0.1 (8 Feb 2005
16:08:23 GMT)
>X-Complaints-To: groups-abuse@google.com
>NNTP-Posting-Date: Tue, 8 Feb 2005 16:08:23 +0000 (UTC)
[quoted text clipped - 4 lines]
>   posting-account=eRjlSA0AAADte3ZUkFlDNKEd6cdZlzrd
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED02.phx.gbl!tornado.fastwebnet.it!tiscali!new
sfeed1.ip.tiscali.net!proxad.net!216.239.36.134.MISMATCH!postnews.google.com
!o13g2000cwo.googlegroups.com!not-for-mail
>Xref: cpmsftngxa10.phx.gbl
microsoft.public.dotnet.framework.aspnet.webservices:28017
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet.webservices
>
[quoted text clipped - 3 lines]
>for 'xyz'). Thanks again.
>-Anirudh

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.