| Code: |
|
public static void main(String[] args) { TCEScratchStoreWebServiceClient client = new TCEScratchStoreWebServiceClient(); //create a default service endpoint TCEScratchStoreWebServicePortType tCEScratchStoreWebServicePortType = client .getTCEScratchStoreWebServicePortTypeLocalEndpoint(); //TODO: Add custom client code here // //tCEScratchStoreWebServicePortType.yourServiceOperationHere(); Request req = new Request(); req.setUserId("Alph"); // ERROR HERE Response resp = tCEScratchStoreWebServicePortType.store(req); System.out.println("Response: " + resp.getMessage()); System.out.println("test client completed"); System.exit(0); } |
| Code: |
|
The method setUserId(JAXBElement<String>) in the type Request is not applicable for the arguments (String) |
| Code: |
|
@XmlElement(minOccurs="1", nillable=false) public String getUsername() { return userName; } |
| trans888 wrote: |
| This is not perfect (the service POJO now has to know that it is being advertised and how/with what framework), but it seems to work. |
| Code: |
| <jaxb:bindings version="2.0"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" xmlns:xjc="http://java.sun.com/xml/ns/jaxb/xjc" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <jaxb:bindings schemaLocation="http://localhost:81/services/PALMS?wsdl"> <jaxb:bindings node="/xs:schema"> <jaxb:globalBindings> <xjc:generateElementProperty>false</xjc:generateElementProperty> </jaxb:globalBindings> </jaxb:bindings> </jaxb:bindings> </jaxb:bindings> |
| Code: |
| <?xml version="1.0" encoding="UTF-8"?>
<project name="PALMS_Server_dist" default="all" basedir="."> <!-- adapted from http://cwiki.apache.org/CXF20DOC/ant-tasks.html --> <!-- adapted from http://cwiki.apache.org/CXF20DOC/wsdl-to-java.html --> <!-- CXF properties --> <property name="cxf.home" value="E:/Sysprog/ESB/apache-cxf-2.1.2/"/> <!-- input properties --> <property name="wsdl-src" value="http://localhost:81/services/PALMS?wsdl"/> <!-- output properties --> <property name="out-src" value="src"/> <!-- init target --> <target name="init"> <tstamp/> </target> <path id="cxf.classpath"> <fileset dir="${cxf.home}/lib"> <include name="*.jar"/> </fileset> </path> <!-- server target --> <target name="wsdl" depends="init" description="Captures WSDL and creates proxies"> <java classname="org.apache.cxf.tools.wsdlto.WSDLToJava" fork="true"> <arg value="-client"/> <arg value="-b"/> <arg value="javaBindings.xml"/> <arg value="-d"/> <arg value="${out-src}"/> <arg value="${wsdl-src}"/> <classpath> <path refid="cxf.classpath"/> </classpath> </java> </target> <!-- all target --> <target name="all" depends="wsdl" description="Builds the whole project"> <echo>Doing all</echo> </target> <!-- clean target --> <target name="clean" description="Removes previous build"> </target> </project> |