[prev in list] [next in list] [prev in thread] [next in thread] 

List:       axis-user
Subject:    [axis2] Strange xmlbeans problem
From:       "robert lazarski" <robertlazarski () gmail ! com>
Date:       2006-04-30 16:22:09
Message-ID: f87675ee0604300922v4ad8701avcebb2c4ef067b381 () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi all,

I'm using RC4 for this example. I'm written a very simple example to explain
my problem. Can somebody please give a quick look - it must be something
simple but I'm having a hard time tracking it down.

The wsdl is attached and validates fine.

The response envelope is:

<?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
/><soapenv:Body><simpleLoginResponse
xmlns="http://simpleNS/types"><soap_session_id>my
random string</soap_session_id><web_user_name xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance" xsi:nil="true"
/></simpleLoginResponse></soapenv:Body></soapenv:Envelope>

I'm setting 'web_user_name' in the service, but it's not showing up.

On the client side, simpleLoginResponseDocument.toString() gives me:

<simpleLoginResponse xmlns="http://simpleNS/types">
  <soap_session_id>my random string</soap_session_id>
  <web_user_name xsi:nil="true" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"/>
</simpleLoginResponse>

I'm getting the 'soap_user_session'  in the soap message,  but  I'm getting
null when trying to  call  simpleLoginResponse.getSoapSessionId() . The
reason is here in  simplens/types/impl/SimpleLoginResponseDocumentImpl.java
-
I've put in a few println() :

  public static class SimpleLoginResponseImpl extends
