on 03-08-2006 5:20 PM
soapelement.addAttribute(envelope.createName("xmlns:ns1"), "urn:Login");
is throwing up the following error message
org.w3c.dom.DOMException: Prefix is 'xmlns', but URI is not 'http://www.w3.org/2000/xmlns/' in the qualified name, 'xmlns:ns1'
This is happening will creating soap message.
Kindly let me know if you have any hint on it
Regards,
Satish
Hi Satish,
Try this...
soapelement.addNamespaceDeclaration("ns1","urn:Login");
or
soapelement.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:ns1","urn:Login");
Regards,
Uma
Message was edited by: Uma Maheswari
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It did't solve the problem. I am using webas 6.40 sps15 preview version. I am using old soap jars (soap 1.0 specification). How is urn: namespace handled in webas soap implementation ?
The actual code is this
Code -
SOAPConnectionFactory conFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = conFactory.createConnection();
MessageFactory mesFactory = MessageFactory.newInstance();
SOAPMessage message = mesFactory.createMessage();
SOAPPart part = message.getSOAPPart();
SOAPEnvelope envelope = part.getEnvelope();
URLEndpoint endpoint = new URLEndpoint(url);
SOAPBody soapBody = envelope.getBody();
envelope.addNamespaceDeclaration("xsi", "http://www.w3.org/2000/XMLSchema-instance");
envelope.addNamespaceDeclaration("xsd","http://www.w3.org/1999/XMLSchema");
SOAPBody body = envelope.getBody();
message.saveChanges();
SOAPElement element = body.addChildElement(envelope.createName("ns1:" + method));
Name name = envelope.createName("xmlns:ns1");
<b>SOAPElement element1 = element.addAttribute(name, "urn:Login"); </b>
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.