axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Doug Davis" <...@us.ibm.com>
Subject problem with namespaces
Date Tue, 13 Nov 2001 17:49:13 GMT
Given (a.java):
--------------------------------------------------------------
import org.apache.axis.client.* ;
import org.apache.axis.message.* ;
import java.net.*;
import java.io.*;

public class a {
  public void run() throws Exception {
    FileInputStream in = new FileInputStream("a");
    SOAPBodyElement body = new SOAPBodyElement(in);
    in.close();

    Service service = new Service();
    Call call = (Call) service.createCall();
    call.setTargetEndpointAddress( new URL("http://localhost:8080/axis") );
    call.invoke( new Object[] { body } );
  }

  static public void main(String[] args) {
    try {
      (new a()).run();
    }
    catch(Exception e ) {
      e.printStackTrace();
    }
  }
}
--------------------------------------------------------------------------
where File "a" is:

<a:insert xmlns:a="http://schemas.xmlsoap.org/data/"
          xmlns:b="http://www.w3.org/2001/XMLSchema-instance"
          b:loc="http://foo.wsdl" a:operationID="1">
</a:insert>

--- generates  ---

<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi
="http://www.w3.org/2001/XMLSchema-instance">
 <SOAP-ENV:Body>
   <a:insert b:b:loc="http://foo.wsdl" a:a:operationID="1" xmlns:a="http://schemas.xmlsoap.org/data/"
xmlns:b
="http://www.w3.org/2001/XMLSchema-instance">
   </a:insert>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>


Notice the double "b:" and double "a:" in the body.
Glen - has something changed with namespace recently?

-Dug


Mime
View raw message