aspose file tools*
The moose likes Web Services and the fly likes Request comes differently when deployed in weblogic server and when published in eclipse Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Request comes differently when deployed in weblogic server and when published in eclipse" Watch "Request comes differently when deployed in weblogic server and when published in eclipse" New topic
Author

Request comes differently when deployed in weblogic server and when published in eclipse

venky chin
Greenhorn

Joined: Jun 23, 2013
Posts: 7
Hi,

I have created sample web service in eclipse and code is as given below,

package Complex;

import java.util.HashMap;

public class MainCompany {

public HashMap<String, String> employeeTEST;
}

----------------------------------

package Complex;

import java.util.HashMap;

public class Company {
public int companyID;
public String companyName;
public String[ ] employeeNames;
public HashMap<String, String> employeeMarks;

public HashMap<String,MainCompany> StringArray;

public HashMap<String, String> getemployeeMarks(){
return this.employeeMarks;
}

public String getCompamyName(){
return this.companyName;
}

}

-----------------------------------------

package Complex;

import javax.jws.WebService;

@WebService(endpointInterface = "Complex.CompanyInf")

public class CompanyImpl implements CompanyInf{

@Override
public String getHelloWorldAsString(Company[] name) {

System.out.println(name[0].employeeMarks);
System.out.println(name[0].companyID);
System.out.println(name[0].companyName);

return "Hello World JAX-WS " + name;
}

}

------------------------------------------

package Complex;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

//Service Endpoint Interface2
@WebService
@SOAPBinding(style = Style.DOCUMENT)


public interface CompanyInf {

@WebMethod String getHelloWorldAsString(Company[] name);

}


-----------------------------------------

When i publish this in eclipse, i get the default request(which is generated in soapUI) as given below,





When i deploy the same code in weblogic using axis.jar methods(using axis.jar generated the wsdl and other methods and created jar file and deployed it in weblogic server), its giving the request as given below,
--------------------------------------------------
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:Company" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
<soapenv:Header/>
<soapenv:Body>
<urn:getHelloWorldAsString soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<in0 xsi:type="urn:ArrayOfCompany" soapenc:arrayType="urn:Company[]"/>
</urn:getHelloWorldAsString>
</soapenv:Body>
</soapenv:Envelope>


--------------------------------------------------

Can you please suggest, why this is coming differently in eclipse and when deployed in weblogic server.
Ganesh Malaichamy
Greenhorn

Joined: Feb 11, 2011
Posts: 27
Did you notice the difference between the WSDL content generated in both the ways?. Also the default settings to generate the WSDL for the both the ways could be different.
venky chin
Greenhorn

Joined: Jun 23, 2013
Posts: 7
Hi,

I have generated the wsdl and deployed following the below steps,

1) generate WSDL using

java -classpath <CLASSPATH> org.apache.axis.wsdl.Java2WSDL -o Complex.wsdl -l <URL> -n urn:Company -p"Complex=urn:Company" Complex.CompanyInf

2) Generate the Server-side Wrapper Code and Stubs

java -classpath <CLASSPATH> org.apache.axis.wsdl.WSDL2Java -o . -d Session -s -p Complex.ws Complex.wsdl

3) Compiled the generated files

4) Build Jar files

5) Copied the jar file to WEB-INF/lib and WSDL file to WEB-INF/classes folder

6) restarted the weblogic stack

7) Deployed using below command,
java -classpath <CLASSPATH> org.apache.axis.client.AdminClient -l<SERVICES URL> deploy.wsdd

Note:deploy.wsdd is generated in step2

Not sure what was the WSDL file generated in eclipse.

Please suggest if there is any other way of generating wsdl file, so that its in correct format(similar to what i have seen in eclipse).
Ganesh Malaichamy
Greenhorn

Joined: Feb 11, 2011
Posts: 27
Are you facing any issue in consuming the web-service hosted in weblogic. Via Soap or Java Client.You coud do *.wsdl search in the eclipse path and find the difference between the wsdl.The name space prefixing will differ for tools generating the request
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Request comes differently when deployed in weblogic server and when published in eclipse
 
Similar Threads
Web Service - Complex Types - Array Inside Array.
juddiv3 (3.0.4) finding all business/services
Jws context - getInputHeaders
soapUI 4.0 question
webservice calling from url