QuickBooks WebConnector authentication fails: “unexpected element (uri:â€â€œ, local:â€strUserName“)â€
Web Technologies
Web Development
3 years ago
_x000D_
_x000D_
I'm trying to integrate a Java web application running under JBoss with QuickBooks Desktop and I'm using WebConnector for this purpose.
I also use JAX-WS for web service implementation in Java.
After a number of solved issues I have faced the one I've stuck: namely while WebConnector is trying to call authenticate method, JBoss throws the following exception:
[SOAPFaultHelperJAXWS] SOAP request exception
javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException:
unexpected element (uri:"", local:"strUserName"). Expected elements are <{http://developer.intuit.com/}strPassword>,<{http://developer.intuit.com/}strUserName>
and
[SOAPFaultHelperJAXWS] SOAP request exception
javax.xml.ws.WebServiceException: javax.xml.bind.UnmarshalException:
unexpected element (uri:"", local:"strVersion"). Expected elements are <{http://developer.intuit.com/}strVersion>
Interface:
@WebService(name = "QBWebConnectorService", targetNamespace = "http://developer.intuit.com/")
public interface QBWebConnectorService {
@WebMethod
public String serverVersion(
@WebParam(name = "strVersion", targetNamespace = "http://developer.intuit.com/")
String strVersion);
@WebMethod
public String clientVersion(
@WebParam(name = "strVersion", targetNamespace = "http://developer.intuit.com/")
String strVersion);
@WebMethod
public ArrayOfString authenticate(
@WebParam(name = "strUserName", targetNamespace = "http://developer.intuit.com/")
String strUserName,
@WebParam(name = "strPassword", targetNamespace = "http://developer.intuit.com/")
String strPassword);
...
}
Implementation:
@WebService(serviceName = "QBWebConnectorService", targetNamespace = "http://developer.intuit.com/", portName = "QBWebConnector", name = "QBWebConnector", endpointInterface = "com.example.myapp.ws.QBWebConnectorService")
public class QBWebConnector implements QBWebConnectorService {
@Override
public ArrayOfString authenticate(String strUserName, String strPassword) {
ArrayOfString arr = new ArrayOfString();
arr.string = new ArrayList();
arr.string.add("{57F3B8B1-86F1-4fcc-B1EE-566DE1813D20}");
arr.string.add(""); //To use the currently open company, specify an empty string
return arr;
}
...
}
Calls to serverVersion() and clientVersion() are executed as expected with no errors. And call to authenticate() has this issue with the namespace. But I just can't figure out why.
Can anybody provide some ideas? Thanks...
User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.