After a nice IRC chat with Glen, I can answer my own question. With this addition, the 
dynamic call works:

    call.setOperationStyle("wrapped");
    call.setEncodingStyle("");
    call.addParameter(new QName("http://tempuri.org/";, "arg0"), Constants.XSD_STRING, 
ParameterMode.IN);

Call.invoke() then sends (this I told you wrong on IRC, Glen):
<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>
  <adresseActive xmlns="http://tempuri.org/";>
   <arg0>Test</arg0>
  </adresseActive>
 </soapenv:Body>
</soapenv:Envelope>


Many thanks, Glen, for that fast help! :-)




> -----Original Message-----
> From: Thomas Börkel 
> Sent: Dienstag, 26. November 2002 16:35
> To: Axis Dev Mailinglist
> Subject: Why does Call.invoke() use ns1 namespace? -> problem 
> with .NET service
> 
> 
> HI!
> 
> I'd like to call a .NET service dynamically, with 
> Call.invoke(). But the arguments are always NULL at the .NET 
> side. If I generate a Java proxy, then it works. I figured, 
> .NET has (again) a namespace problem, because this is the 
> difference between the two calls. But why does Axis use this 
> ns1 namespace at all? Is there a workaround for this?
> 
> This is what Axis 1.0 sends, when using Call.invoke():
> <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:adresseActive 
> soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encodin
> g/" xmlns:ns1="http://tempuri.org/";>
>    <arg0>Test</arg0>
>   </ns1:adresseActive>
>  </soapenv:Body>
> </soapenv:Envelope>
> 
> 
> And this is being sent, when using the Proxy:
> <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>
>   <adresseActive xmlns="http://tempuri.org/";>
>    <arg0>Test</arg0>
>   </adresseActive>
>  </soapenv:Body>
> </soapenv:Envelope>
> 
> 
> This is my code for the dynamic call:
>     Service service;
>     Call call;
>     Object result;
> 
>     service = new Service();
>     call = (Call)service.createCall();
>     call.setScopedProperty(Call.SEND_TYPE_ATTR, Boolean.FALSE);
>     call.setTargetEndpointAddress(new 
> URL("http://localhost:81/dwsshop/Service1.asmx";));
>     call.setOperationName ("adresseActive");
>     call.setSOAPActionURI("http://tempuri.org/adresseActive";);
>     call.setUseSOAPAction(true);
>     String[] myArgs = new String[1];
>     myArgs[0] = "Test";
> 
>     result = call.invoke("http://tempuri.org/";, 
> "adresseActive", myArgs);
> 
> 
> Anyone any idea?
> 
> Thanks!
> 
> Regards,
> Thomas
> 
> 

Reply via email to