Re: Axis2/Java Nightly builds

2009-01-05 Thread Nateshan Soundarapandian
Amila,

Any updates on this one ? Please advice.

I used Axis2 1.4.1 release.

Many Thanks,
Nateshan


On Wed, Dec 31, 2008 at 8:51 AM, Nateshan Soundarapandian 
nates...@gmail.com wrote:

 Dear Amila,

 Thanks for the response.

 I tried what you mentioned. I till get the same exception. Here are the
 artifacts:

 1. Test Class:
 package com.ihg.ws.cxf.servlets;

 import java.io.ByteArrayInputStream;

 import javax.xml.stream.XMLStreamReader;

 import org.apache.axiom.om.util.StAXUtils;
 import org.opentravel.www.ota._2003._05.ContactNumbers_type0;

 public class ContactNumbersTest {

 public static void main(String[] args) {
 String newString = ContactNumbers xmlns=\
 http://www.opentravel.org/OTA/2003/05\http://www.opentravel.org/OTA/2003/05%5C
 \n
 + ContactNumber PhoneNumber=\1-305-4469000\
 PhoneTechType=\1\ PhoneUseType=\5\/\n
 + ContactNumber PhoneNumber=\1-305-4471189\
 PhoneTechType=\3\ PhoneUseType=\5\/\n
 + /ContactNumbers;
 try {
 XMLStreamReader xmlReader = StAXUtils
 .createXMLStreamReader(new
 ByteArrayInputStream(newString
 .getBytes()));
 ContactNumbers_type0 result = ContactNumbers_type0.Factory
 .parse(xmlReader);
 } catch (Exception e) {
 e.printStackTrace();
 }
 }
 }


 EXCEPTION:
 java.lang.Exception: org.apache.axis2.databinding.ADBException: Unexpected
 subelement ContactNumber
 at
 org.opentravel.www.ota._2003._05.ContactNumbers_type0$Factory.parse(ContactNumbers_type0.java:582)
 at
 com.ihg.ws.cxf.servlets.ContactNumbersTest.main(ContactNumbersTest.java:22)
 Caused by: org.apache.axis2.databinding.ADBException: Unexpected subelement
 ContactNumber
 at
 org.opentravel.www.ota._2003._05.ContactNumbers_type0$Factory.parse(ContactNumbers_type0.java:578)
 ... 1 more


 Generated Factory.parse method in Class ContactNumbers_type0 (Please note
 the section marked between  and , At this point Both
 reader.isEndElement() and reader.isStartElement() are true):

 --
 public static ContactNumbers_type0 parse(
 javax.xml.stream.XMLStreamReader reader)
 throws java.lang.Exception {
 ContactNumbers_type0 object = new ContactNumbers_type0();

 int event;
 java.lang.String nillableValue = null;
 java.lang.String prefix = ;
 java.lang.String namespaceuri = ;
 try {

 while (!reader.isStartElement()  !reader.isEndElement())
 reader.next();

 if (reader.getAttributeValue(
 http://www.w3.org/2001/XMLSchema-instance;,
 type) != null) {
 java.lang.String fullTypeName = reader
 .getAttributeValue(
 
 http://www.w3.org/2001/XMLSchema-instance;,
 type);
 if (fullTypeName != null) {
 java.lang.String nsPrefix = null;
 if (fullTypeName.indexOf(:)  -1) {
 nsPrefix = fullTypeName.substring(0,
 fullTypeName
 .indexOf(:));
 }
 nsPrefix = nsPrefix == null ?  : nsPrefix;

 java.lang.String type = fullTypeName
 .substring(fullTypeName.indexOf(:) + 1);

 if (!ContactNumbers_type0.equals(type)) {
 // find namespace for the prefix
 java.lang.String nsUri = reader
 .getNamespaceContext().getNamespaceURI(
 nsPrefix);
 return (ContactNumbers_type0)
 org.opentravel.www.ota._2003._05.ExtensionMapper
 .getTypeObject(nsUri, type, reader);
 }

 }

 }

 // Note all attributes that were handled. Used to differ
 normal
 // attributes
 // from anyAttributes.
 java.util.Vector handledAttributes = new
 java.util.Vector();

 reader.next();

 java.util.ArrayList list1 = new java.util.ArrayList();

 while (!reader.isStartElement()  !reader.isEndElement())
 reader.next();

 if (reader.isStartElement()
  new javax.xml.namespace.QName(
 http://www.opentravel.org/OTA/2003/05;,
 ContactNumber).equals(reader.getName()))
 {

 // Process the array and step past its final 

Re: SERVICE_ONJECT_SUPPLIER not specified

2009-01-05 Thread rabelenda


iksrazal wrote:
 
 On Fri, Jan 2, 2009 at 5:26 PM, rabelenda rabele...@gmail.com wrote:
 [CODE]org.apache.axis2.AxisFault: The SERVICE_OBJECT_SUPPLIER parameter
 is
 not specified.

 You most likely have a bean name / service class mismatch. I'd look
 for typos. Here's the problem code from
 modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java

 I have search for any mistake and I didn't find anything. I tested
 chenging
 the SpringBeanName parameter in the services.xml file to an invalid one
 and
 the application gives me the same error. But if a put it in the correct
 way,
 it still gives me the error. I think that the problem isn't a mapping
 between bean and service because if a put an invalid class name on the
 bean
 the server (tomcat) gives me an error when deploying saying that the
 class
 doesn't exists. I don't kow if is this what you were thinking that could
 be
 wrong, thanks for the fast reply :-).

 
 Perhaps its actually not finding the ServiceObjectSupplier . Make sure
 the name is correct there. Put axis2 / spring in debug and make sure
 that spring is loading correctly. You'll see warnings in the logs if
 axis2 can't find a bean name, ie, spring isn't getting loaded, before
 the exception.
 
 HTH,
 Robert
 
 

I have changed serviceObjectSupplier with ServiceObjectSupplier in the
services.xml file and I get a different error. When loading tomcat I get 
[INFO] org.apache.axis2.deployment.DeploymentException: The following error
occu
 rred during schema generation: null. I have tested setting all logging
 properties of tomcat to ALL and I don't get any more explanation, any
 ideas? In the services.xml file, I must put serviceObjectSupplier or
 ServiceObjectSupplier ?

-- 
View this message in context: 
http://www.nabble.com/SERVICE_ONJECT_SUPPLIER-not-specified-tp21255767p21292204.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: SERVICE_ONJECT_SUPPLIER not specified

2009-01-05 Thread rabelenda

Ready, I didn't kow that that was an expected behaivour. Now I run the client
and all works, thanks to all. Solution: change serviceObjectSupplier to
ServiceObjectSupplier. The null message was beacause I had forgotten that I
had deleted the service folder in the webapplication :-). Thanks to all ;-).

