code_junkie

Simple java client code for Web Service - something to do with QName?

Nov 11th, 2011
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.17 KB | None | 0 0
  1. Element or attribute do not match QName production: QName::=(NCName':')?NCName
  2.  
  3. import javax.xml.namespace.QName;
  4. import org.apache.axis.client.Call;
  5. import org.apache.axis.client.Service;
  6.  
  7. public class TestClient {
  8.  
  9. public static void main(String [] args)
  10. {
  11. try{
  12. String endpoint = "http://localhost:8080/TestWebService/services/DoesMagic";
  13.  
  14. Service service = new Service();
  15. Call call = (Call) service.createCall();
  16.  
  17. call.setTargetEndpointAddress( new java.net.URL(endpoint) );
  18. call.setOperationName( new QName("http://testPackage.fc.com/, doBasicStuff") );
  19.  
  20. String ret = (String) call.invoke( new Object[] {"some kind of message"} );
  21.  
  22. System.out.println(ret);
  23.  
  24. }catch(Exception e){
  25. System.err.println(e.toString());
  26. }
  27. }
  28. }
  29.  
  30. public String doBasicStuff(String message)
  31. {
  32. return "This is your message: " + message;
  33.  
  34. }
  35.  
  36. new QName("http://testPackage.fc.com/, doBasicStuff")
  37.  
  38. new QName("http://testPackage.fc.com/", "doBasicStuff")
  39.  
  40. new QName("http://testPackage.fc.com/, doBasicStuff")
  41.  
  42. public QName(String localPart) or
  43. public QName(final String namespaceURI, final String localPart)
Add Comment
Please, Sign In to add comment