You need to sign in to do that
Don't have an account?
The prefix "urn" for element "urn:enterprise.soap.sforce.com" is not bound
Hi all,
I am using netbeans 6.9.1 and jax-ws to create an SObject(Account). The code to create an Account is
Create createParam = new Create();
QName qn = new QName("urn:enterprise.soap.sforce.com");
JAXBElement<String> aname = new JAXBElement<String>(qn,String.class,"NetBeans");
for (int i=0;i<5;i++) {
Account a = new Account();
aname.setValue("Netbeans"+i);
a.setName(aname);
createParam.getSObjects().add(a);
}
// create the records in Salesforce.com
CreateResponse cresponse = port.create(createParam);
For this code the exception is
"javax.xml.ws.soap.SOAPFaultException: The prefix "urn" for element "urn:enterprise.soap.sforce.com" is not bound".
The Marshalled XML code for aname is
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<urn:enterprise.soap.sforce.com xmlns:ns2="urn:sobject.enterprise.soap.sforce.com"
xmlns:ns3="urn:enterprise.soap.sforce.com">Netbeans</urn:enterprise.soap.sforce.com>
While trying to unmarshall this XML to JAXBElement<String> the same exception is occuring
"org.xml.sax.SAXParseException: The prefix "urn" for element "urn:enterprise.soap.sforce.com" is not bound".
What would be the problem in this code?
Please help me out!!!!
Thank you so much,
I corrected the code as
QName qn = new QName("urn:enterprise.soap.sforce.com","Name");
and it worked well.
Thank you...
All Answers
you're using the wrong qname constructor, and so generating garbage xml.
Thank you so much,
I corrected the code as
QName qn = new QName("urn:enterprise.soap.sforce.com","Name");
and it worked well.
Thank you...