org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements
simplens.types.SimpleLoginResponseDocument.SimpleLoginResponse
    {

        public SimpleLoginResponseImpl(org.apache.xmlbeans.SchemaType sType)
        {
            super(sType);
        }

        private static final javax.xml.namespace.QName SOAPSESSIONID$0 =
            new javax.xml.namespace.QName("", "soap_session_id");
        private static final javax.xml.namespace.QName WEBUSERNAME$2 =
            new javax.xml.namespace.QName("", "web_user_name");


        /**
         * Gets the "soap_session_id" element
         */
        public java.lang.String getSoapSessionId()
        {
            synchronized (monitor())
            {
                check_orphaned();
                org.apache.xmlbeans.SimpleValue target = null;
                target =
(org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SOAPSESSIONID$0,
0);
                if (target == null)
                {
                    System.out.println("target is null");
                    return null;
                }
                System.out.println("target is ok? " + target);
                return target.getStringValue();
            }
        }

The target is null, but the value is showing in the soap message.

Any ideas?
Robert

[Attachment #5 (text/html)]

Hi all, <br>
<br>
I'm using RC4 for this example. I'm written a very simple example to
explain my problem. Can somebody please give a quick look - it must be
something simple but I'm having a hard time tracking it down. <br>
<br>
The wsdl is attached and validates fine. <br>
<br>
The response envelope is: <br>
<br>
&lt;?xml version='1.0' encoding='utf-8'?&gt;&lt;soapenv:Envelope
xmlns:soapenv=&quot;<a \
href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>&quot;&gt;&lt;soapenv:Header
 /&gt;&lt;soapenv:Body&gt;&lt;simpleLoginResponse
xmlns=&quot;<a href="http://simpleNS/types">http://simpleNS/types</a>&quot;&gt;&lt;soap_session_id&gt;my \
random string&lt;/soap_session_id&gt;&lt;web_user_name
xmlns:xsi=&quot;<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot; \
xsi:nil=&quot;true&quot; \
/&gt;&lt;/simpleLoginResponse&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;<br> \
<br> I'm setting 'web_user_name' in the service, but it's not showing up. <br>
<br>
On the client side, simpleLoginResponseDocument.toString() gives me: <br>
<br>
&lt;simpleLoginResponse xmlns=&quot;<a \
href="http://simpleNS/types">http://simpleNS/types</a>&quot;&gt;<br> &nbsp; \
&lt;soap_session_id&gt;my random string&lt;/soap_session_id&gt;<br> &nbsp; \
&lt;web_user_name xsi:nil=&quot;true&quot; xmlns:xsi=&quot;<a \
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;/&gt;<br>
 &lt;/simpleLoginResponse&gt;<br>
<br>
I'm getting the 'soap_user_session'&nbsp; in the soap message,&nbsp;
but&nbsp; I'm getting null when trying to&nbsp; call&nbsp;
simpleLoginResponse.getSoapSessionId() . The reason is here in&nbsp;
simplens/types/impl/SimpleLoginResponseDocumentImpl.java - <br>
I've put in a few println() : <br>
<br>
&nbsp; public static class SimpleLoginResponseImpl extends
org.apache.xmlbeans.impl.values.XmlComplexContentImpl implements
simplens.types.SimpleLoginResponseDocument.SimpleLoginResponse<br>
&nbsp;&nbsp;&nbsp; {<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public \
SimpleLoginResponseImpl(org.apache.xmlbeans.SchemaType sType)<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; super(sType);<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private static final \
javax.xml.namespace.QName SOAPSESSIONID$0 =<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new \
javax.xml.namespace.QName(&quot;&quot;, &quot;soap_session_id&quot;);<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; private static final \
javax.xml.namespace.QName WEBUSERNAME$2 =<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; new \
javax.xml.namespace.QName(&quot;&quot;, &quot;web_user_name&quot;);<br> <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /**<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; * Gets the \
&quot;soap_session_id&quot; element<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; */<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public java.lang.String \
getSoapSessionId()<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synchronized \
(monitor())<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
check_orphaned();<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 org.apache.xmlbeans.SimpleValue target = null;<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 target =
(org.apache.xmlbeans.SimpleValue)get_store().find_element_user(SOAPSESSIONID$0,
0);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
if (target == null)<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
{<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 System.out.println(&quot;target is null&quot;);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
return null;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
}<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 System.out.println(&quot;target is ok? &quot; + target);<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
return target.getStringValue();<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }<br> <br>
The target is null, but the value is showing in the soap message. <br>
<br>
Any ideas? <br>
Robert<br>
<br>
<br>
<br>


["simple.wsdl" (text/xml)]

<?xml version="1.0" encoding="UTF-8"?>

<definitions name="SimpleService" targetNamespace="http://simpleNS" \
xmlns:tns="http://simpleNS" xmlns="http://schemas.xmlsoap.org/wsdl/" \
xmlns:xsd="http://www.w3.org/2001/XMLSchema" \
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:ns2="http://simpleNS/types"> \
<types>  <schema targetNamespace="http://simpleNS/types" \
xmlns:tns="http://simpleNS/types" \
xmlns:soap11-enc="http://schemas.xmlsoap.org/soap/encoding/" \
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" \
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" \
xmlns="http://www.w3.org/2001/XMLSchema">  <import \
namespace="http://schemas.xmlsoap.org/soap/encoding/"/>  <element name="simpleLogin">
        <complexType>
          <sequence>
            <element name="user_name" type="xsd:string"/>
            <element name="user_password" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
      <element name="simpleLoginResponse">
        <complexType>
          <sequence>
            <element name="soap_session_id" type="xsd:string"/>
            <element name="web_user_name" type="xsd:string"/>
          </sequence>
        </complexType>
      </element>
</schema></types>
  <message name="SimpleEndpoint_simpleLogin">
     <part name="parameters" element="ns2:simpleLogin"/>
  </message>
  <message name="SimpleEndpoint_simpleLoginResponse">
    <part name="result" element="ns2:simpleLoginResponse"/>
  </message>
  <portType name="SimpleEndpoint">
    <operation name="simpleLogin">
      <input message="tns:SimpleEndpoint_simpleLogin" \
                name="SimpleEndpoint_simpleLogin"/>
      <output message="tns:SimpleEndpoint_simpleLoginResponse" \
name="SimpleEndpoint_simpleLoginResponse"/>  </operation>
  </portType>
  <binding name="SimpleEndpointBinding" type="tns:SimpleEndpoint">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
    <operation name="simpleLogin">
      <soap:operation soapAction="simpleLogin"/>
      <input name="SimpleEndpoint_simpleLogin">
        <soap:body use="literal"/>
      </input>
      <output name="SimpleEndpoint_simpleLoginResponse">
        <soap:body use="literal"/>
      </output>
    </operation>
  </binding>
  <service name="SimpleService">
    <port name="SimpleEndpointPort" binding="tns:SimpleEndpointBinding">
      <soap:address location="http://localhost:8080/axis2/services/SimpleService"/></port></service></definitions>




[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic