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?
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?