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 ax...@ws.apache.org on 2004/10/11 18:36:51 UTC

[jira] Updated: (AXIS-1453) WSDL2Java generates incorrect class for SOAPHeader

The following issue has been updated:

    Updater: Simon Fell (mailto:sfell@salesforce.com)
       Date: Mon, 11 Oct 2004 9:36 AM
    Changes:
             Attachment changed to invalidXml.java
    ---------------------------------------------------------------------
For a full history of the issue, see:

  http://issues.apache.org/jira/browse/AXIS-1453?page=history

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXIS-1453

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXIS-1453
    Summary: WSDL2Java generates incorrect class for SOAPHeader
       Type: Bug

     Status: Unassigned
   Priority: Minor

    Project: Axis
 Components: 
             WSDL processing
   Versions:
             beta-2

   Assignee: 
   Reporter: Simon Fell

    Created: Wed, 14 Jul 2004 4:51 PM
    Updated: Mon, 11 Oct 2004 9:36 AM
Environment: XP, JDK 1.4.2_03

Description:
using WSDL2Java with the -a switch, a class is now generated for my SOAP header. In it, it contains

static {
typeDesc.setXmlType(new javax.xml.namespace.QName("urn:enterprise.soap.sforce.com", ">SessionHeader"));
org.apache.axis.description.ElementDesc elemField = new org.apache.axis.description.ElementDesc();
elemField.setFieldName("sessionId");
elemField.setXmlName(new javax.xml.namespace.QName("urn:enterprise.soap.sforce.com", "sessionId"));
elemField.setXmlType(new javax.xml.namespace.QName("http://www.w3.org/2001/XMLSchema", "string"));
typeDesc.addFieldDesc(elemField);
}

the first line that has ">SessionHeader" in it seems very suspect. 

If you use this on the client with a SOAPHeaderELement, e.g.

_SessionHeader hdr = new _SessionHeader();
hdr.setSessionId(lr.getSessionId());
SOAPHeaderElement sh = new SOAPHeaderElement(_SessionHeader.getTypeDesc().getXmlType(), hdr);
stub.setHeader(sh);

then it'll generate invalid XML (see the <ns1:>SessionHeader)

<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:Header><ns1:>SessionHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="urn:enterprise.soap.sforce.com"><ns1:sessionId>mySessionId</ns1:sessionId></ns1:>SessionHeader></soapenv:Header><soapenv:Body><query xmlns="urn:enterprise.soap.sforce.com"><queryString>Select Id from Account where firstName like 'A%'</queryString></query></soapenv:Body></soapenv:Envelope>



---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira