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 "Davanum Srinivas (JIRA)" <ax...@ws.apache.org> on 2007/09/28 14:54:12 UTC

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

     [ https://issues.apache.org/jira/browse/AXIS-1453?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Davanum Srinivas updated AXIS-1453:
-----------------------------------

    Assignee:     (was: Davanum Srinivas)

> WSDL2Java generates incorrect class for SOAPHeader
> --------------------------------------------------
>
>                 Key: AXIS-1453
>                 URL: https://issues.apache.org/jira/browse/AXIS-1453
>             Project: Axis
>          Issue Type: Bug
>          Components: WSDL processing
>    Affects Versions: beta-2
>         Environment: XP, JDK 1.4.2_03
>            Reporter: Simon Fell
>            Priority: Minor
>         Attachments: enterprise.wsdl, invalid_req.txt, invalidXml.java
>
>
> 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>

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: axis-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-dev-help@ws.apache.org