Re: Additional XML prefixes when client receives SOAP fault

2009-10-01 Thread don t

Hi, you can convert the XML document to a new document without the prefixes.
Then execute your hash function on the new document. One way to convert XML
documents is using XSLT. See this link for example:

https://www.stylusstudio.com/xsllist/200812/post70070.html


Chris82KS wrote:
 
 Hello, 
 I have a problem with XML prefixes. When the SOAP message leaves the
 server with a fault the body looks like this: 
 
 soapenv:Body
 xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;
 wsu:Id=Id-25568549
   soapenv:Fault
   soapenv:Code
   soapenv:Valuesoapenv:Receiver/soapenv:Value
   /soapenv:Code
   soapenv:Reason
   soapenv:Text xml:lang=en-USENFORCED ERROR THROWN
 CORRECTLY/soapenv:Text
   /soapenv:Reason
   soapenv:Detail
   serviceFault 
 xmlns=http://www.foo.net/test/xsd/sys/common;
   faultcode0010/faultcode
   reasonENFORCED ERROR THROWN CORRECTLY/reason
   node/
   detailENFORCED ERROR THROWN CORRECTLY/detail
   ctxIdAC10014E0123F082FFAD0001/ctxId
   
 timestamp2009-09-25T11:23:32.156+02:00/timestamp
   /serviceFault
   /soapenv:Detail
   /soapenv:Fault
 /soapenv:Body
 
 But the client takes this body out of the stream: 
 
 soapenv:Body xmlns:soapenv=http://www.w3.org/2003/05/soap-envelope;
 xmlns:wsu=http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd;
 wsu:Id=Id-25568549
   soapenv:Fault
   soapenv:Code
   soapenv:Valuesoapenv:Receiver/soapenv:Value
   /soapenv:Code
   soapenv:Reason
   soapenv:Text xml:lang=en-USENFORCED ERROR THROWN
 CORRECTLY/soapenv:Text
   /soapenv:Reason
   soapenv:Detail
   axis2ns1:serviceFault
 xmlns:axis2ns1=http://www.foo.net/test/xsd/sys/common;
   
 axis2ns1:faultcode0010/axis2ns1:faultcode
   axis2ns1:reasonENFORCED ERROR THROWN 
 CORRECTLY/axis2ns1:reason
   axis2ns1:node/
   axis2ns1:detailENFORCED ERROR THROWN 
 CORRECTLY/axis2ns1:detail
   
 axis2ns1:ctxIdAC10014E0123F082FFAD0001/axis2ns1:ctxId
   
 axis2ns1:timestamp2009-09-25T11:23:32.156+02:00/axis2ns1:timestamp
   /axis2ns1:serviceFault
   /soapenv:Detail
   /soapenv:Fault
 /soapenv:Body
 
 
 
 You can see that there is no prefix in the serviceFault tag on the server
 side but the client puts the prefix axis2ns1 into the body. For me this
 is a problem because the body is signed on the server side and the client
 calculates the hash with this prefix. That leads to signature verification
 failure. Would be great if you can help me. 
 Greetings 
 Christian 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Additional-XML-prefixes-when-client-receives-SOAP-fault-tp25609385p25706726.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Axis2 wsdl2java jibx: No mapping defined for element

2009-09-29 Thread don t

Hi, you need to check the binding.xml file and verify there is a correct
mapping defined for ElementName. There should be an entry like this:

 value name=ElementName ns=http://sample/types/

The element name and namespace in the binding file needs to match the WSDL
definition.


