This week's giveaway is in the Spring forum.
We're giving away four copies of Microservices Testing (Live Project) and have Chris Love & Andres Sacco on-line!
See this thread for details.
Win a copy of Microservices Testing (Live Project) this week in the Spring forum!

Ajoo Bar

Ranch Hand
+ Follow
since Mar 28, 2011
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ajoo Bar

Hi,
I am trying to use ant to compile a wsdl file. It works fine if I have a single WSDL file. But if I have a wsdl file which is referencing an wsdl interface and XSD files, the below script doesn't generate all the required stubs.


<project name="TestWSDL" default="codegen" basedir=".">

<path id="axis2.classpath">
<fileset dir="C:\axis2\axis2-1.2\axis2-1.2\lib">
<include name="**/*.jar" />
</fileset>
</path>

<target name="codegen">

<taskdef name="axis2-wsdl2java"
classname="org.apache.axis2.tool.ant.AntCodegenTask"
classpathref="axis2.classpath"/>

<axis2-wsdl2java
wsdlfilename="C:\_Temp\AxisTest\wsdl\myfirst.wsdl"
output="C:\_Temp\AxisTest\CompiledCode" />
</target>

</project>

Thanks
Ali
7 years ago
Hi Team,
I need some help on writing some code or give me some guidence on this requirement. This is what my requirement. I have to build an XML file and store it in the table. I have created a table which has a column as CLOB. This is where I want to store this file. Below is the piece of code which generated the XML and stores it in the tempory folder

File tmpFile = new File(longFilename);
FileOutputStream fos = new FileOutputStream(tmpFile);
System.out.println("File Name is " +tmpFile);

MYXmlSaxBuilder myXmlSaxBuilder = new MyXmlSaxBuilder(_pos, ec);
myXmlSaxBuilder.buildAndWriteDocument(fos);
System.out.println("Temporary File contents are " +fos.toString());
fos.close();

From here onwards what I need is to store this xml file into Database table along with some other columns.

My First question :- How to store this XML file into table? Please keep in mind I also need to read it later. so that I can create a single XML from different xmls
SAMPLE
Single XML---
<?xml version="1.0" encoding="UTF-8"?>
<po_details>
<po_hdrs>
<company_id>1234</company_id>
<po_number>PO111</po_number>
<SAP_id>134567</SAP_id>
</po_hdrs>
</po_details>

2nd question is how to read it and combine it in a single file.

COMBINED XMLs
<purchase_orders>
<po_set>
<po_details>
<po_hdrs>
<company_id>1234</company_id>
<po_number>PO111</po_number>
<SAP_id>134567</SAP_id>
</po_hdrs>
</po_details>
<po_details>
<po_hdrs>
<company_id>1774</company_id>
<po_number>PO166</po_number>
<SAP_id>134567</SAP_id>
</po_hdrs>
</po_details>
</po_set>
</purchase_orders>

Table
CREATE TABLE XMLTABLE
(
PO_NUMBER NUMBER(12) NOT NULL,
XMLFile CLOB,
STATUS VARCHAR2(10 CHAR) NOT NULL,
DESCRIPTION VARCHAR2(256 CHAR),
CREATION_DATE DATE NOT NULL,


);


Thanks
Ali
8 years ago
Hi,

I am having issue sending huge documents usign SOAP request. The service I am calling has some data and array of Files. The files are transferred as byte array. I am using Axis2. Here is what is happening. If a request has no attachment or attachment with a size of say 100K, it works fine. If the size is huge when I make a request to websercice, it takes 2 to 3 mins to get response back; also on other side they don’t get a request immediately. Can someone guide me what could be the reason,

<dom:documents>
<!--Optional:-->
<dom:fileContent>cid:10187760028</dom:fileContent>
<!--Optional:-->
<dom:documentName>?</dom:documentName>
<!--Optional:-->
<dom:type>?</dom:type>
<!--Optional:-->
<dom:format>?</dom:format>
<!--Optional:-->
<dom:notes>?</dom:notes>
</dom:documents>
<!--Optional:-->


