axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "robert lazarski (JIRA)" <j...@apache.org>
Subject [jira] Commented: (AXIS2-649) Databinding with XMLBeans shows values in soap message but getters return null
Date Sun, 07 May 2006 11:35:22 GMT
    [ http://issues.apache.org/jira/browse/AXIS2-649?page=comments#action_12378290 ] 

robert lazarski commented on AXIS2-649:
---------------------------------------

Using the latest svn and my wsdl2java options as shown above, I've narrowed down the problem
to be on the client side parsing the response. 

Request:

 <?xml version='1.0' encoding='utf-8'?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Header
/><soapenv:Body><simpleLogin xmlns="http://simpleNS/types"><user_name>userName</user_name><user_password>password</user_password></simpleLogin></soapenv:Body></soapenv:Envelope>

Response:

<?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 the web_user_name in the Skeleton, but its not showing up. 

Problem area shown in stack trace:

  [java] Caused by: java.lang.NullPointerException
     [java]     at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3041)
     [java]     at org.apache.xmlbeans.impl.store.Cur$CurLoadContext.attr(Cur.java:3058)
     [java]     at org.apache.xmlbeans.impl.store.Locale.doNamespaces(Locale.java:900)
     [java]     at org.apache.xmlbeans.impl.store.Locale.loadXMLStreamReader(Locale.java:1135)
     [java]     at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:843)
     [java]     at org.apache.xmlbeans.impl.store.Locale.parseToXmlObject(Locale.java:826)
     [java]     at org.apache.xmlbeans.impl.schema.SchemaTypeLoaderBase.parse(SchemaTypeLoaderBase.java:231)
     [java]     at simplens.types.SimpleLoginDocument$Factory.parse(SimpleLoginDocument.java:153)
     [java]     at org.simple.endpoint.SimpleServiceMessageReceiverInOut.fromOM(SimpleServiceMessageReceiverInOut.java:137)
     [java]     ... 21 more


19     public static final org.apache.xmlbeans.SchemaType type = (org.apache.xmlbeans.SchemaType)
20         org.apache.xmlbeans.XmlBeans.typeSystemForClassLoader(SimpleLoginDocument.class.getClassLoader(),
"schemaorg_apache_xmlbeans.system.sB614FAD925D0827B443B334541460B91").resolveHand        le("simplelogin15f1doctype");
152         public static simplens.types.SimpleLoginDocument parse(javax.xml.stream.XMLStreamReader
sr, org.apache.xmlbeans.XmlOptions options) throws org.apache.xmlbeans.XmlException {
153           return (simplens.types.SimpleLoginDocument) org.apache.xmlbeans.XmlBeans.getContextTypeLoader().parse(
sr, type, options ); }

Line Cur.java:3041 - from the xmlbeans 2.1 source, where its throwing NPE:  

 text(value, 0, value.length());

Ajith, I've been doing databinding exactly the same way since .92 . Does this info shed any
light? 



> Databinding with XMLBeans shows values in soap message but getters return null
> ------------------------------------------------------------------------------
>
>          Key: AXIS2-649
>          URL: http://issues.apache.org/jira/browse/AXIS2-649
>      Project: Apache Axis 2.0 (Axis2)
>         Type: Bug

>     Versions: 1.0
>  Environment: Java 5, linux
>     Reporter: robert lazarski
>     Assignee: Ajith Harshana Ranabahu
>  Attachments: SimpleEndpointSkeleton.java, SimpleServiceSkeleton.java, Tester.java, simple.wsdl
>
> This issue may be related to AXIS2-644, but my example is not using inheritance,  
> 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 may be 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. This is the .95 version:

>   private static final javax.xml.namespace.QName SIMPLELOGINRESPONSE$0 =
>         new javax.xml.namespace.QName("http://simpleNS/types", "simpleLoginResponse");
> The missing namespace appears to be causing this. 
> Also attached are my Skeleton, Client, and wsdl2java ant task. 

-- 
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


Mime
View raw message