Anshuk Pal Chaudhuri-2 wrote:
 
 Hello,
 
 Mentioned an incorrect subject line in my earlier mail. My applogies.
 
 I am trying to integrate axis2 1.5 with jibx 1.2.1. 
 I am not sure that is a problem with axis2 or jibx.
 I have the wsdl file and the schema with me.
 I have used the jibx org.jibx.schema.codegen.CodeGen to generate the
 objects  the binding file from the schema. 
 I then enhance the classes using the jibx binding compiler way.Uptil now
 all fine.
 
 Then when am trying to generate server side skeletons using:
 
 org.apache.axis2.wsdl.WSDL2Java  -uri Service.wsdl -d jibx -Ebindingfile
 binding.xml -s -ss -sd -scn ServiceName
 referring
 http://ws.apache.org/axis2/1_1_1/jibx/jibx-codegen-integration.html#wsdl 
 I am getting errors.
 
 The stacktrace:
 
 Exception in thread main
 org.apache.axis2.wsdl.codegen..CodeGenerationException
 java.lang.RuntimeException: No mapping defined for element
 {http://sample/types
 }ElementName
 
 I am not sure where I went wrong, also I did find it being mentioned in
 quite a few number of places such as,
 http://marc.info/?l=axis-userm=117028406518758w=2 
 
 But I really did not find any solution, I think somebody has got some
 workaround for this.
 If I use jaxb instead of jibx, it works fine, there is not binding file in
 such a case, is the generated the binding file in correct, I am not really
 sure so hinting at different things.
 Can anyone help in some workaround.
 
 
 Regards,
 Anshuk
 
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Axis2-wsdl2java-jibx%3A-No-mapping-defined-for-element-tp25603967p25668398.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: [AXIS2] Migration Issues for Axis1 - Axis2

2009-02-06 Thread don t

Hi, if your application uses existing Java data objects then you may want to
use JiBX data binding with Axis2. You will need to define the binding
between Java objects and the XML messages.


Sumit Gaikaiwari-3 wrote:
 
 Hi,
 
 I am working on migration of web-services in our project from Axis1 to
 Axis2. In generating client/server classes I found those are not
 equivalent to classes generated by Axis1 WSDL2Java utility. We have an
 inheritance hierarchy of data classes created in WSDL.
 
 When java classes are created using Axis1 wsdl2java, it adds a multi-value
 constructor to each class which passes values required by super class
 using super(param1, param2...) and instantiates it's own instance variable
 from remaining argument.
 
 Whereas, axis2 wsdl2java do not generate any constructor, so the only
 constructor which can be invoked is default constructor. We were using
 multi-value constructors in earlier business logic, so if we use these new
 classes directly, we will have to change code in all such places. Is there
 any way Axis2 to generate classes in such manner? Please let me know if I
 should add any other option to create such hierarchy. I have tried using
 ADB and XMLBeans binding. Below is the command I tried by using ADB
 binding-
 
 WSDL2Java -uri PlanIntegrationServices1_0.wsdl -d adb -s -o build2 -u
 
 
 I have also attached wsdl as well as classes generated by axis1 and axis2
 style; you can notice there is a multiple arg constructor in axis1 style
 classes but not in axis2 generated code.
 
 Kind Regards,
 Sumit Gaikaiwari
 
 
 

-- 
View this message in context: 
http://www.nabble.com/-AXIS2--Migration-Issues-for-Axis1--%3E-Axis2-tp21829252p21883065.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: How to get rid of Unexpected SubElement Exception

2009-01-09 Thread don t

Hi, to make an element optional you can set minOccurs=0 in the WSDL.
However elements in the SOAP body must appear in the same order specified in
the WSDL.


ibrahim demir wrote:
 
 Hi All;
 
 I have already said about my problem but want to repeat. I am using Axis2
 and Axis2 Code Generator for Eclipse to generate my client codes.
 (Choosing ABD binding)
 
 As you know when the response has extre elements or the order is different
 than the wsdl than it causes and Unexpected Subelemenet exception. Is
 there a way to void it. Is it possible to make Axis2 just use the coming
 elemenst that are necceassary for it. Or should I change my binding
 methodology?
 This a very problem for me because the server is not stable about the
 responses and is dynamic for being able to response for diffrent requests.
 
 yours.
 
  Ibrahim DEMIR
 CyberSoft Yazilim Muh.
 http://www.ibrahimdemir.org
 
 
   
 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-rid-of-Unexpected-SubElement-Exception-tp21326520p21379854.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: How to get rid of Unexpected SubElement Exception

2009-01-09 Thread don t

You can try XMLBeans or working with the AXIOM model.


