unsubscribe

2016-11-14 Thread Dinshaw, Afshad


From: Sterpu Victor [mailto:vic...@caido.ro]
Sent: Monday, November 14, 2016 3:59 PM
To: Martin Gainty ; java-user@axis.apache.org
Subject: Re[4]: Raw SOAP XML response

I tired your code but I got a problem. This is what I wrote(I don't have a 
axis2.xml file, I just create the stub with wsdl2java and used the class):
ConfigurationContext configContext = 
ConfigurationContextFactory.createDefaultConfigurationContext();
ServiceClient sender = new ServiceClient(configContext, null);
OperationClient mepClient = sender.createClient(ServiceClient.ANON_OUT_IN_OP);
MessageContext 
response=mepClient.getMessageContext(WSDLConstants.MESSAGE_LABEL_IN_VALUE);
String response_xml = response.getEnvelope().toString();

These lines are executed immediatly after the succesful SOAP call and I receive 
a java.lang.NullPointerException at the line "String response_xml = 
response.getEnvelope().toString();".
I traced the SOAP response with Fiddler and the answer is "http://schemas.xmlsoap.org/soap/envelope/;>http://www.w3.org/2001/XMLSchema-instance;>"

Thank you.

-- Original Message --
From: "Martin Gainty" >
To: "java-user@axis.apache.org" 
>; "Sterpu Victor" 
>
Sent: 2/11/2016 9:28:48 PM
Subject: Re: Re[2]: Raw SOAP XML response



From: Sterpu Victor >
Sent: Wednesday, November 2, 2016 11:57 AM
To: Martin Gainty; java-user@axis.apache.org
Subject: Re[2]: Raw SOAP XML response

It didn't work.
This is what I did: I deleted from the directory of Axis2\lib 4 files: 
axiom-jaxb-1.2.19.jar, axiom-api-1.2.19.jar, axiom-dom-1.2.19.jar, 
axiom-impl-1.2.19.jar
and I added these 4 files: 
axiom-api-1.2.20.jar,axiom-dom-1.2.20.jar,axiom-impl-1.2.20.jar,axiom-jaxb-1.2.20.jar.
I use Axis embeded so I also deleted from my netbeans libraries the old jars 
and added the new ones.
I recompiled and the error remained.


-- Original Message --
From: "Martin Gainty" >
To: "java-user@axis.apache.org" 
>; "Sterpu Victor" 
>
Sent: 2/11/2016 4:58:09 PM
Subject: Re: Raw SOAP XML response

possible outdated version of axiom

 * In Axiom versions prior to 1.2.9, the sequence of events was 
inconsistent if the
 * underlying stream is XOP encoded and caching is disabled (see 
WSCOMMONS-485).
 * This made it necessary for the caller to (partially) handle the XOP 
