2

Here's my big trouble. I'm trying to invoke a specific ws with this request:

Here's my Java code used in an Android project:

First, is it possible to print out the XML generated by this request? Anyway, the result returned by my request is always a "fail", I think that's because the SetReport tag use a specific namespace.(e.g. <**ws:**SetReport> ) How do I specify this type of namespace in my request?? In other words, how can I create an Envelope with xmlns:xs="http://ws.comunichiamo.com" ?

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
ilsologheo00
  • 57
  • 1
  • 7

1 Answers1

2

You've already set the namespace when creating the SoapObject and that's the correct way.

You can obtain the real strings being sent between client and server by setting

androidHttpTransport.debug = true;

and then looking into androidHttpTransport.requestDump and responseDump after the request.

(What is a "fail"? Is it an exception? What does it say?)

Some notes: you don't need to set the type for primitive ones like String and ints, and if you're using last version of KSoap2 there should be an HttpTransportSE class that is suggested to use in place of AndroidHttpTransport.

(+1 per user e password ;) )

bigstones
  • 15,087
  • 7
  • 65
  • 82
  • Fail is the response given me by the web service. – ilsologheo00 Mar 20 '11 at 11:03
  • So, it seems that I can invoke it correctly, but I must put some wrong parameters in my request...P.S. Are you italian? – ilsologheo00 Mar 20 '11 at 11:03
  • @ilsologheo00 you should get some error message from the server, at least in `responseDump`. Are you getting into the catch block? If you're getting a `SoapFault` exception it should tell you if it's a server or client fault. (si' sono italiano) – bigstones Mar 20 '11 at 14:30
  • @ilsologheo00 il peggior genere di messaggi d'errore. Ho visto che il webservice non e' dotnet. Hai provato con `envelope.dotNet = false`? – bigstones Mar 20 '11 at 17:26
  • Yes! Adesso funziona! Ti ringrazio davvero! – ilsologheo00 Mar 20 '11 at 17:38
  • For the non-Italian speaking (like me) - The solution was to set `dotNet=false`. Worked for me aswell. Seems, that this option was messing with namespaces somehow. – Janis Peisenieks Feb 21 '12 at 09:21