-- 
View this message in context: 
http://www.nabble.com/SERVICE_ONJECT_SUPPLIER-not-specified-tp21255767p21296527.html
Sent from the Axis - User mailing list archive at Nabble.com.



Axis2/jax-ws unmarshal response

2009-01-05 Thread Pauli Savolainen

Hi,

I use wsimport to generate classes from my wsdl. My webservice has one
method called getVersion. I call this webservice and all works fine except
when the response is unmarshalled into a java object the return value
disappears.


WebService class

@WebService(name = Version, targetNamespace = mynamespace)
@XmlSeeAlso({
ObjectFactory.class
})
@SOAPBinding(parameterStyle = ParameterStyle.BARE)
public interface Event {
 ...
 String getVersion()
}


Client:

VersionService service = new VersionService();
Version version = service.getPort(Version.class);
System.out.println(version.getVersion());
-- null

The response message:

?xml version='1.0' encoding='utf-8'?
soapenv:Envelope xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
soapenv:Body
ns:getVersionResponse xmlns:ns=mynamespace
ns:returnVERSION/ns:return
/ns:getVersionResponse
/soapenv:Body
/soapenv:Envelope

The unmarshalled object has a string field response but it is always null.
If I change the SOAPBinding annotation parameterStyle.BARE to
parameterStyle.WRAPPED I get the correct answer but this I shouldn't do
because the elements in my wsdl are not really wrappers (according to the
jax-ws spec).