processing and to use
 * {@link OMAttachmentAccessor#getDataHandler(String)} to retrieve the 
binary content.
 * Starting with 1.2.9 this is no longer be the case: as specified above,
 * the sequence of events is *independent of the state of the object model*
 * and the value of the cache parameter,
 * and ALL binary content is reported through the
 * {@link org.apache.axiom.ext.stax.datahandler.DataHandlerReader} 
(embedded in axiom-api) extension.

upgrade axiom to 1.2.9 a recompile, package, deploy and run with 1.2.9 should 
mitigate the error you are now receiving

*please keep us apprised*

Martin
__


From: Sterpu Victor >
Sent: Wednesday, November 2, 2016 9:37 AM
To: java-user@axis.apache.org
Subject: Raw SOAP XML response

Hello

I need to save the raw SOAP XML response from Axis2(I use axis 2 1.7.3).
When Axis2 call retusrns an error this code works:
String response = 
sc.getLastOperationContext().getMessageContext("In").getEnvelope().toString();

MG>//build configurationContext from location of repo and name of axis2.xml
MG> ConfigurationContext configContext = ConfigurationContextFactory
.createConfigurationContextFromFileSystem("../../repository",  //exact location 
of repository
"axis2.xml");   //exact filename of axis2.xml

MG>establish new ServiceClient implementing attributes from ConfigurationContext
MG> ServiceClient sender = new ServiceClient(configContext, null);

MG>you will need to supply a QName for incoming request and SOAP response output
/**
 * Operation name used for an anonymous in-out operation (meaning we sent a 
message and receive
 * a response, equivalent to a WSDL In-Out operation).

public static final QName ANON_OUT_IN_OP = new 
QName(Constants.AXIS2_NAMESPACE_URI,
 "anonOutInOp",
 
Constants.AXIS2_NAMESPACE_PREFIX);
*/
MG>OperationClient mepClient = 
sender.createClient(ServiceClient.ANON_OUT_IN_OP);

MG>ask client to contact 

RE: Exception after upgrading to Axis2 1.7.3

2016-10-17 Thread Dinshaw, Afshad
Use apache-cxf. It is more widely used and has better and legitimate 
documentation.
AXIS2 says you can use XmlBeans for databinding. When you goto the XmlBeans 
website they say the project is retired!

From: Bill Phillips [mailto:william.r.phillips...@gmail.com]
Sent: Monday, October 17, 2016 3:58 PM
To: java-user@axis.apache.org
Subject: Exception after upgrading to Axis2 1.7.3

I was tasked out with upgrading our legacy Axis2 implemtation from 1.5.6  to 
1.7.3.

I have worked through all the various library and compilation changes and it 
seems to be compiling and packaging as expected.

However, when I attempt to start the app, I receive the following:


2016-10-17 20:38:49.688 [localhost-startStop-1] ERROR 
org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/axis2] null - 
StandardWrapper.Throwable
java.lang.ExceptionInInitializerError
at 
org.apache.axis2.description.AxisDescription.(AxisDescription.java:72) 
~[axis2-kernel-1.7.3.jar:1.7.3]
at 
org.apache.axis2.engine.AxisConfiguration.(AxisConfiguration.java:175) 
~[axis2-kernel-1.7.3.jar:1.7.3]
at 
org.apache.axis2.deployment.DeploymentEngine.populateAxisConfiguration(DeploymentEngine.java:627)
 ~[axis2-kernel-1.7.3.jar:1.7.3]
at 
org.apache.axis2.deployment.WarBasedAxisConfigurator.(WarBasedAxisConfigurator.java:157)
 ~[axis2-kernel-1.7.3.jar:1.7.3]
at 
org.apache.axis2.transport.http.AxisServlet.initConfigContext(AxisServlet.java:620)
 ~[axis2-transport-http-1.7.3.jar:1.7.3]
at 
org.apache.axis2.transport.http.AxisServlet.init(AxisServlet.java:471) 
~[axis2-transport-http-1.7.3.jar:1.7.3]
at 
org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1183) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1099) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:989) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4913)
 [catalina.jar:8.5.5]
at 
org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5223)
 [catalina.jar:8.5.5]
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:724) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:700) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.core.StandardHost.addChild(StandardHost.java:734) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:952) 
[catalina.jar:8.5.5]
at 
org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1823) 
[catalina.jar:8.5.5]
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) 
[?:1.8.0_102]
at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) 
[?:1.8.0_102]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) 
[?:1.8.0_102]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_102]
Caused by: java.lang.NullPointerException
at 
org.apache.crimson.tree.ElementNode.getAttributeNodeNS(ElementNode.java:415) 
~[crimson.jar:1.1]
at 
org.apache.crimson.tree.ElementNode.getAttributeNS(ElementNode.java:392) 
~[crimson.jar:1.1]
at 
org.apache.axiom.locator.ImplementationFactory.parseImplementation(ImplementationFactory.java:131)
 ~[axiom-api-1.2.19.jar:1.2.19]
at 
org.apache.axiom.locator.ImplementationFactory.parseDescriptor(ImplementationFactory.java:98)
 ~[axiom-api-1.2.19.jar:1.2.19]
at 
org.apache.axiom.locator.DefaultOMMetaFactoryLocator.(DefaultOMMetaFactoryLocator.java:87)
 ~[axiom-api-1.2.19.jar:1.2.19]
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method) ~[?:1.8.0_102]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown 
Source) ~[?:1.8.0_102]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown 
Source) ~[?:1.8.0_102]
at java.lang.reflect.Constructor.newInstance(Unknown Source) 
~[?:1.8.0_102]
at java.lang.Class.newInstance(Unknown Source) ~[?:1.8.0_102]
at 
org.apache.axiom.om.OMAbstractFactory.(OMAbstractFactory.java:104) 
~[axiom-api-1.2.19.jar:1.2.19]
... 22 more


