You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by Simon Fell <so...@zaks.demon.co.uk> on 2006/04/07 00:35:59 UTC

[axis2] XMLBeans

using the apr 6 snapshot, i generated a client stub using xmlbeans, by
running
wsdl2java -s -d xmlbeans -uri enterprise.wsdl

I have some client code that uses the stub

SoapStub s = new
SoapStub("http://www.salesforce.com/services/Soap/c/7.0");
		
Login l = Login.Factory.newInstance();
l.setUsername("user@org");
l.setPassword("pwd");
LoginDocument ld = LoginDocument.Factory.newInstance();
ld.setLogin(l);
LoginResult lr = s.login(ld).getLoginResponse().getResult();


This works fine, however i notice that if i call ld.setLogin(l)
earlier, it doesn't work, perhaps this is just that i don't understand
XMLBeans, does setLogin take a clone ? for example if i re-arange the
code to 

LoginDocument ld = LoginDocument.Factory.newInstance();
Login l = Login.Factory.newInstance();
ld.setLogin(l);
l.setUsername("user@org");
l.setPassword("pwd");
LoginResult lr = s.login(ld).getLoginResponse().getResult();

it fails, because the generated message doesn't include anything from
the Login class.

<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<login xmlns="urn:enterprise.soap.sforce.com" />
</soapenv:Body>
</soapenv:Envelope>

Is this just the way xmlbeans works (which would be weird), or is it a
bug ?

Thanks
Simon