Hi,

I seem to have a general problem with namespaces.  I've re-compiled my
soap service using a flat namespace (just blank) and re-wrote my simple
java test client to see if it all works.  I am certain I removed all the
.Class files, all build files basically but it still compiles the java
client with a namespace of ns1.  When I test the client I get this error

Generated fault: [Attributes={}] [faultCode=SOAP-ENV:Client]
[faultString=Method 'ns1:square' not implemented] [faultActorURI=null]
[DetailEntries=] [FaultEntries=]

My c++ client works just fine with the service, and soapclient.com was
able to easily invoke it.

Any idea where my program is getting that ns1 from?

P.S don't blame me on the machine name ;) it wasn't my choice.

public class Square {
        public static void main (String[] args) {
                if (args.length != 1) {
                        System.err.println("Usage: java " +
                        Quote.class.getName () + " INTEGER");
                }

                try {
                URL url = new URL("http://thrush:18081";);

                Integer value  = new Integer(args[0]);

                Call call = new Call();
                //Header header = new Header();
                //header.declareNamespace("ns1", "urn:square");
                //call.setHeader(header);
                //call.setTargetObjectURI("urn:square");
                call.setMethodName("square");

                Vector params = new Vector();
                params.addElement(new Parameter("_0", Integer.class,
value, Constants.NS_URI_SOAP_ENC));
                call.setParams(params);

                Response resp = call.invoke(url, "");

                if (resp.generatedFault ()) {
                        Fault fault = resp.getFault ();
                        System.err.println("Generated fault: " + fault);
                }

                else {
                        Parameter result = resp.getReturnValue ();
                        System.out.println (result.getValue());
                }
                }
                catch (org.apache.soap.SOAPException e) {
                        System.err.println("SOAPException " + e);
                }
                catch (Exception e) {
                        System.err.println("Exception " + e);
                }
        }
}

Reply via email to