I'm at a loss at to what is causing this problem.

Can anyone point me to a likely cause of this error?


Thanks,


Bill


RE: using wsdl2java fails Migrating from AXIS to AXIS2

2016-09-28 Thread Dinshaw, Afshad
Thank you. I was able to generate source using XmlBeans and making some changes 
to the WSDL.


-Original Message-
From: robertlazarski . [mailto:robertlazar...@gmail.com] 
Sent: Wednesday, September 28, 2016 5:44 AM
To: java-user@axis.apache.org
Subject: Re: using wsdl2java fails Migrating from AXIS to AXIS2

On Wed, Sep 28, 2016 at 1:58 AM, Dinshaw, Afshad <afshad.dins...@hpe.com> wrote:
> Hello,
>
>
>
> Currently we are using the axistools-maven-plugin 1.4 to generate java 
> stubs/classes etc from our WSDL (which I have modified for privacy and 
> attached).
>
> The plugin is being used in our pom.
>
>
>
> We need to move to AXIS2.
>
> The first thing im trying to do is use your CLI tool wsdl2java 
> (downloaded
> from: http://axis.apache.org/axis2/java/core/download.html) to 
> generate the stubs/classes successfully.
>
> However I am confused which option to use?
>
> ADB/XmlBeans/JBIX ??
>
>
>
> How would I know? AXIS did not have all these options.
>
>
>
> I tried each of these options and got different errors all related to 
> schema validation. However before I get into those error Id like to 
> find out which option I should use based on my existing WSDL.
>
>
>
> Thank you,
>
>
>
> Afshad Dinshaw
>
>
>
> Some of the errors I get are like:
>
>
>
> C:\Temp\axis2\axis2-1.7.3\bin>wsdl2java -uri C:\ temp\uhvnet.wsdl  -d 
> adb -s
>
> Using AXIS2_HOME:   C:\Temp\axis2\axis2-1.7.3
>
> Using JAVA_HOME:C:\Program Files\Java\jdk1.7.0_79
>
> Retrieving document at ‘C:\ temp\uhvnet.wsdl ‘.
>
> Retrieving schema at 'http://www.w3.org/2003/05/soap-encoding', 
> relative to 'file:/ C:/ temp/uhvnet.wsdl ‘.
>
> Retrieving schema at
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut
> ility-1.0.xsd', relative to 'file:/ C:/ temp/uhvnet.wsdl ‘.
>
> Retrieving schema at
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-se
> cext-1.0.xsd', relative to 'file:/ C:/ temp/uhvnet.wsdl ‘.
>
> Retrieving schema at
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-ut
> ility-1.0.xsd',
> relative to
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-se
> cext-1.0.xs
>
> d'.
>
> Retrieving schema at
> 'http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd', relative 
> to 
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
>
> Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 
> 'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
>
> log4j:WARN No appenders could be found for logger 
> (org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
>
> log4j:WARN Please initialize the log4j system properly.
>
> Exception in thread "main"
> org.apache.axis2.wsdl.codegen.CodeGenerationException:
> java.lang.RuntimeException: 
> java.lang.reflect.InvocationTargetException
>
> at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenera
> tionEngine.java:294)
>
> at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:50)
>
> at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
>
> Caused by: java.lang.RuntimeException:
> java.lang.reflect.InvocationTargetException
>
> at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(Simpl
> eDBExtension.java:53)
>
> at
> org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenera
> tionEngine.java:247)
>
> ... 2 more
>
> Caused by: java.lang.reflect.InvocationTargetException
>
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.j
> ava:57)
>
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccess
> orImpl.java:43)
>
> at java.lang.reflect.Method.invoke(Method.java:606)
>
> at
> org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(Simpl
> eDBExtension.java:50)
>
> ... 3 more
>
> Caused by: org.apache.axis2.schema.SchemaCompilationException: XSD 
> complexType with mix content not supported in ADB
>
> at
> org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompil
> er.java:1166)
>
> at
> org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(S
> chemaCompiler.java:1092)
>
> at
> org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.ja
> va:1002)
>
>at
> org.apache.axis2.schema.SchemaComp