ibrahim demir wrote:
 
 Hi;
 
 Thanks for the reply. But the order is changeable also. But today
 contract-first approach is hard to obey.So by the time the response
 changes. So will it make sense if I change my binding? Which binding
 methodology can easily work when the order of the elements change.?
 
 Yours
 
  Ibrahim DEMIR
 CyberSoft Yazilim Muh.
 http://www.ibrahimdemir.org
 
  

  
 
 
 
 
 
 From: don t donny.tjon...@verizonwireless.com
 To: axis-user@ws.apache.org
 Sent: Friday, January 9, 2009 10:18:57 PM
 Subject: Re: How to get rid of Unexpected SubElement Exception
 
 
 Hi, to make an element optional you can set minOccurs=0 in the WSDL.
 However elements in the SOAP body must appear in the same order specified
 in
 the WSDL.
 
 
 ibrahim demir wrote:
 
 Hi All;
 
 I have already said about my problem but want to repeat. I am using Axis2
 and Axis2 Code Generator for Eclipse to generate my client codes.
 (Choosing ABD binding)
 
 As you know when the response has extre elements or the order is
 different
 than the wsdl than it causes and Unexpected Subelemenet exception. Is
 there a way to void it. Is it possible to make Axis2 just use the coming
 elemenst that are necceassary for it. Or should I change my binding
 methodology?
 This a very problem for me because the server is not stable about the
 responses and is dynamic for being able to response for diffrent
 requests.
 
 yours.
 
  Ibrahim DEMIR
 CyberSoft Yazilim Muh.
 http://www.ibrahimdemir.org
 
 
  
 
 
 -- 
 View this message in context:
 http://www.nabble.com/How-to-get-rid-of-Unexpected-SubElement-Exception-tp21326520p21379854.html
 Sent from the Axis - User mailing list archive at Nabble.com.
 
 
   
 

-- 
View this message in context: 
http://www.nabble.com/How-to-get-rid-of-Unexpected-SubElement-Exception-tp21326520p21381872.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: backwards compatible axis web services?

2008-12-29 Thread don t

Hi, this link may be useful for dealing with Web services versioning

http://www.ibm.com/developerworks/webservices/library/ws-version/


Chris Hyzer wrote:
 
 I would like to know if there is a document or if someone can tell me
 their experience with backwards compatible web services:
 
 Here is a use case.
 
 I make a class with web service methods.
 I call java2wsdl, then wsdl2java
 I launch this, and people make clients, and use them.
 Then I add a field to an input and output.
 All existing clients should still work, and should not fail when not
 sending the new input, and should see the new output field (somehow they
 need to pass their version string in to the server).  all new clients
 should be able to send their new field, and they would see the new output
 field.
 
 A couple of options:
 
 1. Make two beans, two wsdls.  Not exactly convenient since wont I need a
 copy of the bean which does the service in a different package or
 something?  Or if the field is in Java, but not the wsdl, will it handle
 it?
 2. Deploy the service twice, with two different URLs.  This is ok, though
 doesnt scale exactly well, for each tweak in an existing service we need a
 whole new webapp...
 
 What I would really like is several different wsdls (old and new), but
 hooked up to the same beans.  Then somehow in the code say if client
 version is less than 1.4, then dont send this field), with an annotation
 or something... 
 
 How do people handle one webapp with multiple version clients?
 
 Thanks!
 Chris
 
 
   
 

-- 
View this message in context: 
http://www.nabble.com/backwards-compatible-axis-web-services--tp21112440p21211816.html
Sent from the Axis - User mailing list archive at Nabble.com.



Re: Standard for publishing custom WSDL/XSD using axis2

2008-11-17 Thread don t

Try putting WSDL and XSD under META-INF of your aar archive file. For example

testservice.aar
---META-INF
 ---TestService.wsdl
 ---TestService.xsd 

In TestService.wsdl you need only include the xsd filename in schemaLocation

xs:include schemaLocation=TestService.xsd/


After deployment the wsdl URL is something like this using your own port and
service name

http://localhost:8080/axis2/services/TestService?wsdl


And the schema URL using xsd parameter to pick the schema you want to browse

http://localhost:8080/axis2/services/TestService?xsd=TestService.xsd


