[
http://issues.apache.org/jira/browse/AXIS2-747?page=comments#action_12422260 ]
Vinh Tran commented on AXIS2-747:
---------------------------------
Here is some more information to help resolve this issue....
I ran into the same problem with the missing namespace on instance types.
Here is the client code that invokes the service:
SFPServiceWSStub service = new
SFPServiceWSStub(plugin.getUrl());
PluginEventSynchDocument synchDoc =
PluginEventSynchDocument.Factory.newInstance();
TranslationCompleteEventType eventType =
TranslationCompleteEventType.Factory.newInstance();
eventType.setCallSide(event.getCallSide().getValue().intValue());
eventType.setPluginId(event.getPluginId());
eventType.setSarId(event.getSarId());
synchDoc.setPluginEventSynch(eventType);
directiveDoc = service.handleEvent(synchDoc);
Here is the soap message on the wire:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header />
<soapenv:Body>
<PluginEventSynch xmlns="http://www.bluenotenetworks.com/schema/types"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ns0="http://www.w3.org/2001/XMLSchema-instance"
ns0:type="typ:TranslationCompleteEventType">
<sarId>0</sarId>
<pluginId>0</pluginId>
<callSide>1</callSide>
</PluginEventSynch>
</soapenv:Body>
</soapenv:Envelope>
You can see there is no xmlns:typ namespace declaration for the typ prefix.
Oddly enough everything works when stepping through the debugger. This works
only when stepping through the operation within the generated stub where the
SOAPEnvelope is being created. Below is a slimmed down version of our wsdl.
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="SFPService"
targetNamespace="http://www.bnn.com/SFPService"
xmlns:tns="http://www.bnn.com/SFPService"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://www.bnn.com/schema/types">
<wsdl:types>
<xsd:schema
targetNamespace="http://www.bnn.com/schema/types"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:impl="http://www.bnn.com/schema/types"
elementFormDefault="qualified">
<xsd:element name="AllowSessionDirective"
type="impl:AllowSessionDirectiveType"/>
<xsd:complexType name="AllowSessionDirectiveType">
<xsd:complexContent>
<xsd:extension base="impl:TerminatingDirectiveType">
<xsd:sequence>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="PluginDirective" type="impl:PluginDirectiveType"/>
<xsd:complexType name="PluginDirectiveType">
<xsd:sequence>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="IncomingCallEvent" type="impl:IncomingCallEventType"/>
<xsd:complexType name="IncomingCallEventType">
<xsd:complexContent>
<xsd:extension base="impl:PluginEventType">
<xsd:sequence>
<xsd:element name="toDisplayName" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="toUserName" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="toHost" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="fromDisplayName" type="xsd:string"
minOccurs="1" maxOccurs="1"/>
<xsd:element name="fromUserName" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="fromHost" type="xsd:string" minOccurs="1"
maxOccurs="1"/>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="TerminatingDirective"
type="impl:TerminatingDirectiveType"/>
<xsd:complexType name="TerminatingDirectiveType">
<xsd:complexContent>
<xsd:extension base="impl:PluginDirectiveType">
<xsd:sequence>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
<xsd:element name="PluginEvent" type="impl:PluginEventType"/>
<xsd:complexType name="PluginEventType">
<xsd:sequence>
<xsd:element name="sarId" type="xsd:long" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="pluginId" type="xsd:long" minOccurs="1"
maxOccurs="1"/>
<xsd:element name="callSide" type="impl:ServiceProcessingSideType"
minOccurs="1" maxOccurs="1"/>
</xsd:sequence>
</xsd:complexType>
<xsd:element name="ServiceProcessingSide"
type="impl:ServiceProcessingSideType"/>
<xsd:simpleType name="ServiceProcessingSideType">
<xsd:annotation>
<xsd:documentation>
<enumeration>
<enum>a=0</enum>
<enum>b=1</enum>
<enum>both=2</enum>
<enum>neither=3</enum>
</enumeration>
</xsd:documentation>
</xsd:annotation>
<xsd:restriction base="xsd:int">
<xsd:enumeration value="0"/>
<xsd:enumeration value="1"/>
<xsd:enumeration value="2"/>
<xsd:enumeration value="3"/>
</xsd:restriction>
</xsd:simpleType>
<xsd:element name="PluginEventSynch" type="impl:PluginEventType"/>
<xsd:element name="PluginEventOneWay" type="impl:PluginEventType"/>
<xsd:element name="ArrayOfPluginDirective"
type="impl:ArrayOfPluginDirectiveType"/>
<xsd:complexType name="ArrayOfPluginDirectiveType">
<xsd:sequence>
<xsd:element name="directives" type="impl:PluginDirectiveType"
minOccurs="0" maxOccurs="unbounded" nillable="true"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</wsdl:types>
<wsdl:message name="Event">
<wsdl:part element="impl:PluginEventSynch"
name="event" />
</wsdl:message>
<wsdl:message name="EventNotification">
<wsdl:part element="impl:PluginEventOneWay"
name="event" />
</wsdl:message>
<wsdl:message name="EventResponse">
<wsdl:part element="impl:ArrayOfPluginDirective"
name="directives" />
</wsdl:message>
<wsdl:portType name="SFPService">
<wsdl:operation name="handleEvent">
<wsdl:input message="tns:Event" />
<wsdl:output message="tns:EventResponse" />
</wsdl:operation>
<wsdl:operation name="handleEventNotification">
<wsdl:input message="tns:EventNotification" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="SFPServiceSOAP"
type="tns:SFPService">
<soap:binding style="document"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="handleEvent">
<soap:operation
soapAction="http://www.bnn.com/SFPService/SFPServiceSOAP/handleEvent" />
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="handleEventNotification">
<soap:operation
soapAction="http://www.bnn.com/SFPService/SFPServiceSOAP/handleEventNotification"
/>
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="SFPServiceWS">
<wsdl:port binding="tns:SFPServiceSOAP"
name="SFPServiceSOAP">
<soap:address location="http://localhost:8080/ws-sfp/SFPServiceWS" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
> 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: Critical
>
> 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]