using wsdl2java fails Migrating from AXIS to AXIS2

2016-09-27 Thread Dinshaw, Afshad
Hello,

Currently we are using the axistools-maven-plugin 1.4 to generate java 
stubs/classes etc from our WSDL (which I have modified for privacy and 
attached).
The plugin is being used in our pom.

We need to move to AXIS2.
The first thing im trying to do is use your CLI tool wsdl2java (downloaded 
from: http://axis.apache.org/axis2/java/core/download.html) to generate the 
stubs/classes successfully.
However I am confused which option to use?
ADB/XmlBeans/JBIX ??

How would I know? AXIS did not have all these options.

I tried each of these options and got different errors all related to schema 
validation. However before I get into those error Id like to find out which 
option I should use based on my existing WSDL.

Thank you,

Afshad Dinshaw

Some of the errors I get are like:

C:\Temp\axis2\axis2-1.7.3\bin>wsdl2java -uri C:\ temp\uhvnet.wsdl  -d adb -s
Using AXIS2_HOME:   C:\Temp\axis2\axis2-1.7.3
Using JAVA_HOME:C:\Program Files\Java\jdk1.7.0_79
Retrieving document at 'C:\ temp\uhvnet.wsdl '.
Retrieving schema at 'http://www.w3.org/2003/05/soap-encoding', relative to 
'file:/ C:/ temp/uhvnet.wsdl '.
Retrieving schema at 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd',
 relative to 'file:/ C:/ temp/uhvnet.wsdl '.
Retrieving schema at 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd',
 relative to 'file:/ C:/ temp/uhvnet.wsdl '.
Retrieving schema at 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd',
 relative to 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xs
d'.
Retrieving schema at 
'http://www.w3.org/TR/xmldsig-core/xmldsig-core-schema.xsd', relative to 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
Retrieving schema at 'http://www.w3.org/2001/xml.xsd', relative to 
'http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd'.
log4j:WARN No appenders could be found for logger 
(org.apache.axiom.locator.DefaultOMMetaFactoryLocator).
log4j:WARN Please initialize the log4j system properly.
Exception in thread "main" 
org.apache.axis2.wsdl.codegen.CodeGenerationException: 
java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:294)
at org.apache.axis2.wsdl.WSDL2Code.main(WSDL2Code.java:50)
at org.apache.axis2.wsdl.WSDL2Java.main(WSDL2Java.java:24)
Caused by: java.lang.RuntimeException: 
java.lang.reflect.InvocationTargetException
at 
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:53)
at 
org.apache.axis2.wsdl.codegen.CodeGenerationEngine.generate(CodeGenerationEngine.java:247)
... 2 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at 
org.apache.axis2.wsdl.codegen.extension.SimpleDBExtension.engage(SimpleDBExtension.java:50)
... 3 more
Caused by: org.apache.axis2.schema.SchemaCompilationException: XSD complexType 
with mix content not supported in ADB
at 
org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1166)
at 
org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1092)
at 
org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:1002)
   at 
org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:752)
at 
org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:565)
at 
org.apache.axis2.schema.SchemaCompiler.processElements(SchemaCompiler.java:2474)
at 
org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:2150)
at 
org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:2035)
at 
org.apache.axis2.schema.SchemaCompiler.processComplexType(SchemaCompiler.java:1162)
at 
org.apache.axis2.schema.SchemaCompiler.processNamedComplexSchemaType(SchemaCompiler.java:1092)
at 
org.apache.axis2.schema.SchemaCompiler.processSchema(SchemaCompiler.java:1002)
at 
org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:752)
at 
org.apache.axis2.schema.SchemaCompiler.processElement(SchemaCompiler.java:565)
at 
org.apache.axis2.schema.SchemaCompiler.processElements(SchemaCompiler.java:2474)
at 
org.apache.axis2.schema.SchemaCompiler.process(SchemaCompiler.java:2150)
at 
org.apache.axis2.schema.SchemaCompiler.processParticle(SchemaCompiler.java:2035)
at