You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Diego Dagum <di...@gmx.net> on 2004/09/29 21:35:32 UTC
XSD Schema
Hi fellows:
I'm having troubles trying to contact a server. I have to send this HTTP
POST
POST /tarificaForum1/service1.asmx HTTP/1.1
Host: acrux.fidens.cl
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "http://tempuri.org/Tarificar"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<Tarificar xmlns="http://tempuri.org/">
<dsPeticion>
<xsd:schema>schema</xsd:schema>xml</dsPeticion>
</Tarificar>
</soap:Body>
</soap:Envelope>
I only can send this one
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:Tarificar
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="http://tempuri.org/">
<dsPeticion href="#id0"/>
</ns1:Tarificar>
<multiRef id="id0" soapenc:root="0"
soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
xsi:type="xsd:schema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"/>
</soapenv:Body>
</soapenv:Envelope>
That is, my dsPeticion node goes empty, without xsd:schema child. This
xsd:schema child goes embedded in a multiRef node
How can I build the former HTTP POST?
My logic is the following:
import javax.xml.namespace.QName;
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.types.Schema;
public class TestClient {
public static void main(String[] args) {
try {
String endpoint =
"http://acrux.fidens.cl/tarificaForum1/service1.asmx";
Service service = new Service();
Call call = (Call) service.createCall();
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.addParameter("dsPeticion",
org.apache.axis.Constants.XSD_SCHEMA,
javax.xml.rpc.ParameterMode.IN);
call.setReturnType(org.apache.axis.Constants.XSD_SCHEMA);
call.setOperationName(new QName("http://tempuri.org/", "Tarificar"));
call.setSOAPActionURI("http://tempuri.org/Tarificar");
Schema ret = (Schema) call.invoke(new Object[] { new Schema() } );
System.out.println("Output " + ret.toString());
} catch (Exception e) {
e.printStackTrace();
}
}
}
--
______________________________________
Diego A. Dagum (diegum@gmx.net)
(diegum@bigfoot.com)
icq: Tarang@
msn: Tarang@
GMX ProMail mit bestem Virenschutz http://www.gmx.net/de/go/mail
+++ Empfehlung der Redaktion +++ Internet Professionell 10/04 +++