Thanks
8 years ago
Hi,
I have a requirement to create a CSV file using this open source package au.com.bytecode.opencsv.CSVWriter;

Here is what my requirement is:
1) Retrieve User information from database. I get it in the Java Bean object:- I have done this part here is the sample code
List<BusinessUser> users = usedao.getUsers();
//CSVWriter writer = new CSVWriter(new Writer("path"), "|" );
if (users != null && users.size() > 1) {
Iterator<BusinessUser> it = users.iterator();
while (it.hasNext()){
BusinessUser bu = it.next();
// Test
String loginName = bu.getLoginName();
String firstName = bu.getFistName();
String lastName = bu.getLastName();

}

}
2) public void createHeaderToCSVFile(){
// Header name are" Login Name", "First Name" "Last Name".... there are more colums, but to make it easy for the post I have included only 3 columns
}

3) public void writeRowToCSVFile(){

}

Can someone please help me on this. I need to use | delimeter.

Thanks
9 years ago
Hi,

Can someone please reffer me to some tutorial which explains how I can create a Restful webservice in SoapUI.
Here is what I am trying to do.

1) Create Resful webservice using SoapUI which will send a response back as xml.
2) Create a request in SoapUI to call that webservice

Thanks
Ajoo
10 years ago
Hi,

I am getting this error when I try to generate stubs using maven plugin. It worked fine earlier on my other computer. Can someone help me on this please.

Thanks
Ajoo

C:\Product\CCM\UER\CCM_Exits_mycompanyHealth_Local\target\generated-sources\main\
java\com\mycompany\ws\CahContractService\_2012_01_03\cahcontractservice_V1\CahCon
tractServiceSOAPBinding_V1_0Stub.java:[430,30] inconvertible types
found : java.lang.Throwable
required: com.mycompany.ws.Common._2010_11_19.exceptionbasetype_V1.BusinessExcept
ionType

C:\Product\CCM\UER\CCM_Exits_mycompanyHealth_Local\target\generated-sources\main\
java\com\mycompany\ws\CahContractService\_2012_01_03\cahcontractservice_V1\CahCon
tractServiceSOAPBinding_V1_0Stub.java:[431,118] inconvertible types
found : java.lang.Throwable
required: com.mycompany.ws.Common._2010_11_19.exceptionbasetype_V1.BusinessExcept
ionType


[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.BuildFailureException: Compilation failure
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:579)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi
fecycle(DefaultLifecycleExecutor.java:499)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkProjectLifecy
cle(DefaultLifecycleExecutor.java:924)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.forkLifecycle(Def
aultLifecycleExecutor.java:762)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:529)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandalone
Goal(DefaultLifecycleExecutor.java:512)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau
ltLifecycleExecutor.java:482)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan
dleFailures(DefaultLifecycleExecutor.java:330)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen
ts(DefaultLifecycleExecutor.java:227)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi
fecycleExecutor.java:142)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)

at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation fail
ure
at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler
Mojo.java:516)
at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi
nManager.java:451)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa
ultLifecycleExecutor.java:558)
... 20 more
[INFO] ----------------------------------------
10 years ago
Thanks, can you please explan what that mean, sorry I am new to webservices. I'm not able to identify how to do a basic webserice authentication.

Cheers
10 years ago
Hi,

Can someone explain me what the difference is between SOAP header and Http Header. Can I use any of these two to do basic HTTP authentication. I'm using a Java Client for sending Webserce request.

When I opened a WSDL which my client sent me in soapUI, I this in the header of that SOAP. How do I set the header information?

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:polh="http://ws.pol.com/PolContractService/2012-01-03/Polcontractservice_V1_0" xmlns:sec="http://ws.pol.com/IBC/2010-11-19/securitybasetype_V1" xmlns:mes="http://ws.pol.com/IBC/2010-11-19/messagecontextbasetype_V1" xmlns:man="http://ws.pol.com/PolContractService/2012-01-03/managecontractrequest_V1" xmlns:con="http://ws.pol.com/Common/2012-01-05/contractbasetype_V1">
<soapenv:Header>
<polh:headerContextParameters>
<securityContextParameters>
<sec:usernameToken>
<sec:userName>?</sec:userName>
<sec:password>?</sec:password>
</sec:usernameToken>
</securityContextParameters>
</polh:headerContextParameters>
</soapenv:Header>