If I change the elements to properly wrapped (according to the spec), I
still get the null result when calling the getVersion method of the
webservice.

So no matter what I do I the unmarshalled object's field is always null even
though I clearly see that there is stuff in the response. Why is this? Could
it be that the ns:return element screws something up in the unmarshalling
process.

Thank you

Pauli


-- 
View this message in context: 
http://www.nabble.com/Axis2-jax-ws-unmarshal-response-tp21294027p21294027.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: SERVICE_ONJECT_SUPPLIER not specified

2009-01-05 Thread rabelenda



Amila Suriarachchi wrote:
 
 have a look at here[1]. you need to specify a object supplier at the
 services.xml
 
 thanks,
 Amila.
 
 
 [1] http://ws.apache.org/axis2/1_4_1/spring.html
 
 On Sat, Jan 3, 2009 at 2:11 AM, robert lazarski
 robertlazar...@gmail.comwrote:
 
 On Fri, Jan 2, 2009 at 5:26 PM, rabelenda rabele...@gmail.com wrote:
  [CODE]org.apache.axis2.AxisFault: The SERVICE_OBJECT_SUPPLIER
 parameter
  is
  not specified.
 
  You most likely have a bean name / service class mismatch. I'd look
  for typos. Here's the problem code from
 
 modules/kernel/src/org/apache/axis2/receivers/AbstractMessageReceiver.java
 
  I have search for any mistake and I didn't find anything. I tested
 chenging
  the SpringBeanName parameter in the services.xml file to an invalid one
 and
  the application gives me the same error. But if a put it in the correct
 way,
  it still gives me the error. I think that the problem isn't a mapping
  between bean and service because if a put an invalid class name on the
 bean
  the server (tomcat) gives me an error when deploying saying that the
 class
  doesn't exists. I don't kow if is this what you were thinking that
 could
 be
  wrong, thanks for the fast reply :-).
 

 Perhaps its actually not finding the ServiceObjectSupplier . Make sure
 the name is correct there. Put axis2 / spring in debug and make sure
 that spring is loading correctly. You'll see warnings in the logs if
 axis2 can't find a bean name, ie, spring isn't getting loaded, before
 the exception.

 HTH,
 Robert

 
 I have tested changing serviceObjetSupplier with ServiceObjectSupplier in
 the services.xml file and I get a different error message. When I start
 tomcat I get [INFO] org.apache.axis2.deployment.DeploymentException: The
 following error occu
 rred during schema generation: null but nothing else information about
 this error. In services.xml I have tu put serviceObjetSupplier or
 ServiceObjectSupplier? how can I manage to get more verbose from the
 output of tomcat (I have put all logging properties to FINE)?
 
 -- 
 Amila Suriarachchi
 WSO2 Inc.
 blog: http://amilachinthaka.blogspot.com/
 
 

-- 
View this message in context: 
http://www.nabble.com/SERVICE_ONJECT_SUPPLIER-not-specified-tp21255767p21290205.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Axis2 client request to IIS 5.0 returns a 500 error.

2009-01-05 Thread excess2

Thanks!

I see the problem you pointed out.

However, I have no idea how to fix this.

The stubs I'm using for the client were generated from a
VOIP_SIP_Trouble_Ticket10 wsdl.

The urn:AuthenticationInfo xmlns:urn = urn:VOIP_SIP_Trouble_Ticket10 is
populated by stub code

not by an explicit call.  How do I force it to VOIP_SIP_Trouble_Ticket
instead?

Is there an axis2 method that lets me override the default
VOIP_SIP_Trouble_Ticket10 with VOIP_SIP_Trouble_Ticket?

