This implementation uses wsimport (JAX-WS) to generate the interfaces for QWC Web Services.
download.oracle.com/javase/6/docs/technotes/tools/share/wsimport.html
The example.qwc is needed in order to add an application in the QuickBooks Web Connector.
This example is available on the QuickBooks Web Connector Programmer Guide.
member.developer.intuit.com/qbSDK-current/QBSDK7.0/doc/PDF/QBWC_proguide.pdf
<?xml version="1.0"?> <QBWCXML> <AppName>WCWebService1</AppName> <AppID></AppID> <AppURL>http://localhost/WCWebService/WCWebService.asmx</AppURL> <AppDescription>A short description for WCWebService1</AppDescription> <AppSupport>http://developer.intuit.com</AppSupport> <UserName>iqbal1</UserName> <OwnerID>{57F3B9B1-86F1-4fcc-B1EE-566DE1813D20}</OwnerID> <FileID>{90A44FB5-33D9-4815-AC85-BC87A7E7D1EB}</FileID> <QBType>QBFS</QBType> <Scheduler> <RunEveryNMinutes>2</RunEveryNMinutes> </Scheduler> </QBWCXML>
You must change these values based on your own configuration.
Pay attention on the AppURL, HTTP is only permitted for localhost, for the “internet” you must use HTTPS.
To use this implementation you only need to implement the com.cantero.ws.client.QBWebConnectorSvcSoap.
@WebService(endpointInterface = "com.cantero.ws.client.QBWebConnectorSvcSoap") public class ItemQueryRqSoapImpl implements QBWebConnectorSvcSoap {
This gist gist.github.com/703886 contains a sample implementation.
Java SE version:
package com.cantero.quickbooks.ws; import javax.xml.ws.Endpoint; public class Main { public static void main(String[] args) { Endpoint.publish("http://192.168.0.137:54321/ItemQueryRqSoapImpl", new ItemQueryRqSoapImpl()); } }
Spring version - app-config.xml:
<bean class="org.springframework.remoting.jaxws.SimpleJaxWsServiceExporter"> <property name="baseAddress" value="http://192.168.0.137:9801/" /> </bean> <bean id="ItemInventoryQueryRqWS" class="com.cantero.atec.placar_online.quickbooks.ws.ItemInventoryQueryRqWS" />
A pratical guide to integrate QWC with Java SE (in portuguese):
pablocantero.com/blog/2010/08/17/guia-pratico-do-quickbooks-web-connector-com-java
An example using Spring MVC (also in portuguese):
pablocantero.com/blog/2010/08/28/publicando-um-web-service-jax-ws-spring-mvc-3