Issue Details (XML | Word | Printable)

Key: AXIS2-694
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Critical Critical
Assignee: Ajith Harshana Ranabahu
Reporter: Simon Fell
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Axis 2.0 (Axis2)

Soap:Body is serialized inside of a soap:Header element

Created: 09/May/06 11:05 AM   Updated: 13/May/06 01:07 AM
Return to search
Component/s: None
Affects Version/s: 1.0
Fix Version/s: None

Time Tracking:
Not Specified

File Attachments:
  Size
XML File partner.wsdl 2006-05-09 11:06 AM Simon Fell 85 kB
Environment: WinXP, JDK 1.5.06

Resolution Date: 13/May/06 01:07 AM


 Description  « Hide
WSDL2Java -s -u -uri partner.wsdl

compiled the generated code, called the query method which takes a session Header, like this
SforceServiceStub stub = new SforceServiceStub();
Login l = new Login();
l.setUsername(args[0]);
l.setPassword(args[1]);
LoginResult lr = stub.login(l, null).getResult();

System.out.println(lr.getServerUrl());
System.out.println(lr.getSessionId());

SessionHeader sh = new SessionHeader();
sh.setSessionId(lr.getSessionId());
stub = new SforceServiceStub(lr.getServerUrl().replace("https:", "http:"));

Query q = new Query();
q.setQueryString("select id, name, accountNumber from Account");
QueryResult qr = stub.query(q, sh, null, null).getResult();
System.out.println("Query return a total " + qr.getSize() + " rows");

OMElement o = qr.getRecords()[0];
Iterator i = o.getChildElements();
while(i.hasNext()) {
OMElement c = (OMElement)i.next();
System.out.println(c.getLocalName() + " : " + c.getText());
}

The call to query fails because the generated SOAP message has soap:Body inside of the soap:Header element

POST /services/Soap/u/7.0 HTTP/1.1
User-Agent: Axis/2.0
SOAPAction: ""
Host: na1-api.salesforce.com
Transfer-Encoding: chunked
Content-Type: text/xml; charset=UTF-8

150
<?xml version='1.0' encoding='UTF-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header><soapenv:Body><ns1:query xmlns:ns1="urn:partner.soap.sforce.com"><ns1:queryString>select id, name, accountNumber from Account</ns1:queryString></ns1:query></soapenv:Body></soapenv:Header></soapenv:Envelope>
0


 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.