Kurt Kavanaugh wrote:
 
 I have a number of Document based web services. Separate XSD document
 imported into my WSDL.
 
  
 
 All is well. I can use the WSDL in the .NET world, IBM world all the
 clients work.
 
  
 
 What I can't figure out, yet. Is where to put the WSDL so that it is
 picked up via a URL whilest in Axis2.
 
  
 
 The URI/services/serviceName?wsdl picks uses the JSP file to infer the
 WSDL, but the generated WSDL knows nothing of the XSD, as could be
 expected, how could it?
 
  
 
 Next stop is to set a break point on the incoming in the AxisServlet and
 see what gives.
 
  
 
 Note, XSD conformance is a must, with regards the request and reponse
 
  
 
 Thanks in advance
 
  
 
 Kurt
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Standard-for-publishing-custom-WSDL-XSD-using-axis2-tp20486488p20551040.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: Standard for publishing custom WSDL/XSD using axis2

2008-11-14 Thread don t

Hi, are you asking about how to specify schema location in your WSDL during
runtime? I believe absolute HTTP URL such as
schemaLocation=http://foo.com/foo.xsd; is best. Relative URL may not work
correctly and file paths don't work at all at runtime.


Kurt Kavanaugh wrote:
 
 I have a number of Document based web services. Separate XSD document
 imported into my WSDL.
 
  
 
 All is well. I can use the WSDL in the .NET world, IBM world all the
 clients work.
 
  
 
 What I can't figure out, yet. Is where to put the WSDL so that it is
 picked up via a URL whilest in Axis2.
 
  
 
 The URI/services/serviceName?wsdl picks uses the JSP file to infer the
 WSDL, but the generated WSDL knows nothing of the XSD, as could be
 expected, how could it?
 
  
 
 Next stop is to set a break point on the incoming in the AxisServlet and
 see what gives.
 
  
 
 Note, XSD conformance is a must, with regards the request and reponse
 
  
 
 Thanks in advance
 
  
 
 Kurt
 
 
 

-- 
View this message in context: 
http://www.nabble.com/Standard-for-publishing-custom-WSDL-XSD-using-axis2-tp20486488p20509610.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: FW: Axis2 Webservice wsdl version

2008-10-23 Thread don t

Hi, I don't use Weblogic but have seen this error. Perhaps there is some
error in your original wsdl, or it references an XML schema file that the
server is not able to get.


PeterRajesh wrote:
 
 
 
 
 Hi,
 
 After deployed the Axis2 webservice (.aar file) in Weblogic, clicked
 the wsdl url for example,
 http://localhost:7001/axis2/services/ABCProcessingService?wsdl and got
 the below error
 
 error 
 descriptionUnable to generate WSDL 1.1 for this
 service/description 
 reasonIf you wish Axis2 to automatically generate the WSDL 1.1, then
 please +set useOriginalwsdl as false in your services.xml/reason 
 /error
 
 But if I mention the wsdl version as wsdl2.0 as below, I can see the
 wsdl displayed.
 
 http://localhost:7001/axis2/services/ABCProcessingService?wsdl=wsdl2.0
 
 
 Please let me know what I need to do to display the wsdl without
 mentioning the version wsdl2.0
 
 Thanks  Regards,
 
 Peter Rajesh
 
 
 
 
 *
 This communication, including attachments, is
 for the exclusive use of addressee and may contain proprietary,
 confidential and/or privileged information.  If you are not the intended
 recipient, any use, copying, disclosure, dissemination or distribution is
 strictly prohibited.  If you are not the intended recipient, please notify
 the sender immediately by return e-mail, delete this communication and
 destroy all copies.
 *
 
 
 

-- 
View this message in context: 
http://www.nabble.com/FW%3A-Axis2-Webservice-wsdl-version-tp20116806p20141280.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



Re: Altering WSDL to match the expected SOAP

2008-10-09 Thread don t

Hi, the standard practice for a web service client is to obtain the WSDL from
the service provider and generate the stub from it. Editing the WSDL on the
client side is problematic and causes errors.



