File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes AXIS XML calling .Net Web Service Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "AXIS XML calling .Net Web Service" Watch "AXIS XML calling .Net Web Service" New topic

AXIS XML calling .Net Web Service


Joined: Sep 23, 2003
Posts: 9
I am attempting to call a very basic "HelloWorld" .Net WS using AXIS. The XML submitted from my AXIS client looks like

<soapenv:Envelope xmlns:soapenv="" xmlns:xsd="" xmlns:xsi="">
<ns1:HelloWorld soapenv:encodingStyle="" xmlns:ns1="">
<p_name xsi:type="xsd:string">John</p_name>

While this invokes the service it does not seem to pass the parameter in. I assumed this was because the p_name parameter was not qualified so when I manually modify the XML to

<soap:Envelope xmlns:xsi="" xmlns:xsd="" xmlns:soap="">
<ns1:HelloWorld xmlns:ns1="">
<ns1 _name xsi:type="xsd:string">John</ns1 _name>

and submit this via a SOAP Tool I have it works fine. My question is how do I qualify the parameter with the ns1: qualification in code?

Also do child entities not inherit the namespace of their parent? i.e. Should the p_name parameter need qualification? (obviously it does but I don't really understand why)

Any help greatly appreciated.

Java Source

* Created on 14 March 2006, 20:17
* To change this template, choose Tools | Template Manager
* and open the template in the editor.

package javaapplication1;

import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;

* @author
public class Main {

/** Creates a new instance of Main */
public Main() {}

* @param args the command line arguments
public static void main(String [] args) {
try {
String endpoint = "http://localhost:8090/";

Service service = new Service();
Call call = (Call) service.createCall();

call.setTargetEndpointAddress( new );

call.setOperationName(new QName("", "HelloWorld") );


String ret = (String) call.invoke( new Object[] { new String("John") } );

System.out.println("Sent 'John!', got '" + ret + "'");
} catch (Exception e) {
I agree. Here's the link:
subject: AXIS XML calling .Net Web Service
It's not a secret anymore!