RE: Newbie Help with Comples Type
Brian Mason <[email protected]> Thu, 23 Oct 2003 15:17:13 -0700
| Newsgroups | gmane.comp.java.enhydra.ksoap |
|---|---|
| Message-ID | <[email protected]> |
I have gotten the complex types to work Thanks all for the tips and links Thanks, Brian -----Original Message----- From: Hepp A., DP ITS,SMR,TR [mailto:[email protected]] Sent: Thursday, October 23, 2003 12:28 To: '[email protected]' Subject: AW: Ksoap: Newbie Help with Comples Type Please have a look at the link i gave you. Your prob is solved there. http://ksoap.enhydra.org/project/mailingLists/ksoap/msg00418.html GL&HF Regards Alex > -----Ursprüngliche Nachricht----- > Von: Brian Mason [mailto:[email protected]] > Gesendet: Donnerstag, 23. Oktober 2003 21:16 > An: '[email protected]' > Betreff: RE: Ksoap: Newbie Help with Comples Type > > > Thanks, > I thought it might be important because I keep getting an > error saying: > Prefix for namespace <urn:ciews.chrome.com is undefined. > No idea why? > > > > -----Original Message----- > From: Hepp A., DP ITS,SMR,TR [mailto:[email protected]] > Sent: Thursday, October 23, 2003 12:10 > To: '[email protected]' > Subject: AW: Ksoap: Newbie Help with Comples Type > > > Oh, sorry, my big fault. I wrote my own class that is extending > HttpTransportSe > in order to use my own Envelopes. > > Just ignore that line;) Sorry about that... > > I was using ksoap1.2. > > The problem with the prefix is solved by Stefan here: > http://ksoap.enhydra.org/project/mailingLists/ksoap/msg00418.html > > GL&HF > Regards. > Alex > > > -----Ursprüngliche Nachricht----- > > Von: Brian Mason [mailto:[email protected]] > > Gesendet: Donnerstag, 23. Oktober 2003 20:54 > > An: '[email protected]' > > Betreff: RE: Ksoap: Newbie Help with Comples Type > > > > > > In your email you have a line of code that sets the namespace on the > > transport object > > // this is important, as your namespace must fit, > > // otherwise, your mapping will not work > > setransport.setNamespace("myNameSpaceGoesHere"); > > > > The HttpTransport object I have does not have that call. > > When I try the SoapObject example in your link I get a: > > I get a runtime error that says "Prefix for namespace > > urn:ciews.chrome.com > > undefined. > > > > What version of KSoap are you using? > > > > Thanks, > > Brian > > > > > > -----Original Message----- > > From: Hepp A., DP ITS,SMR,TR [mailto:[email protected]] > > Sent: Thursday, October 23, 2003 11:00 > > To: '[email protected]' > > Subject: AW: Ksoap: Newbie Help with Comples Type > > > > > > There are 2 possibilities, as i found out, if anyone knows > > others, i´ll be > > listening,too. > > > > 1. > > - Write a class that implements org.ksoap.Marshal > > - overwrite readInstance() and/or writeInstance() and register() > > - create a ClassMap instance. > > - register your class with the ClassMap. > > - call the service and the Result gets mapped autmatically to the > > corresponding object. > > > > > > the register Method is quite important, as it maps the > > concrete Object-Class > > to your Marshaller. > > > > -------------------------------------START OF > > CODE-------------------------------------- > > class MyOwnMarshallerClass{ > > > > // ... as described overwrite writeInstance and readInstance ... > > > > public void register(ClassMap cm) { > > cm.addMapping > > ("myNameSpaceGoesHere", "MyObjectClassName", > > new MyObjectClassName.getClass(), this); > > } > > } > > > > Example with a SE-Transport (is similar to HttpTransport): > > // Anywhere else... > > > > setransport = new > > HttpTransportSE("http://www.my.endpoint.url", ""); > > > > // this is important, as your namespace must fit, > > // otherwise, your mapping will not work > > setransport.setNamespace("myNameSpaceGoesHere"); > > > > // Creating the ClassMap and registering > > > > // When using 1999 XML-Schema-Namespace use > > // constructor ClassMap(true) > > ClassMap cm = new ClassMap(); > > Marshal mps = new MyOwnMarshallerClass(); > > mps.register(cm); > > > > SoapObject rpc = new SoapObject(namespace, > "myMethodNameGoesHere"); > > > > setransport.setClassMap(cm); > > > > // We set debug in Transport to true so we can reach the > complete > > //responseMessage. > > setransport.debug = true; > > > > MyObjectClassName anInstanceOfThatClass = new > MyObjectClassName(); > > > > /* In this case an instance of MyObjectClassName gets marshalled > > to be sent to the service. > > It expects a String as result (an XML-Schema:string) > > You can also expect any other objects by registering them and > > casting the result. > > But you have to unmarshal (deserialize) the XML-Stuff to the > > objects yourself in the readInstance method. > > */ > > > > rpc.addProperty("MyObjectClassName",anInstanceOfThatClass); > > try { > > String result = (String)setransport.call(rpc); > > } > > -------------------------------------END OF > > CODE-------------------------------------- > > 2.Yes, there was this second possibility;) > > You can create a SoapObject and add some Parameters, that kSoap can > > recognize. > > Then you add the SoapObject as Parameter to the SoapObject > > you make the call > > with. > > > > Example? > > > > OK. > > This one is by Sebastien Petrucci, who is on the list also... > > > > http://ksoap.enhydra.org/project/mailingLists/ksoap/msg00739.html > > > > > > BTW: a good option is to look at old entries of the mailing list: > > > > http://ksoap.enhydra.org/project/mailingLists/ksoap/maillist.html > > > > GL & HF > > Best Regards > > Alex Hepp > > > > > -----Ursprüngliche Nachricht----- > > > Von: Brian Mason [mailto:[email protected]] > > > Gesendet: Donnerstag, 23. Oktober 2003 19:12 > > > An: '[email protected]' > > > Betreff: Ksoap: Newbie Help with Comples Type > > > > > > > > > I am trying to send and recieve complex data types and I am > > > having trouble > > > finding examples > > > Any help would be nice. > > > > > > > > > Thanks, > > > Brian D. Mason > > > Software Eng. > > > Chrome Systems Corporation > > > > > > e-mail: [email protected] > > > phone: 503-963-6338 > > > mobile: 503-708-1907 > > > fax: 503-963-6311 > > > toll-free: 800-936-8906 > > > > > > Chrome Inventory Everywhere(tm) - Edit and Export Your > > Vehicle Data in > > > Minutes... > > > Click Here for Demo: > > > <http://www.chrome.com/maing2/demos/demolist4.asp> > > > > > > Notice: This e-mail transmission and/or the attachments > > > accompanying it may > > > contain confidential information belonging to the sender or > > > Chrome Systems > > > Corporation. The information is only for the use of the > > > intended recipient. > > > If you have received this transmission in error, please > > > notify the sender > > > immediately by reply e-mail, and then destroy all copies of the > > > transmission. > > > > > > > > > > > > _______________________________________________ > > > Ksoap mailing list > > > [email protected] > > > http://www.enhydra.org/mailman/listinfo.cgi/ksoap > > > > > > > _______________________________________________ > > Ksoap mailing list > > [email protected] > > http://www.enhydra.org/mailman/listinfo.cgi/ksoap > > > > _______________________________________________ > > Ksoap mailing list > > [email protected] > > http://www.enhydra.org/mailman/listinfo.cgi/ksoap > > > > _______________________________________________ > Ksoap mailing list > [email protected] > http://www.enhydra.org/mailman/listinfo.cgi/ksoap > > _______________________________________________ > Ksoap mailing list > [email protected] > http://www.enhydra.org/mailman/listinfo.cgi/ksoap > _______________________________________________ Ksoap mailing list [email protected] http://www.enhydra.org/mailman/listinfo.cgi/ksoap