Thanks,

G



Andreas Veithen-2 wrote:
 
 The difference between the two requests is in the namespace URIs of
 AuthenticationInfo and its children. In the first request all elements
 are in the urn:VOIP_SIP_Trouble_Ticket10 namespace, while in the
 second, AuthenticationInfo is in urn:VOIP_SIP_Trouble_Ticket and its
 children in AuthenticationInfo.
 
 Andreas
 
  
 

-- 
View this message in context: 
http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297434.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Axis2 client request to IIS 5.0 returns a 500 error.

2009-01-05 Thread Andreas Veithen
Can you check which of the two requests conforms to the WSDL?

Andreas

On Mon, Jan 5, 2009 at 20:21, excess2 gafo...@yahoo.com wrote:

 Thanks!

 I see the problem you pointed out.

 However, I have no idea how to fix this.

 The stubs I'm using for the client were generated from a
 VOIP_SIP_Trouble_Ticket10 wsdl.

 The urn:AuthenticationInfo xmlns:urn = urn:VOIP_SIP_Trouble_Ticket10 is
 populated by stub code

 not by an explicit call.  How do I force it to VOIP_SIP_Trouble_Ticket
 instead?

 Is there an axis2 method that lets me override the default
 VOIP_SIP_Trouble_Ticket10 with VOIP_SIP_Trouble_Ticket?

 Thanks,

 G



 Andreas Veithen-2 wrote:

 The difference between the two requests is in the namespace URIs of
 AuthenticationInfo and its children. In the first request all elements
 are in the urn:VOIP_SIP_Trouble_Ticket10 namespace, while in the
 second, AuthenticationInfo is in urn:VOIP_SIP_Trouble_Ticket and its
 children in AuthenticationInfo.

 Andreas




 --
 View this message in context: 
 http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297434.html
 Sent from the Axis - User mailing list archive at Nabble.com.




Re: Axis2 client request to IIS 5.0 returns a 500 error.

2009-01-05 Thread excess2

The non-working request matches the wsdl.

Somehow the working request has apparently been tweaked.

G



Andreas Veithen-2 wrote:
 
 Can you check which of the two requests conforms to the WSDL?
 
 Andreas
 
 On Mon, Jan 5, 2009 at 20:21, excess2 gafo...@yahoo.com wrote:

 Thanks!

 I see the problem you pointed out.

 However, I have no idea how to fix this.

 The stubs I'm using for the client were generated from a
 VOIP_SIP_Trouble_Ticket10 wsdl.

 The urn:AuthenticationInfo xmlns:urn = urn:VOIP_SIP_Trouble_Ticket10
 is
 populated by stub code

 not by an explicit call.  How do I force it to VOIP_SIP_Trouble_Ticket
 instead?

 Is there an axis2 method that lets me override the default
 VOIP_SIP_Trouble_Ticket10 with VOIP_SIP_Trouble_Ticket?

 Thanks,

 G



 Andreas Veithen-2 wrote:

 The difference between the two requests is in the namespace URIs of
 AuthenticationInfo and its children. In the first request all elements
 are in the urn:VOIP_SIP_Trouble_Ticket10 namespace, while in the
 second, AuthenticationInfo is in urn:VOIP_SIP_Trouble_Ticket and its
 children in AuthenticationInfo.

 Andreas




 --
 View this message in context:
 http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297434.html
 Sent from the Axis - User mailing list archive at Nabble.com.


 
 

-- 
View this message in context: 
http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297928.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: SERVICE_ONJECT_SUPPLIER not specified

2009-01-05 Thread robert lazarski
On Mon, Jan 5, 2009 at 11:43 AM, rabelenda rabele...@gmail.com wrote:
 I have changed serviceObjectSupplier with ServiceObjectSupplier in the
 services.xml file and I get a different error. When loading tomcat I get
 [INFO] org.apache.axis2.deployment.DeploymentException: The following error
 occu
 rred during schema generation: null. I have tested setting all logging
 properties of tomcat to ALL and I don't get any more explanation, any
 ideas? In the services.xml file, I must put serviceObjectSupplier or
 ServiceObjectSupplier ?

 --

