Hi Andreas, I have posted the same question on the Axis users list and they gave me a solution, that raise another question.
The solution is to modify the WSDL file modifying the attribute "elementFormDefault" of the tag <element> to "qualified" .
Actually  in the WSDL generated by mono this attribute is called "form".

The effect on the XML sent by Axis is the following:

<?xml version="1.0" encoding="UTF-8"?>
<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>
<idprogetto xmlns=" http://localhost:8088/DocProviderWS/">
<valore>oi</valore>
</idprogetto></soapenv:Body>
</soapenv:Envelope>

As you can see there is no xmlns attribute at all in the tag valore and this assumed by mono as to get the same xmlns of the father.



The reason is that in .NET this attribute is generated as "unqualified" by default  but assumed as "qualified" when a call to the web service comes.
In fact scrolling the source of my web service and looking at the valore definition I can see:

[System.Xml.Serialization.XmlElementAttribute(Form=System.Xml.Schema.XmlSchemaForm.Unqualified)]

public string valore;


To give you the complete picture: the web service stub has been generated from another wsdl using the "wsdl.exe /server" command


At 00.08 25/01/2006, Andreas Färber wrote:

Ciao,

 I'm trying to consume a web service running under XSP  using an Axis Client.
 I have developed the web service and downloaded the WSDL.
 Then I have built the client using wsdl2java.
 When I try to call a method I don't get the expected answer.
 I have been able to diagnose that the web service is not getting the parameter specificied in my call.

 I have used a proxy server to read the XML sent by the Axis client.
 Here it is:

 <?xml version="1.0" encoding="UTF-8"?>
 <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>
 <idprogetto xmlns=" http://localhost:8088/DocProviderWS/">
 <valore xmlns="">s</valore>
 </idprogetto>
 </soapenv:Body>
 </soapenv:Envelope>

Maybe you need to add some more SoapElement attributes specifying the correct namespace in your XSP based code?

 I have found a solution reading on the Internet: have to specify the xmlns attribute in all the childs, like this.

 <?xml version="1.0" encoding="UTF-8"?>
 <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>
 <idprogetto xmlns=" http://localhost:8088/DocProviderWS/">
 <valore xmlns=" http://localhost:8088/DocProviderWS">s</valore>
 </idprogetto>
 </soapenv:Body>
 </soapenv:Envelope>

 Is there soemone who knows how to avoid the web service to require this value in all the childs ?

The problem is most likely not that it's required to have them in *all* child nodes - the problem is that your Axis based code is using an *incorrect* default xmlns attribute value of "" for the valore element which is from there on inherited to all its child nodes.

Andreas

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list



--
No virus found in this incoming message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.14.21/235 - Release Date: 19/01/2006

==================================================
Archimede Informatica NEWS!
==================================================

Realizzato il Sistema Integrato per la biglietteria della Torre di Pisa:
prenotazione, vendita, pre-vendita ed emissione dei biglietti di ingresso
alla Torre sia online che presso le biglietterie dislocate sulla piazza:

http://www.opapisa.it/boxoffice

Partner del Progetto Ci-Tel "Front office Telematico per il cittadino"
Ente Coordinatore Comune di Pisa

http://www.comune.pisa.it/doc/e-government.htm


==================================================
dott. Ivano Mario Luberti
Archimede Informatica societa' cooperativa a r. l.
Sede Operativa
Via Gereschi 36 - 56126- Pisa
tel.: +39-050- 580959
tel/fax: +39-050-9711344
e-mail: [EMAIL PROTECTED]
web: http://www.archicoop.it



No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.1.375 / Virus Database: 267.14.21/235 - Release Date: 19/01/2006

_______________________________________________
Mono-list maillist  -  Mono-list@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to