Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / April 2005

Tip: Looking for answers? Try searching our database.

xmlns in web service

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Metin - 16 Apr 2005 12:24 GMT
I submit my form to  a web service.

public void submitStudentInfo(XmlElement studentInfo){
   XmlNamespaceManager xns = new XmlNamespaceManager(new NameTable());
   xns.AddNamespace("my",
http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-19T21:30:06");
}

Currently namespace is defined in the web method statically like above. But
i want to extract this information from submitted XmlElemet. What should i
do? How can i extract this information from XmlElement?

Thanks?
Mike Sharp - 19 Apr 2005 18:07 GMT
If you have a reference to the node you can use the NamespaceURI property to
get it.

public void submitStudentInfo(XmlElement studentInfo){
   String elementNamespaceUri = studentInfo.NamespaceURI;
   XmlNamespaceManager xns = new XmlNamespaceManager(new NameTable());
   xns.AddNamespace("my", elementNamespaceUri);
}

Sometimes, however, you may want to validate the submitted XML when you load
it. What I've been doing is adding a FormNamespaceURI header to my soap
request. So my InfoPath form sets the SOAPAction header along with a
"custom" FormNamespaceURI header.   This isn't the best of solutions,
because it's not a "standard" implementation of the SOAP spec.  But it's a
bit faster, I think.

Regards,
Mike Sharp

> I submit my form to  a web service.
>
> public void submitStudentInfo(XmlElement studentInfo){
>     XmlNamespaceManager xns = new XmlNamespaceManager(new NameTable());
>     xns.AddNamespace("my",

http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-03-19T21:30:06");
> }
>
[quoted text clipped - 3 lines]
>
> Thanks?
 
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.