Please post the entire stacktrace. You probably have some other errors
that are closer to the problem. You need to enable either
commons-logging or log4j in your war file. For example. you should
have a log4j.properties in WEB-INF/classes . The axis2 distro has an
example.

HTH,
Robert


Re: minimum set of libraries in classpath.

2009-01-05 Thread Shah Asrani
Hi Amila,
Thanks for you response.

Shah

On Sat, Jan 3, 2009 at 9:28 PM, Amila Suriarachchi
amilasuriarach...@gmail.com wrote:
 please have a look at here[1].

 thanks,
 Amila.

 [1]http://amilachinthaka.blogspot.com/2008/11/minimal-jars-to-run-apache-axis2.html

 On Sat, Jan 3, 2009 at 12:55 AM, Shah Asrani shahasr...@gmail.com wrote:

 Is there any link that talks about minimum set of libraries for Axis2
 required on classpath.  There are so many libaries and I am including
 all of them in the classpath to build an OperationClient.  I would
 prefer to keep classpath entries to minimum.

 Shah



 --
 Amila Suriarachchi
 WSO2 Inc.
 blog: http://amilachinthaka.blogspot.com/



Re: Axis2 client request to IIS 5.0 returns a 500 error.

2009-01-05 Thread Amila Suriarachchi
On Tue, Jan 6, 2009 at 1:21 AM, excess2 gafo...@yahoo.com wrote:


 The non-working request matches the wsdl.


wsdl2java tool assumes that the wsdl correctly describes the service. one
option is to change the wsdl
file to suite for the service and generate the code with that.

thanks,
Amila.



 Somehow the working request has apparently been tweaked.

 G



 Andreas Veithen-2 wrote:
 
  Can you check which of the two requests conforms to the WSDL?
 
  Andreas
 
  On Mon, Jan 5, 2009 at 20:21, excess2 gafo...@yahoo.com wrote:
 
  Thanks!
 
  I see the problem you pointed out.
 
  However, I have no idea how to fix this.
 
  The stubs I'm using for the client were generated from a
  VOIP_SIP_Trouble_Ticket10 wsdl.
 
  The urn:AuthenticationInfo xmlns:urn = urn:VOIP_SIP_Trouble_Ticket10
  is
  populated by stub code
 
  not by an explicit call.  How do I force it to VOIP_SIP_Trouble_Ticket
  instead?
 
  Is there an axis2 method that lets me override the default
  VOIP_SIP_Trouble_Ticket10 with VOIP_SIP_Trouble_Ticket?
 
  Thanks,
 
  G
 
 
 
  Andreas Veithen-2 wrote:
 
  The difference between the two requests is in the namespace URIs of
  AuthenticationInfo and its children. In the first request all elements
  are in the urn:VOIP_SIP_Trouble_Ticket10 namespace, while in the
  second, AuthenticationInfo is in urn:VOIP_SIP_Trouble_Ticket and its
  children in AuthenticationInfo.
 
  Andreas
 
 
 
 
  --
  View this message in context:
 
 http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297434.html
  Sent from the Axis - User mailing list archive at Nabble.com.
 
 
 
 

 --
 View this message in context:
 http://www.nabble.com/Axis2-client-request-to-IIS-5.0-returns-a-500-error.-tp21236655p21297928.html
 Sent from the Axis - User mailing list archive at Nabble.com.




-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: Axis2 Data Types And Values

2009-01-05 Thread Amila Suriarachchi
On Mon, Jan 5, 2009 at 12:52 PM, ibrahim demir ibrahimdem...@yahoo.comwrote:

 Hi;

 Below is the related part. Even I do not set anything for the Customerid
 ,it is set to 0 somewhere inside Axis2. But 0 is diffrent than empty for my
 query.

 Yours.

  s:complexType name=Customer
 s:complexContent mixed=false
   s:extension base=tns:MakerCheckerEntityBase
 s:sequence
   s:element minOccurs=1 maxOccurs=1 name=Customerid
 type=s:int /