thusa gihan wrote:
 
 Hi all,
 
 I'm writing a client with Axis 1.4 to a web service, but the generated
 SOAP
 request is not matching with the one expected by the web service.
 
 Could you please help me to edit the WSDL file (saved into my local disk
 from the server) so that I can generate the stubs to build the expected
 SOAP
 requests. I have posted the WSDL, currently generated SOAP request and the
 expected SOAP request below.
 
 If WSDL editing is not the way to get this done, please suggest me some
 other way. I'm really stuck here.
 
 Thanks in advance.
 
 Thusa.
 
 
 
 This is the avaialble WSDL file.
 --
  ?xml version=1.0 encoding=UTF-8?
 definitions xmlns:typens=urn:Company xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; xmlns:soap=
 http://schemas.xmlsoap.org/wsdl/soap/; xmlns:soapenc=
 http://schemas.xmlsoap.org/soap/encoding/; xmlns:wsdl=
 http://schemas.xmlsoap.org/wsdl/; xmlns=http://schemas.xmlsoap.org/wsdl/;
 name=Company targetNamespace=urn:Company
   message name=call
 part name=sessionId type=xsd:string/
 part name=resourcePath type=xsd:string/
 part name=args type=xsd:anyType/
   /message
   message name=callResponse
 part name=callReturn type=xsd:anyType/
   /message
   message name=login
 part name=username type=xsd:string/
 part name=apiKey type=xsd:string/
   /message
   message name=loginResponse
 part name=loginReturn type=xsd:string/
   /message
 
   portType name=Comp_Api_Model_Server_HandlerPortType
 operation name=call
   documentationCall api functionality/documentation
   input message=typens:call/
   output message=typens:callResponse/
 /operation
 operation name=login
   documentationLogin user and retrive session id/documentation
   input message=typens:login/
   output message=typens:loginResponse/
 /operation
   /portType
 
   binding name=Comp_Api_Model_Server_HandlerBinding
 type=typens:Comp_Api_Model_Server_HandlerPortType
 soap:binding style=rpc transport=
 http://schemas.xmlsoap.org/soap/http/http://schemas.xmlsoap.org/soap/http%22/

 operation name=call
   soap:operation
 soapAction=urn:Comp_Api_Model_Server_HandlerAction/
   input
 soap:body namespace=urn:Company use=encoded encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding//http://schemas.xmlsoap.org/soap/encoding/%22/

   /input
   output
 soap:body namespace=urn:Company use=encoded encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding//http://schemas.xmlsoap.org/soap/encoding/%22/

   /output
 /operation
 operation name=login
   soap:operation
 soapAction=urn:Comp_Api_Model_Server_HandlerAction/
   input
 soap:body namespace=urn:Company use=encoded encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding//http://schemas.xmlsoap.org/soap/encoding/%22/

   /input
   output
 soap:body namespace=urn:Company use=encoded encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding//http://schemas.xmlsoap.org/soap/encoding/%22/

   /output
 /operation
   /binding
   service name=CompanyService
 port name=Comp_Api_Model_Server_HandlerPort
 binding=typens:Comp_Api_Model_Server_HandlerBinding
   soap:address location=
 http://localhost/Company/index.php/api/index/index//http://localhost/Company/index.php/api/index/index/%22/

 /port
   /service
 /definitions
  --
 
 Currently generated SOAP request is as follows.
  --
  ?xml version=1.0 encoding=UTF-8?
soapenv:Envelope xmlns:soapenv=
 http://schemas.xmlsoap.org/soap/envelope/; xmlns:xsd=
 http://www.w3.org/2001/XMLSchema; xmlns:xsi=
 http://www.w3.org/2001/XMLSchema-instance;
   soapenv:Body
  ns1:call soapenv:encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding/; xmlns:ns1=urn:Company
 sessionId
 xsi:type=xsd:string1vp029hcubiiven8cr1s21nke2/sessionId
 resourcePath
 xsi:type=xsd:stringcustomer.create/resourcePath
 args soapenc:arrayType=xsd:anyType[1]
 xsi:type=soapenc:Array xmlns:soapenc=
 http://schemas.xmlsoap.org/soap/encoding/;
