[ 
http://issues.apache.org/jira/browse/AXIS2-747?page=comments#action_12438112 ] 
            
Davanum Srinivas commented on AXIS2-747:
----------------------------------------

I used the wsdl from vinh here:
http://issues.apache.org/jira/browse/AXIS2-747#action_12422260

With the following client:

import com.bnn.www.schema.types.PluginEventSynchDocument;
import com.bnn.www.schema.types.ArrayOfPluginDirectiveDocument;
import com.bnn.www.schema.types.IncomingCallEventType;
import com.bnn.www.sfpservice.SFPServiceWSStub;

public class Main {
    public static void main(String[] args) throws Exception {
        SFPServiceWSStub service = new SFPServiceWSStub();
         PluginEventSynchDocument synchDoc = 
PluginEventSynchDocument.Factory.newInstance();

         IncomingCallEventType eventType = 
IncomingCallEventType.Factory.newInstance();
         eventType.setCallSide(2);
         eventType.setPluginId(234);
         eventType.setSarId(456);

         synchDoc.setPluginEventSynch(eventType);
         ArrayOfPluginDirectiveDocument directiveDoc = 
service.handleEvent(synchDoc);
    }
}

and got this soap request:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
        <soapenv:Header/>
        <soapenv:Body>
                <PluginEventSynch xmlns:typ="http://www.bnn.com/schema/types"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns="http://www.bnn.com/schema/types"; xsi:type="typ:IncomingCallEventType">
                        <sarId>456</sarId>
                        <pluginId>234</pluginId>
                        <callSide>2</callSide>
                </PluginEventSynch>
        </soapenv:Body>
</soapenv:Envelope>

I can see the xmlns:typ declaration correctly. So looks like the updates to the 
latest xmlbeans, woodstax parser and changes to Axis2 itself is holding up and 
got rid of this problem. 

thanks,
dims


>  Missing namespace on subelement
> --------------------------------
>
>                 Key: AXIS2-747
>                 URL: http://issues.apache.org/jira/browse/AXIS2-747
>             Project: Apache Axis 2.0 (Axis2)
>          Issue Type: Bug
>          Components: om
>    Affects Versions: 1.0
>         Environment: Windows 2K3, JDK 1.5, AXIS2 1.0 and Eclipse 3.1 with 
> tomcat plugin
>            Reporter: Qi An
>         Assigned To: Ajith Harshana Ranabahu
>            Priority: Blocker
>
> The below all worked fine on 0.95:
> The complex type in question is defined in the wsdl as:
> <s:complexType name="Credential">
>   <s:sequence/>
>   </s:complexType>
>  <s:complexType name="EnterpriseCredential"> <s:complexContent>
>   <s:extension base="s0:Credential">
>      <s:sequence/>
>      <s:attribute name="Login" type="s:string" use="required"/>
>      <s:attribute name="Password" type="s:string" use="optional"/>
>      <s:attribute name="Locale" type="s:string" use="optional"/>
>      <s:attribute name="TimeZone" type="s:string" use="optional"/>
>      <s:attribute name="Domain" type="s:string" use="optional"/>
>      <s:attribute name="AuthType" type="s:string" use="optional"/>
>   </s:extension>
>  </s:complexContent>
> </s:complexType>
> In the provider's skeleton, we have the following:
>     public com.businessobjects.dsws.session.LoginResponseDocument login(
>         com.businessobjects.dsws.session.LoginDocument param12)
>         throws  
> com.businessobjects.dsws.session.SessionSkeleton.DSWSExceptionException, 
> RemoteException {
>       Login obj = param12.getLogin();
>       Credential cred = obj.getCredential();
> The problem is, on the getCredential() call, we actually get back an 
> object of type Credential (base class) when the method was invoked with 
> an enterprise credential.  So that further on, on the line:
> EnterpriseCredential enterpriseCredential = (EnterpriseCredential) cred;
> We get a class cast exception.
> Tracing through a bit with the SOAPMonitor, we noticed that the xml 
> envelope actually ends up looking like:
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope
> xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
> <soapenv:Header />
> <soapenv:Body>
> <login xmlns="session.dsws.businessobjects.com">
> <credential xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> Password="" Domain="vanyma01" xsi:type="ses:EnterpriseCredential"
> Login="administrator" />
> </login>
> </soapenv:Body>
> </soapenv:Envelope>
> Where the namespace definition of "ses" is clearly missing.  If you 
> trace through the deserialization code a bit, this is why the object 
> comes back as the base class instead of the extended type.
> Once thing interesting one of our developer's noticed, is that if, on 
> the consumer side, you add the lines:
>             XmlOptions op1 = new XmlOptions();
>             op1.setSaveNamespacesFirst();
>             m_credential =
> EnterpriseCredential.Factory.newInstance(op1);
> At the time you create the credential, it seems that *some of the time* 
> this fixes the problem, so that the xml appears as:
> <?xml version='1.0' encoding='utf-8'?>
> <soapenv:Envelope
>  xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/";>
> <soapenv:Header />
> <soapenv:Body>
>  <login xmlns="session.dsws.businessobjects.com">
>  <credential xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>  xmlns:ses="session.dsws.businessobjects.com" Password=""
>  Domain="vanyma01" xsi:type="ses:EnterpriseCredential"
>   Login="administrator" />
>  </login>
>  </soapenv:Body>
> </soapenv:Envelope>
> But only some of the time.

-- 
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
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to