set minOccurs to 0 or set nillable=true. this indicate your element  can not
be empty.

thanks,
Amila.


   s:element minOccurs=0 maxOccurs=1 name=CustomerName
 type=s:string /
   s:element minOccurs=1 maxOccurs=1 name=Status
 nillable=true type=s:short /
   s:element minOccurs=0 maxOccurs=1 name=AutoDescription
 type=s:string /
   s:element minOccurs=0 maxOccurs=1 name=UserDescription
 type=s:string /
   s:element minOccurs=1 maxOccurs=1 name=ReasonToPassive
 nillable=true type=s:short /
   s:element minOccurs=1 maxOccurs=1 name=SecurityFund
 type=s:boolean /
   s:element minOccurs=1 maxOccurs=1 name=TaxRate
 type=s:decimal /
   s:element minOccurs=1 maxOccurs=1
 name=SharedCustomerType nillable=true type=s:int /
   s:element minOccurs=0 maxOccurs=1 name=CustomerRoles
 type=tns:ArrayOfCustomerRoles /
 /s:sequence
   /s:extension
 /s:complexContent
   /s:complexType

 Ibrahim DEMIR
 CyberSoft Yazilim Muh.
 http://www.ibrahimdemir.org





 --
 *From:* Amila Suriarachchi amilasuriarach...@gmail.com
 *To:* axis-user@ws.apache.org
 *Sent:* Monday, January 5, 2009 5:52:18 AM
 *Subject:* Re: Axis2 Data Types And Values



 On Sun, Jan 4, 2009 at 6:31 PM, ibrahim demir ibrahimdem...@yahoo.comwrote:

 Hi All;

 I am using Axis2 and generating my client code using Axis2 Eclipse Codegen
 Wizard for resuming .NET web services. Everthing works fine except one
 thing.

 Some of the fields of the objects gets default values in my request.

 For example I have an Customer object and it has got an Costomer_Code
 field which is an integer type. Even I do not set the customer_code field ,
 it is set as 0 (zero) in my request. Is this something done by Axis2 and
 Is there any way to stop this?


 have you set a default value to customer_code? can you send us that schema
 part?

 thanks,
 Amila.




 Yours

 Ibrahim DEMIR
 CyberSoft Yazilim Muh.
 http://www.ibrahimdemir.org








 --
 Amila Suriarachchi
 WSO2 Inc.
 blog: http://amilachinthaka.blogspot.com/




-- 
Amila Suriarachchi
WSO2 Inc.
blog: http://amilachinthaka.blogspot.com/


Re: Axis2/jax-ws unmarshal response

2009-01-05 Thread Pauli Savolainen

Hello,

Strike the previous code example out. Here is a more complete extract of my
code.

schema.xsd

xsd:schema ...
  xsd:element name=getVersion
xsd:complexType
  xsd:sequence
  /xsd:sequence
/xsd:complexType
  /xsd:element
  
  xsd:element name=getVersionResponse
xsd:complexType
xsd:sequence
  xsd:element name=version type=xsd:string/xsd:element
/xsd:sequence
  /xsd:complexType
/xsd:schema



wsdl - simplified

wsdl:definitions name=VersionService ...

  !-- TYPES --
  wsdl:types
xsd:schema ... 
  xsd:include schemaLocation=schema.xsd/xsd:include
/xsd:schema
  wsdl:types

  !-- MESSAGES --
  wsdl:message name=versionRequest
wsdl:part element=schema:getVersion name=versionRequest/
  /wsdl:message
  wsdl:message name=versionResponse  
wsdl:part element=schema:getVersionResponse name=versionResponse/
  /wsdl:message

  !-- PORT --
  wsdl:portType name=Version
wsdl:operation  name=getVersion
  wsdl:input message=event:versionRequest/wsdl:input
  wsdl:output message=event:versionResponse/