args href=#id0/
 /args
  /ns1:call
  multiRef id=id0 soapenc:root=0 soapenv:encodingStyle=
 http://schemas.xmlsoap.org/soap/encoding/; xsi:type=ns2:Map
 xmlns:soapenc=http://schemas.xmlsoap.org/soap/encoding/; xmlns:ns2=
 http://xml.apache.org/xml-soap;
 item
key xsi:type=soapenc:stringemail/key
value xsi:type=soapenc:string[EMAIL PROTECTED]/value
 /item
 item
key xsi:type=soapenc:stringlastname/key
  

Re: WSDL2Java behavior

2008-10-01 Thread don t

Hi, this seems to occur when the WSDL has XML schema restrictions and you
then run wsdl2java with the default ADB binding. It seems the type1 classes
are wrappers that enforce the XML schema restrictions in the setters. 

One way to work around this is create your own Java beans and use JiBX data
binding. However there is significant amount of work and learning when using
a different data binding.


Steve Cohen wrote:
 
 running command line WSDL2Java, (axis2 1.4.1) with following options
 
 -o {root of my source tree} -t -d adb -u -ssi -wv 1.1 -or -Ejavaversion 
 1.5 -uri {my wsdl}
 
 
 I find the following source code generation pattern:
 In reasonable packages under source, it generates data classes from the 
 WSDL, say   com.whatever.City1.java
 com.whatever.State1.java
 
 But it also generates (in the default package)
 City0.java
 State0.java
 
 What could be causing it to generate these extra classes in the default 
 package and is there anything I can or should do about it.
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 
 
 

-- 
View this message in context: 
http://www.nabble.com/WSDL2Java-behavior-tp19744185p19771435.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



Common fault used by multiple WSDL files

2008-09-23 Thread don t

Our application is composed of several Web services. Each service has its own
target namespace and Java package. Each service also have some common
methods with the same signatures. The problem is Axis2 wsdl2java generates
Fault classes in each service's target namespace instead of some common
namespace. We're forced to redundantly implement the common methods for each
service like this because wsdl2java creates a different Fault class for each
service.

public class ServiceA extends CommonService implements ServiceAInterface {
public String getVersion() throws a.Fault { ... }
}

public class ServiceB extends CommonService implements ServiceBInterface {
public String getVersion() throws b.Fault { ... }
}


Ideally we want to refactor common methods to a parent class like this.

public class CommonService {
public String getVersion() throws common.Fault { ... }
}

Is this doable with Axis2, or if not are there other better ways to refactor
this?
-- 
View this message in context: 
http://www.nabble.com/Common-fault-used-by-multiple-WSDL-files-tp19638471p19638471.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



wsdl2java with JiBX binding cannot unwrap integer param

2008-09-10 Thread don t

1.  Use Axis2 1.4

2.  Download Axis2 jibx example
http://www.sosnoski.com/jibx-wiki/space/axis2-jibx/example/jibx-library.zip

3.  Unzip it and configure axis_home and jibx-home

4.  In library.wsdl (see attached) change line 18 from

element name=isbn type=string/

to

element name=isbn type=integer/

5.  Run ant generate-server

 [java] Retrieving document at './library.wsdl'.
 [java] log4j:WARN No appenders could be found for logger
