Return-Path: Delivered-To: apmail-ws-axis-user-archive@www.apache.org Received: (qmail 80254 invoked from network); 3 Apr 2006 19:09:08 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 3 Apr 2006 19:09:08 -0000 Received: (qmail 1319 invoked by uid 500); 3 Apr 2006 19:08:59 -0000 Delivered-To: apmail-ws-axis-user-archive@ws.apache.org Received: (qmail 1304 invoked by uid 500); 3 Apr 2006 19:08:59 -0000 Mailing-List: contact axis-user-help@ws.apache.org; run by ezmlm Precedence: bulk Reply-To: axis-user@ws.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list axis-user@ws.apache.org Received: (qmail 1293 invoked by uid 99); 3 Apr 2006 19:08:58 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 12:08:58 -0700 X-ASF-Spam-Status: No, hits=4.0 required=10.0 tests=DNS_FROM_RFC_POST,HTML_MESSAGE,RCVD_IN_BL_SPAMCOP_NET,RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of anthony.hamill@ntlworld.com designates 81.103.221.48 as permitted sender) Received: from [81.103.221.48] (HELO mtaout02-winn.ispmail.ntl.com) (81.103.221.48) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Apr 2006 12:08:57 -0700 Received: from aamtaout03-winn.ispmail.ntl.com ([81.103.221.35]) by mtaout02-winn.ispmail.ntl.com with ESMTP id <20060403190835.WDXI29040.mtaout02-winn.ispmail.ntl.com@aamtaout03-winn.ispmail.ntl.com> for ; Mon, 3 Apr 2006 20:08:35 +0100 Received: from sbsserver ([82.29.226.180]) by aamtaout03-winn.ispmail.ntl.com with SMTP id <20060403190835.SSEB16286.aamtaout03-winn.ispmail.ntl.com@sbsserver> for ; Mon, 3 Apr 2006 20:08:35 +0100 Message-ID: <007001c65753$981d7fd0$0100000a@sbsserver> From: "Tony Hamill" To: Subject: Interop with .Net WS Date: Mon, 3 Apr 2006 20:19:54 +0100 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_006D_01C6575B.F8485C10" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1506 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1506 X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_006D_01C6575B.F8485C10 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi, I am attempting to call a very basic "HelloWorld" .Net WS using AXIS. = The XML submitted from my AXIS client looks like John=20 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 John 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? or how = do I set the default namespace as http://tempuri.org/ so the child node = will inherit it? 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 /* * Main.java * * 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=20 */ 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 =3D = "http://localhost:8090/com.company.AXISInterOp/Service1.asmx"; Service service =3D new Service(); Call call =3D (Call) service.createCall(); call.setTargetEndpointAddress( new java.net.URL(endpoint) ); call.setUseSOAPAction(true); call.setSOAPActionURI("http://tempuri.org/HelloWorld"); call.setOperationName(new QName("http://tempuri.org/", "HelloWorld") ); call.addParameter("p_name", org.apache.axis.Constants.XSD_STRING, javax.xml.rpc.ParameterMode.IN); call.setReturnType(org.apache.axis.Constants.XSD_STRING); String ret =3D (String) call.invoke( new Object[] { new String("John") } = ); System.out.println("Sent 'John!', got '" + ret + "'"); } catch (Exception e) { System.err.println(e.toString()); } } } ------=_NextPart_000_006D_01C6575B.F8485C10 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hi,
I am attempting to call a very = basic=20 "HelloWorld" .Net WS using AXIS. The XML submitted from my AXIS client = looks=20 like

<soapenv:Envelope=20 xmlns:soapenv=3D"http://schemas.xmlsoap.org/soap/envelope/"=20 xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20 xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance">
<soapen= v:Body>
<ns1:HelloWorld=20 soapenv:encodingStyle=3D"http://schemas.xmlsoap.org/soap/encoding/"=20 xmlns:ns1=3D"http://tempuri.org/">
<p_name=20 xsi:type=3D"xsd:string">John</p_name>=20
</ns1:HelloWorld>
</soapenv:Body>
</soapenv:Enve= lope>

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

<soap:Envelope=20 xmlns:xsi=3D"http://www.w3.org/2001/XMLSchema-instance"=20 xmlns:xsd=3D"http://www.w3.org/2001/XMLSchema"=20 xmlns:soap=3D"http://schemas.xmlsoap.org/soap/envelope/">
<soap:= Body>
<ns1:HelloWorld=20 xmlns:ns1=3D"http://tempuri.org/">
<ns1:p_name=20 xsi:type=3D"xsd:string">John</ns1:p_name>
</ns1:HelloWorld= >
</soap:Body>
</soap:Envelope>

and=20 submit this via a SOAP Tool I have it works fine. My question is how do = I=20 qualify the parameter with the ns1: qualification in code? or how do I = set the=20 default namespace as http://tempuri.org/ so=20 the child node will inherit it?

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

Any help = greatly=20 appreciated.

Java Source

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

package=20 javaapplication1;


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

/**
*
* @author
*/
public = class=20 Main {

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

/**
* @param args the command line = arguments
*/
public static=20 void main(String [] args) {
try {
String endpoint =3D=20 "http://localhost:8090/com.company.AXISInterOp/Service1.asmx";

Ser= vice=20 service =3D new Service();
Call call =3D (Call)=20 service.createCall();

call.setTargetEndpointAddress( new=20 java.net.URL(endpoint)=20 );

call.setUseSOAPAction(true);
call.setSOAPActionURI("http://t= empuri.org/HelloWorld");
call.setOperationName(new=20 QName("http://tempuri.org/", "HelloWorld")=20 );

call.addParameter("p_name",
org.apache.axis.Constants.XSD_ST= RING,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apach= e.axis.Constants.XSD_STRING);

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


System.out.println("Sent 'John!', got '" + ret + = "'");
} catch=20 (Exception e) {
System.err.println(e.toString());
}
}
}=20
------=_NextPart_000_006D_01C6575B.F8485C10--