Thanks
Ajoo
10 years ago
Hi Rahul,

DId you find a solution for this? I have a smilar requirement but it is for SOAP. My requirement is to have a basic authentication. When I opened a wsdl in SOAP UI this is what I have in header. Please let me know if you find any solution

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:polh="http://ws.pol.com/PolContractService/2012-01-03/Polservice_V1_0" xmlns:sec="http://ws.pol.com/IBC/2010-11-19/securitybasetype_V1" xmlns:mes="http://ws.pol.com/IBC/2010-11-19/messagecontextbasetype_V1" xmlns:man="http://ws.pol.com/PolService/2012-01-03/managecontractrequest_V1" xmlns:con="http://ws.pol.com/Common/2012-01-05/contractbasetype_V1">
<soapenv:Header>
<polh:headerContextParameters>
<securityContextParameters>
<sec:usernameToken>
<sec:userName>?</sec:userName>
<sec:password>?</sec:password>
</sec:usernameToken>
</securityContextParameters>
</polh:headerContextParameters>
</soapenv:Header>

Thanks"
Ajoo
10 years ago
Hi Guys,

How do we do basic authentication for webservices using Axis1.2. I found this code on one of the threads(http://wso2.org/library/161). I cant see this HttpTransportProperties.BasicAuthentication class.

My client code looks like

Thanks
Ajoo
10 years ago
Ok, I got this working now, I have a question where do I use StockQuoteServiceSOAP11BindingStub stub class?

System.out.println("Testing Webservice");
StockQuoteServiceSOAP11BindingStub stub;
StockQuoteServiceLocator stockServiceLocator = new StockQuoteServiceLocator();
StockQuoteServicePortType portType = (StockQuoteServicePortType)stockServiceLocator.getStockQuoteServiceSOAP11port(portAddress);
double price = portType.getPrice("ABC");

System.out.println("Price is "+price);
10 years ago
Hi,

I generated stubs from this wsdl file StockQuoteService.wsdl (See a attached text WSDL file), I need to write client so that I can make a call to end point URL. I have created a mock service in the SOAP UI. http://localhost:8080/axis2/services/StockQuoteService. Can someone help me here to write client code. I have attached all stub java classes.


This is what I wrote, what I am doing wrong here.


WSDL File
10 years ago
Hi Guys,
I'm new to webservices. I'm trying to setup a webservices plugin into eclipse. I'm using Eclipse Helios Service Release 2 version 3.6.2. I'm following this tutorial http://wso2.org/library/1719#ServiceArvhiver. WHen I add pache Axis2 Service Archive Generator Wizard – Eclipse Plugin and Apache Axis2 Code Generator Wizard - Eclipse Plugin plugins(http://axis.apache.org/axis2/java/core/tools/index.html) I dont see them appear in my eclipse. I manually also copied 2 jars in the plugin folder but without luck

Can some one help me on this please.

Ajoo
10 years ago
Hi,
I am using Axis1.2 on my project, I have a requirement where I need to updates some information through webservices, I have been asked to use Apchewss4j1.5 user name token profile for Authentication.

Can someone give me some pointers how I should start it and from where? I need to create a POC first. Client will provide me a wsdl file. Right now I dont know what the wsdl looks like. Do I need ask specific questoins regarding authentication to client?

Ajoo

10 years ago

String Message1 = "My Name is &1 and my Last Name is &2 \n";

I need to go though the above sting and look for any &, once I get it I then need to create a key of that forexample Ampersand.&1. How can I do that. My aim is to read generate a key and then read it value from property file. I should be genaric, so that in future if I decide to have a third &3, all I need to do is to add it to property file.

Property File.
Ampersand.&1= first_name
Ampersand.&2=last_name

Thanks
Ajoo
10 years ago