(org.apache.axis2.description.WSDL11ToAxisServiceBuilder).
 [java] log4j:WARN Please initialize the log4j system properly.
 [java] Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Cannot unwrap element
{http://ws.sosnoski.com/library/wsdl}getBook: no format definition found for
type {http://www.w3.org/2001/XMLSchema}integer (used by element
{http://ws.sosnoski.com/library/wsdl}isbn)
 [java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
 [java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)
 [java] at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
 [java] Caused by: java.lang.RuntimeException: Cannot unwrap element
{http://ws.sosnoski.com/library/wsdl}getBook: no format definition found for
type {http://www.w3.org/2001/XMLSchema}integer (used by element
{http://ws.sosnoski.com/library/wsdl}isbn)
 [java] at
org.apache.axis2.jibx.CodeGenerationUtility.unwrapMessage(CodeGenerationUtility.java:801)
 [java] at
org.apache.axis2.jibx.CodeGenerationUtility.engage(CodeGenerationUtility.java:387)
 [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
 [java] at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 [java] at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 [java] at java.lang.reflect.Method.invoke(Method.java:597)
 [java] at
org.apache.axis2.wsdl.codegen.extension.JiBXExtension.engage(JiBXExtension.java:77)
 [java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:224)
 [java] ... 2 more



http://www.nabble.com/file/p19417565/library.wsdl library.wsdl 
-- 
View this message in context: 
http://www.nabble.com/wsdl2java-with-JiBX-binding-cannot-unwrap-integer-param-tp19417565p19417565.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



Axis2 JiBX integer binding

2008-09-09 Thread don t

My WSDL defines an integer element like this:

xs:element name=id type=xsd:integer/


I ran Axis2 1.4 wsdl2java with JiBX binding and unwrap option and got this
error:

Exception in thread main
org.apache.axis2.wsdl.codegen.CodeGenerationException:
java.lang.RuntimeException: Cannot unwrap element
...
no format definition found for type
{http://www.w3.org/2001/XMLSchema}integer
[java] at
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:271)
[java] at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:35)

Seems JiBX binding doesn't support XML schema integer type.
-- 
View this message in context: 
http://www.nabble.com/Axis2-JiBX-integer-binding-tp19402442p19402442.html
Sent from the Axis - User mailing list archive at Nabble.com.


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



AxisServlet parameter order mismatch

2008-08-13 Thread don t

Hi, I am calling an Axis 1.4 service through the browser with 4 URL
parameters like this:

http://localhost:8012/axis/services/LocationService?method=getLocationsByCoordinatesregion=Hawaiidelta=2latitude=20longitude=-160


The operation and parameters are defined in Document/Literal Wrapped style
WSDL like this:

xsd:element name=getLocationsByCoordinates
xsd:complexType
xsd:sequence
xsd:element name=region type=xsd:string /
xsd:element name=latitude type=xsd:double /
xsd:element name=longitude type=xsd:double /
xsd:element name=delta type=xsd:double /
/xsd:sequence
/xsd:complexType
/xsd:element

wsdl:message name=getLocationsByCoordinatesRequest
wsdl:part element=tns:getLocationsByCoordinates name=parameters /
/wsdl:message


From above HTTP request Axis generates a request SOAP envelope like this:

SOAP-ENV:Envelope
xmlns:SOAP-ENV=http://schemas.xmlsoap.org/soap/envelope/;
SOAP-ENV:Body
getLocationsByCoordinates
regionHawaii/region
longitude-156/longitude
delta1/delta
latitude20/latitude
/getLocationsByCoordinates
/SOAP-ENV:Body
/SOAP-ENV:Envelope


However looking at the logs seems the parameter ordering was changed when
invoking service:

region = Hawaii
latitude = -156.0
longitude = 20.0
delta = 1.0


After some debugging it seems the problem is in Axis RPCHandler.java

http://svn.apache.org/viewvc/webservices/axis/trunk/java/src/org/apache/axis/message/RPCHandler.java?view=markup

The parameter descriptor lookup by QName returns null:

// Try by name first
if (isResponse) {
paramDesc = operation.getOutputParamByQName(qname);
} else {
paramDesc = operation.getInputParamByQName(qname);
}

so Axis then tries to lookup parameter descriptor by position: 

// If that didn't work, try position
// FIXME : Do we need to be in EITHER named OR positional
// mode?  I.e. will it screw us up to find something
// by position if we've already looked something up
// by name?  I think so...
if (paramDesc == null) {
if (isResponse) {
paramDesc = operation.getReturnParamDesc();
}
else {
paramDesc =
operation.getParameter(rpcElem.getParams().size() - 1);
}
}

The problem is lookup by position results in botched parameter ordering when
invoking the service. My question is how can I specify operation parameters
in WSDL or WSDD such that the parameter QName lookup will not return null,
or parameter position ordering is preserved when inovked through
AxisServlet?
-- 
View this message in context: 
http://www.nabble.com/AxisServlet-parameter-order-mismatch-tp18967041p18967041.html
Sent from the Axis - User mailing list archive at Nabble.com.


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