/wsdl:operation
  /wsdl:portType

  !-- BINDING --
  wsdl:binding name=VersionSoapBinding type=event:Event
soap:binding style=document
transport=http://schemas.xmlsoap.org/soap/http/
!-- Service --
wsdl:operation name=getVersion
  soap:operation soapAction=mynamespace/VersionService/getVersion/
  wsdl:inputsoap:body use=literal//wsdl:input
  wsdl:outputsoap:body use=literal//wsdl:output
/wsdl:operation
  /wsdl:binding


  !-- SERVICE --
  wsdl:service name=VersionService
wsdl:port name=Version binding=event:VersionSoapBinding
  soap:address
location=http://localhost:8080/axis2/services/VersionService/
/wsdl:port
  /wsdl:service
/wsdl:definitions


services.xml

serviceGroup 
  service name=VersionService
messageReceivers
messageReceiver mep=http://www.w3.org/2004/08/wsdl/in-out;
class=org.apache.axis2.rpc.receivers.RPCMessageReceiver/
/messageReceivers
parameter locked=false name=ServiceClass
  VersionPort
/parameter
  /service
/serviceGroup

wsimport generated service interface

@WebService(name = Version, targetNamespace =
mynamespace/VersionService)
@XmlSeeAlso({
ObjectFactory.class
})
public interface Version {

@WebMethod(action = mynamespace/VersionService/getVersion)
@WebResult(name = version, targetNamespace = schema)
@RequestWrapper(localName = getVersion, targetNamespace = schema,
className = GetVersion)
@ResponseWrapper(localName = getVersionResponse, targetNamespace =
schema, className = GetVersionResponse)
public String getVersion();
}

My implementation of the class just has the method getVersion which returns
VERSION. The method does get called.

The client code looks like this. It always prints null. If I do some
debugging I see that the return value is present, but the unmarshalled
object (version) does not have it.

VersionService service = new VersionService();
Version version = service.getPort(Version.class); // Port
System.out.println(version.getVersion());

My question is what am I doing wrong? I must be doing something wrong, but I
have run out of ideas. I suspect it has got something to do with how I
configure the whole thing. Maybe I use wrong kind style in my binding
(document/rpc). Does it have much effect? Could it be in my schema? All the
examples I see online look quite similar to mine, but for some reason I
can't see the return value in the version-object.

Thank you

Pauli




Pauli Savolainen wrote:
 
 Hi,
 
 I use wsimport to generate classes from my wsdl. My webservice has one
 method called getVersion. I call this webservice and all works fine except
 when the response is unmarshalled into a java object the return value
 disappears.
 
 
 WebService class
 
 @WebService(name = Version, targetNamespace = mynamespace)
 @XmlSeeAlso({
 ObjectFactory.class
 })
 @SOAPBinding(parameterStyle = ParameterStyle.BARE)
 public interface Event {
  ...
  String getVersion()
 }
 
 
 Client:
 
 VersionService service = new VersionService();
 Version version = service.getPort(Version.class);
 System.out.println(version.getVersion());
 -- null
 
 The response message:
 
 ?xml version='1.0' encoding='utf-8'?
 soapenv:Envelope
 xmlns:soapenv=http://schemas.xmlsoap.org/soap/envelope/;
 soapenv:Body
 ns:getVersionResponse xmlns:ns=mynamespace
 ns:returnVERSION/ns:return
 /ns:getVersionResponse
 /soapenv:Body
 /soapenv:Envelope
 
 The unmarshalled object has a string field response but it is always null.
 If I change the SOAPBinding annotation parameterStyle.BARE to
 parameterStyle.WRAPPED I get the correct answer but this I shouldn't do
 because the elements in my wsdl are not really wrappers (according to the
 jax-ws spec).
 
 If I change the elements to properly wrapped (according to the spec), I
 still get the null result when calling the getVersion method of the
 webservice.
 
 So no matter what I do I the unmarshalled object's