- Developing a Service which asks for UserName Token from client using Auth.xml Policy
- Publishing EJB3.0 Stateless Session Bean as a JAX-WS WebService
- Apache XMLBeans In WebLogic WebService
- Complex Types In JAXWS
- Fetching HttpHeaders inside JAXWS WebService
- How to build a WebLogic WebService from a WSDL?
- UserName Token In JAXWS WebService
- JAXWS with Wssp1.2-2007-Https-UsernameToken-Plain.xml Policy
- JAXRPC Service with WLJmsTransport
- JAXWS SOAPFault Handling
- JAXRPC SOAPFault Handling
- Sending Attachments to JAXRPC WebService
- Building JMS Based WebService using Top to Bottom Appraoch
- Changing Context-Root for JAXWS Ejb bases WebService
- Debugging WebLogic WebService Using SOAPUI
- Creating JAXWS Service in WebLogic Workshop
- Creating a JAXWS ComplexType WebService Using Top to Bottom Approach
- SOAP Attachment using JAXWS Style of WebService
February 9th, 2010 on 6:41 am
Jay,
I have got many feedback from your end and certainly one of your fans of recent times. 🙂
Can you illustratively explain how can we use Apache HTTP Server 2.2 as a proxy server in a weblogic cluster environment.
I am using WL 10.3, and using Linux O/S
I have a clustered environment that has the back-end business deployed and a single server in a different domain that connects to that cluster. This single server hosts the web-application.
Would you please find some time to help me?
February 10th, 2010 on 4:26 am
Hi Subh,
Please try following the below mentioned steps…
Step1). Download Apache Web server version 2.0 or later.
Step2). Copy the libproxy_61.so file from the BEA_HOMEserverpluginlinuxi686libproxy_61.so directory to the APACHE_HOMEmodules directory.
Step3). Open the httpd.conf file from the APACHE_HOMEconf directory, and add the following at the end of this file:
Step4). LoadModule weblogic_module moduleslibproxy_61.so
Step5). Now you have two options to target the Cluster via Proxy
<IfModule mod_weblogic.c>
WebLogicCluster server1Address:port,server2Address:port
DebugConfigInfo ON
MatchExpression *.jsp
MatchExpression *.xyz
</IfModule>
Step6). Run the Apache.exe file from APACHE_HOMEbin.
Step7). Access the following URL: http://apache_hostname:apachePort/WebLogicAppContextroot
Keep Posting 🙂
Thanks
Jay SenSharma
February 24th, 2010 on 7:46 am
Hi Jay,
I am using Oracle BPM admin Version 10.3 and the problem is from where I launch PAPI Web Service Console as am using Oracle BPM for WLS. As you knew I will not get the option of checkbox in the “BPM Web Applications” tab & “Launch PAPI Web Service Console” will be also not available inside admin center. Please help me to proceed.
Regards,
Ankur
February 24th, 2010 on 8:10 am
Hi Ankur,
I am very sorry but i am not much aware of Oracle BPM and PAPI Web Service.
Thanks
Jay SenSharma
February 25th, 2010 on 6:49 am
Its fine Jay… Thanks
February 25th, 2010 on 3:16 pm
Hi Jay,
Thanks for all the good work you are doing and keep doing..
I have a question about webservices client generation. Which one is better and why between clientgen and apache axis? We use weblogic 9.2 server.
Thanks.
February 25th, 2010 on 4:08 pm
Hi James,
Apache provided Axis APIs and WebLogic provided Clientgen both can be used to generate the WebService ClientSide Artifacts. They generate it in it’s own style. As such there is no comparision b/w these two..like which one is best.
But i will recommend that if you are planning to interact with WebService whcih is deployed on WebLogic… then Better you should always go for “CLIENTGEN”….
Because you will see many issues when we use the combination like WebLogicWebService and AXIS Client…because they uses different set of JARs..and classes. It doesn’t mean that it is very bad to use this combination….but using this combination will increase complexities…specially at the ClassLoader Level…
AXIS Apis uses different set of Parsers and WebLogic uses different Parsers…And Many times u will find these parser conflicts in WebLogic with AXIS artifacts …those conflicts can be corrected…though..better use CLIENTGEN generated artifacts….
But if you are going to implement your WebService in containeras like Tomcat…then better u should choose AXIS.
Keep Posting 🙂
Thanks
Jay SenSharma
February 25th, 2010 on 5:12 pm
Thanks Jay for your quick and detailed response…
March 15th, 2010 on 7:17 pm
Please I need help on this one really bad. We are using wls 10.3.2 on window 7/2008 r2 64bit edition.
I’m tyring to upgrade to 10.3.2 and use JAXWS instead of JAXRPC for our web services. First the migration from 10.3.0 to 10.3.2 using JAXRPC web services are good. Then tried generating server side JAXWS web services with jwsc, that went fine also. But when I tried using clientgen with type=”JAXWS” webservices to generate the client artifacts to be use by our standalone java swing client the packages of our javabeans (use as parameters and return value and just POJO) are all wrong and also those javabeans are duplicated if the javabeans are used in several web services methods that are in the different package. Let me give you an example so you can see. For ex. we have several javabeans we use as parameters and return values for our web services methods/call (the package is shown in the full name of the javabeans). (1) com.starcomsoft.pp.address.Address; (2) com.starcomsoft.pp.account.Account; (3) com.starcomsoft.pp.customer.Customer; (4) com.starcomsoft.pp.order.Order & com.starcomsoft.order.OrderItem. We have 2 EJB stateless session bean as webservices and they are com.starcomsoft.pp.customer.jws.CustomerWSImpl and com.starcomsoft.pp.order.jws.OrderWSImpl. The Customer bean has an address as one of it’s field and an Account has a Customer as one it’s field also. An Order bean has a Shipping/Billing address field and a Customer field and a Collection of OrderItems in it.
Below is the CustomerWSimpl class..
@SOAPBinding(style=SOAPBinding.Style.DOCUMENT, use=SOAPBinding.Use.LITERAL,
parameterStyle=SOAPBinding.ParameterStyle.WRAPPED)
@Stateless(mappedName = “CustomerBeanWS”)
@WebService(name = “CustomerWS”,
serviceName = “CustomerWSService”)
public class CustomerWSImpl {
@WebMethod
public Customer findCustomer(int id) { return customer;}
@WebMethod
public List findCustomers(List ids) { return List customers;}
….
}
@SOAPBinding(style = SOAPBinding.Style.DOCUMENT,
use = SOAPBinding.Use.LITERAL,
parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
@Stateless(mappedName = “OrderBeanWS”)
@WebService(name = “OrderWS”,
serviceName = “OrderWSService”)
public class OrderWSImpl {
@WebMethod
public Order findOrder(int orderId) { return order;}
…
}
When I generate the client artifacts for CustomeWSImpl using “clientgen” with type=”JAXWS”, the Address, Account, Customer bean will all have the same package. For example in this case com.starcomsoft.pp.customer.jws …, and for the OrderWSImpl – the Address, Customer, Order, OrderItem the packaging is “com.starcomsoft.pp.order.jws”. Also the Address, Customer are duplicated. I’ve tried different combination value for all the attributes of “clientgen” but to no success. I’m I missing anything on my POJO or EJB stateless Bean’s?
Below is an example of the ant task for “jwsc” and “clientgen”.
“OR this ”
Please any help or thoughts on this one is greatly appreciated
March 16th, 2010 on 4:59 am
Hi Victoria,
Don’t Use weblogic.wsee.tools.anttasks.ClientGenTask If you are using ANT build to define your Client Gen Defination.
May be at present you are using this ClientGen:
Please Use the ClientGenX Utility (This is WLS9.x Compatible Version of Clientgen NO side effects of using it) for utilizing this feature:
<taskdef name="clientgenx” classname=”weblogic.ant.taskdefs.webservices.clientgen.ClientGenTask” />
use the above clientgenx task with the attribute “useServerTypes=true”…Just give it a try…
DESCRIPTION Of useServerTypes:
Specifies where the clientgen task gets the implementation of any non-built-in Java data types used in a Web Service: either the task generates the Java code or the task gets it from the EAR file that contains the full implementation of the Web Service. Valid values are True (use the Java code in the EAR file) and False. Default value is False.For the list of non-built-in data types for which clientgen can generate data type components.
Keep Posting 🙂
Thanks
Jay SenSharma
April 1st, 2010 on 11:28 pm
Hi Jay,
Thank you again for your help and information and I also found a solution to my problem. I figure that the I’m missing something regarding annotating the POJO classes. Tried different things, but the the one that works is annotating the POJO in the class level with @XmlType. For ex. in my previous post like Order and if I want clientgen to generatate the client artifacts for the Customer with the proper package then I have to annotate the Customer class with the following…
@XmlRootElement(name=”Order”, namespace=”http://customer.pp.starcomsoft.com”)
@XmlType(name=”Order”, namespace=”http://customer.pp.starcomsoft.com”)
public class Customer {}.
The wls clientgen will generatate the proper package for the Customer class. This will work only if the Customer is just plain VO or POJO (just normal getter/setter properties and field).
I thought of sharing this information to help others who might be having the same problem like I did.
Thanks again.
March 18th, 2010 on 11:05 pm
Need to throw my own custom exception in jax-ws using WLS 10.3.2.0. This exception is usually a business or application exception and not your regular runtime exception. Your help is very much appreciated.
March 19th, 2010 on 6:22 am
Hi Victorio,
I have developed a Simple testCase for throwing the SOAPFault in JAXWS …please have a look on: http://jaysensharma.wordpress.com/2010/03/19/jaxws-soapfault-handling/
Keep Posting 🙂
Thanks
Jay SenSharma
April 1st, 2010 on 11:48 pm
I have a question regarding using java enum class as both parameters and return value for my jaxws web service. I found out that you can use java enum but there is a caveat to this one (so far). When creating a client artifacts with clientgen, the generated java enum is a very simple enum (just the enum type) and not with custom field and constructor. Let me give an example, if I have a java enum for order statuses called Status …
@Xmltype(name=”StatusEnum”, namespace=”http://constants.pp.starcomsoft.com”)
public enum StatusEnum {
STATUS_ACTIVE(1, “Active Order”),
STATUS_CLOSE(10, “Closed Order”),
STATUS_PENDING(2, “Pending Order”),
STATUS_CANCEL(-1, “Cancelled Order”);
private final int code;
private final String description;
private Status(int code, String description) {
this.code = code;
this.description = description;
}
public int getCode() {return code;}
public String getDescription() {return description;}
}
When the clientgen generated the artifacts for Status enum, it just a plain Status enum without the custom fields and constructor and custom properties. Let me show you below what I mean.
XmlType(name = “StatusEnum”, namespace = “http://constants.pp.starcomsoft.com”)
@XmlEnum
public enum StatusEnum {
STATUS_ACTIVE,
STATUS_CLOSE,
STATUS_PENDING,
STATUS_CANCEL;
public String value() {
return name();
}
public static StatusEnum fromValue(String v) {
return valueOf(v);
}
}
I tried all sorts of annotation and no success. The only work around so far, is just overwrite the clientgen generated artifacts with my own StatusEnum that has the custom field, properties and constructor so I can actually use it in my client swing properly. This is ok only if you have very few java enum, but in our case we have about at least 30 jave enum. Do you know if my need is even possible right now in wls jaxws? Your help is very much appreciated.
April 2nd, 2010 on 5:29 pm
Hi Jun,
I am also observing the same behavious as yours. So far i didn’t find any workaround to get rid of this…i tried with my testCase as well…And i can see that the Methods are not getting generated in the ClisntSide Artifacts for our Enums after ClientGen task.
Checking some other alternatives for this.
Thank you for sharing your findings for Generating the Packages according to ServerSide artifacts … on the client side with the same package structure… Jun Can u provide me a TestCase if you have for the Same…I am facing some issues while using @XmlTypes…That wll be very helpful…
.
Keep posting 🙂
Thanks
Jay SenSharma
April 6th, 2010 on 12:10 am
Hi there,
I have an integration web service question. Calling a .net/c# web services and retrieving and pushing data thru that web service. And the other way around is exposing my weblogic web service so that a .net/c# web service or application can also retrieve data and push data in my system. I couldn’t find any information on the oracle site about weblogic integration with .net frameworks. The business case is we are trying to integrated with Great Plains system via web services. I just don’t understand it, i thought web services are standard and language neutral, yet I can’t seem to find any information regarding this things. So any info or help is very much appreciated.
May 20th, 2010 on 8:52 am
We found out that in Weblogic 10.3.0 the current JAX-WS version is 2.1.4. That one contains the bug
https://jax-ws.dev.java.net/issues/show_bug.cgi?id=807
which should be fixed in 2.2.1.
Is it possible to switch the JAX-WS to a newer one?
Which version of Metro is implementet in WLS 10.3.0?
Which versions of JAX-WS and Metro are in WLS 10.3.2?
Could you please help me with this?
May 20th, 2010 on 9:03 am
Hi Kunjan,
You won’t find any document in Oracle Docs/BEA Docs which tells that which Version of Metro is supported with WebLogic….because so far there is no declaration on that.
It’s basically a Sun’s Implementation. Many Users face issues with Metro-WLS combination. I dont think it’s going to work…soon until Oracle Provides a clear RoadMap on that.
.
.
Thanks
Jay SenSharma
May 20th, 2010 on 11:25 am
Hi Kunjan,
Regarding your Query: Which version of Metro is implementet in WLS 10.3.0?
WebLogic doesnt have any Implementation of Metro. It’s basically Sun’s implementation. And the Jars related to Metro APIs…DOES NOT Ship with WebLogic Installation.
.
.
Thanks
Jay SenSharma
July 27th, 2010 on 9:24 pm
Hello Jay, can u help me with this issue that im having with my stand alone WS client
Client jars generated with:
clientgen wsdl=”http://${wls.admin.server.host}:${wls.admin.server.port}/activacion/ActivacionWebServices?WSDL”
destDir=”${dest.dir}/ActivacionClient”
classpath=”${java.class.path},${app-inf.dest.classes}”
packageName=”com..activacionbb.webservice.cliente”
First i have this error:
Exception in thread “main” java.lang.ExceptionInInitializerError
at weblogic.wsee.ws.init.WsDeploymentChain.newClientChain(WsDeploymentChain.java:24)
at weblogic.wsee.ws.WsFactory.callClientListeners(WsFactory.java:113)
at weblogic.wsee.ws.WsFactory.createClientService(WsFactory.java:46)
at weblogic.wsee.jaxrpc.ServiceImpl.init(ServiceImpl.java:149)
at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:117)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
.
.
.
I solved this issue with my classpath adding some jars like (client jar generated, weblogic.jar, wseeclient.jar etc)
But now i have this error
Exception in thread “main” java.lang.NoClassDefFoundError: com/bea/xml/XmlException
at weblogic.wsee.wsdl.WsdlTypes.parse(WsdlTypes.java:161)
at weblogic.wsee.wsdl.WsdlDefinitions.parseChild(WsdlDefinitions.java:502)
at weblogic.wsee.wsdl.WsdlExtensible.parse(WsdlExtensible.java:98)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:450)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:402)
at weblogic.wsee.wsdl.WsdlDefinitions.parse(WsdlDefinitions.java:388)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:78)
at weblogic.wsee.wsdl.WsdlFactory.parse(WsdlFactory.java:65)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWsdlDefinition(ServiceImpl.java:468)
at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:114)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
at com.activacionbb.mq.Despachador.(Despachador.java:29)
at com.activacionbb.mq.Despachador.main(Despachador.java:54)
I made some google but cant find the jar for com/bea/xml/XmlException in Weblogic 10.0MP2
Do u know how can i solve this issue? Thanx in advance!
July 27th, 2010 on 9:49 pm
Hi Mauro,
If you are using WLS10.3 then please add the following Jar in the CLASSPATH:
C:bea103modulescom.bea.core.xml.beaxmlbeans_1.0.0.0_2-4-0.jar
If you are using WLS10 MP1 …then add the following Jar in the classpath
D:beabea100modulescom.bea.core.xml.beaxmlbeans_2.2.0.0.jar
If you are using WLS10.3.1 or WLS10.3.2 …then add the following Jar in the classpath
E:bea10_3_2modulescom.bea.core.xml.beaxmlbeans_1.1.0.0_2-4-1.jar
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 27th, 2010 on 10:16 pm
Thanx for reply…. that jar help me to solve the issue but now this is the problem :_
Inicializando Despachador
Exception in thread “main” javax.xml.rpc.ServiceException: Failed to load weblogic client internal deployment descriptor. java.io.IOException
at weblogic.wsee.jaxrpc.ServiceImpl.throwServiceException(ServiceImpl.java:169)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWeblogicDD(ServiceImpl.java:441)
at weblogic.wsee.jaxrpc.ServiceImpl.loadInternalDD(ServiceImpl.java:377)
at weblogic.wsee.jaxrpc.ServiceImpl.(ServiceImpl.java:116)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
at com.activacionbb.webservice.cliente.ActivacionWebServices_Impl.(Unknown Source)
at com.activacionbb.mq.Despachador.(Despachador.java:30)
at com.activacionbb.mq.Despachador.main(Despachador.java:56)
Caused by: java.io.IOException
at weblogic.descriptor.internal.MarshallerFactory.(MarshallerFactory.java:50)
at weblogic.descriptor.BasicDescriptorManager.getMarshallerFactory(BasicDescriptorManager.java:131)
at weblogic.descriptor.BasicDescriptorManager.getDescriptorFactory(BasicDescriptorManager.java:159)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:227)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:197)
at weblogic.descriptor.BasicDescriptorManager.createDescriptor(BasicDescriptorManager.java:182)
at weblogic.wsee.jaxrpc.ServiceImpl.loadWeblogicDD(ServiceImpl.java:435)
… 6 more
Caused by: com.bea.xml.XmlException: unable to load type library from classloader sun.misc.Launcher$AppClassLoader@a9c85c
at com.bea.staxb.runtime.internal.BindingContextFactoryImpl.createBindingContext(BindingContextFactoryImpl.java:50)
at weblogic.descriptor.internal.MarshallerFactory.(MarshallerFactory.java:48)
… 12 more
To test the connection i made a main in the class that call the WS
public static void main(String[] args) throws ServiceException, RemoteException, SOAPCustomException {
System.out.println(“Inicializando Despachador”);
Despachador despachador = new Despachador();
despachador.testmethod();
System.out.println(“Fin del metodo test”);
}
Despachador.java:30 is the line i show with the arrow (also just to show u i put the url of the WSDL inside, i load from a parameter)
public Despachador() throws ServiceException {
== LINE 30 ==> service = new ActivacionWebServices_Impl(“http://localhost:7101/activacion/ActivacionWebServices?WSDL”);
== LINE 31 ==> port = service.getActivacionWebServicesPort();
}
When i use the entire program to test with a complete cycle i get the same issue… but with a bigger stacktrace 😛
Can u help me with this? I made the WS time ago and works fine i dont know why im having problems now.
Thanx a lot Jay
July 27th, 2010 on 10:49 pm
Hi Mgaldames,
There are many informations needed to understand the cause of this issue…like:
1). Is this JAXWS or JAXRPC WebService (It looks like JAXRPC to me but not sure)
2). Are u using XMLBeans inside your WebService?
3). Which version of WLS are u using?
4). Have u recently upgraded your WebService stuff from any previous version of WebLogic?
5). What changes recently u have made inside your WebService Methods?
6). Are u getting Error oly on client side or on WebLogic Server Side as well.
It will be really much helpful if you can give me a TestCase…if possible.
Right now i will recommend … Please run “. ./setWLSEnv.sh” or “setWLSEnv.cmd” in a fresh command window first then try to run the client.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 28th, 2010 on 12:22 am
Thanx for reply, i give u the informations
1) Its a JAXRPC WS
@WebService(name=”ActivacionWebServicesPortType”, serviceName=”ActivacionWebServices”)
@SOAPBinding(style=SOAPBinding.Style.RPC,use=SOAPBinding.Use.LITERAL)
@WLHttpTransport(contextPath=”ws_activacion”, serviceUri=”ActivacionWebServices”, portName=”ActivacionWebServicesPort”)
The contextPath is overwrited with a contextPath i put in the build.xml
module contextPath=”activacion” name=”ActivacionWS”
2)I dont use XMLBeans, i dont even know what xmlbeans are T_T
3) Im using WLS 10.0 MP2 in my macbook
4) Not, i didnt upgrade WLS
5) I didnt make changes in my WS methods, i just update other classes to call some stored procedures in oracle
6) The errors are Just for the client side… when is doing this thing:
private static String wsdlActivacion = “http://localhost:7101/activacion/ActivacionWebServices?WSDL”;
//In the next line is when i get exception
ActivacionWebServices service = new ActivacionWebServices_Impl(wsdlActivacion);
ActivacionWebServicesPortType port = service.getActivacionWebServicesPort();
This could be a test case
WS CODE
package com.activacionbb.ws;
import java.sql.SQLException;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.xml.namespace.QName;
import javax.xml.rpc.soap.SOAPFaultException;
import javax.xml.soap.Detail;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPFactory;
import com.activacionbb.exception.SOAPCustomException;
import weblogic.jws.WLHttpTransport;
@WebService(name=”ActivacionWebServicesPortType”, serviceName=”ActivacionWebServices”)
@SOAPBinding(style=SOAPBinding.Style.RPC,use=SOAPBinding.Use.LITERAL)
@WLHttpTransport(contextPath=”ws_activacion”, serviceUri=”ActivacionWebServices”, portName=”ActivacionWebServicesPort”)
public class ActivacionBlackBerryWebServices {
@WebMethod()
public void testMethod(int num, String msg) throws SOAPCustomException {
System.out.println(“Number: ” + num + “, Msg: ” + msg);
log.info(“Number: ” + num + “, Msg: ” + msg);
switch (num) {
case 2:
log.info(“Caso 2, arrojo un SOAPCustomException”);
throw new SOAPCustomException(“SERV001”, “Testing error de servidor”);
case 3:
log.info(“Caso 3, arrojo un SOAPCustomException”);
throw new SOAPCustomException(“Client.001”, “Testing error de Cliente”);
case 1:
Detail detail = null;
try {
detail = SOAPFactory.newInstance().createDetail();
detail.addTextNode(“Opcion escogida es la 1 entonces arrojo SOAPFaultException”);
} catch (SOAPException e) {
log.info(“En Caso 1 falla hacer un Detail, arrojo un SOAPCustomException”);
throw new SOAPCustomException(“SEREX001”, “Error creando elemnto detail”);
}
log.info(“Caso 1, arrojo un SOAPFaultException”);
String faultString = “Numero que has digitado es ” + String.valueOf(num);
throw new SOAPFaultException(new QName(“env.Server”), faultString, “Sin Actor”, detail);
}
}
}
CLIENT CODE
package com.activacionbb.mq;
import java.rmi.RemoteException;
import javax.xml.rpc.ServiceException;
import org.apache.log4j.Logger;
import com.activacionbb.exception.SOAPCustomException;
import com.activacionbb.webservice.cliente.ActivacionWebServices;
import com.activacionbb.webservice.cliente.ActivacionWebServicesPortType;
import com.activacionbb.webservice.cliente.ActivacionWebServices_Impl;
public class Despachador {
private static String wsdlActivacion = “http://localhost:7101/activacion/ActivacionWebServices?WSDL”;
private Logger log = Logger.getLogger(this.getClass());
private ActivacionWebServices service;
private ActivacionWebServicesPortType port;
public Despachador() throws ServiceException {
service = new ActivacionWebServices_Impl(wsdlActivacion);
port = service.getActivacionWebServicesPort();
}
public void testmethod() throws RemoteException, SOAPCustomException {
log.info(“Test Method”);
port.testMethod(2, “test desde el cliente”);
}
public static void main(String[] args) throws ServiceException, RemoteException, SOAPCustomException {
System.out.println(“Inicializando Despachador”);
Despachador despachador = new Despachador();
despachador.testmethod();
System.out.println(“Fin del metodo test”);
}
}
Hope this could help u to help me 😛
Thanx Jay
July 28th, 2010 on 2:04 pm
Hi Mauro,
Based on your information i developed a Similar testcase. Please download it from : http://www.4shared.com/file/e8WtqciF/Mauro_SoapFault.html
All u need to do is Just change the Post Number/ Username/password/ServerName in the Ant Script and then run the Ant. It worked for me. Please let us know if you see something different in My TestCase…
I have attached a Screenshot of SOAP Envelope as well inside the ZIP and couple of “soapMessages”.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 29th, 2010 on 8:49 am
Jay i havent test ur test case yet… i can tell u that i solved my problem… its a classpath problem… i dont know what… but from the last error i posted u i have to unzip the wseeclient.zip and there are like 46 jars inside… i put all of those jars in the eclipse build path of my project then i dont know why said that ant class not found… so i put the ant.jar in the classpath and all works ok… but i dont think i need all those jars…
Can u teach me about jars that are necesary to run weblogic webservices in a stand alone client? and in some blogs said that weblogic.jar should be on top of the classpath… there is an order for jars in classpath??
Those are things that i don´t know… and would be great if u can explain to me…
Finally i will try ur test case tomorrow… thanks for all Jay!
September 1st, 2010 on 6:51 am
Hi,
I’m having a problem with my web services on WebLogic. I’m using WS-Security and the digest is computed over the SOAP Body. I’m using SOAP UI to test my web service. When there is a space (or multiple spaces) between the SOAP Body tag and the contents of the body, the digest is computed by SOAP UI including the space, however by the time I get access to the SOAP message (via a handler) that space is removed. I deployed the same application on JBoss and things work fine.
Any idea?
September 1st, 2010 on 5:57 pm
Hi Vinny_RI,
Are you facing any issue because of the spaces being removed by the SOAPHandlers? I means are u getting any kind of Call Failure or SOAPExceptions? Which version of WLS are u using ? And What kind of WebService is it? (JAXWS or JAXRPC).
If it is happening with Simple WebServices as well then i will try to reproduce it at my end for further investigation.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
September 2nd, 2010 on 6:24 am
Hi Jay,
Thanks for the reply. I’m using WLS 10.3 “out-of-the-box” and I’ve deployed a JAXWS webservice. The issue that I have is that when I attempt to “turn-on” WS security, the digest in the signature doesn’t match what the client sent because the client computed the digest with the spaces and the server removes that spaces before the digest is computed.
All that is needed to reproduce is to submit a soap request that contains spaces (after and befor the beginning of the SOAP body content) and output the soap message from a SOAP Handler. You will see that the spaces are removed.
simple web service:
—————
package mytest;
import javax.jws.Oneway;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.ejb.Stateless;
import javax.jws.HandlerChain;
import javax.xml.ws.BindingType;
import javax.xml.ws.soap.SOAPBinding;
@WebService()
@Stateless()
@HandlerChain(file = “handlers.xml”)
@BindingType(SOAPBinding.SOAP12HTTP_BINDING)
public class LibraryWebService {
@WebMethod(operationName = “orderBook”)
@Oneway
public void orderBook(Book6 book) {
//do something
}
}
—————
simple handler to print out request:
—————
package mytest;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPMessage;
import javax.xml.ws.ProtocolException;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPMessageContext;
public class MyHandler implements javax.xml.ws.handler.soap.SOAPHandler {
@Override
public Set getHeaders() {
return null;
}
@Override
public void close(MessageContext mc) {
}
@Override
public boolean handleFault(SOAPMessageContext mc) {
return true;
}
@Override
public boolean handleMessage(SOAPMessageContext mc) {
if (Boolean.FALSE.equals(mc.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY))) {
SOAPMessage sm = mc.getMessage();
try {
sm.writeTo(System.out);
} catch (Exception e) {
throw new ProtocolException(e);
}
}
return true;
}
}
—————
request sent:
—————-
output from handler:
—————-
—————-
Notice no space after and before
—–
Thanks!
September 2nd, 2010 on 9:27 pm
Hi Vinny_RI,
I am able to reproduce the Issue in WLS10 MP1, WLS10.3.0, WLS10.3.1 as well as in WLS10.3.2 as well. Right now i am not able to find any workaround for this issue. I am still researching. I will update you as soon as i get any useful information on this.
I think opening a Support ticket with Oracle WebLogic Support team will be a good option. But i doubt you might get an answer “It is Work As Designed”.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
February 8th, 2011 on 2:38 am
Hi ,
I am upgrading weblogic 8.1.6 web services client to oracle weblogic 10.3 while testing i am getting exception
Address Validation Service Unavailable
soapenv:Server.generalExceptionPossible cause: too many parameters; nested exception is:
org.xml.sax.SAXException: Deserializing parameter ‘arg1’: could not find deserializer for type DataTableBean[weblogic.wsee.jws.wlw.SoapFaultException]
February 9th, 2011 on 10:24 am
Hi Raja,
It’s a known issue with Oracle WebLogic when we run a service in WLS10 or above and if we generate a Service Client in WLS8.1 …then sometimes we get this error. So please contact Oracle Support the already have a patch for this. But i do not remember the Patch Number exactly.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
May 3rd, 2011 on 4:22 am
Hello there Jay… can u provide a test case with a complex type contract first soap web service and the build.xml to create the code?
And why this approach (contract first) is better than or not than the approach of create the code and then with build.xml generate de wsdl?
I used to use the last approach because i follow ur test cases in this forum.
Thanx in advance 😀
May 4th, 2011 on 4:40 pm
Hi Mauricio,
I just developed an article on Contract First WebService Development which contains Complex DataTypes using JAXWS (I used WLS10.3.0 for testing ). Please refer to the following Article:
http://middlewaremagic.com/weblogic/?p=6645
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
May 19th, 2011 on 11:56 am
Hi,
I have two machine, on one machine oracle weblogic server is installed and on another machine oracle db11g is installed. I have db table in database having column(id,name).Now whenever a new row is inserted i want to put these values in static hashMap hm(key will be id and value will be name).but this static hashmap is on weblogic server(java memory),because some other application on weblogic server is reading this hashMap.Means my oracle server should notify to weblogic server that new row is added in table.
I have spent hours looking for tutorials on Google. However I cannot seem to find anything that holds the hand,.Your help is much appreciated.
May 19th, 2011 on 5:12 pm
Hi Ramsa,
As WebLogic Server and Oracle are separate Entities and there is no common Listener available which can be used at WebLogic End to find out if there is a new record inserted in the Database Table or not. So from Database side or from WebLogic side there is no such feature available to do this specific task.
But WebLogic provides us a feature of “Job Schedulers” and “TimerManagers” which can be used to keep checking the Database table and can count it’s row if it is increment then it can notify the application the same.
WebLogic TimerManager for Scheduling Tasks : http://middlewaremagic.com/weblogic/?p=987
In Above Demo you can place your Database query to find out any new record is inserted in the table or not can be inserted: timerExpired(Timer timer)
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
June 8th, 2011 on 6:50 am
Hello Jay,
Im here again to ask for ur help, can u please make a tutorial about sending attachments to JAX-WS?
Once again, thanx for ur help
cheers!
June 12th, 2011 on 4:55 pm
Hi Mauricio,
Sorry for delay in response. We developed a simple article for Uploading some files using JAXWS Style of WebService (SOAP Attachment). Please refer to the following article: http://middlewaremagic.com/weblogic/?p=6888
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
July 16th, 2011 on 3:57 am
thanx for ur help Jay… can u admins teach me how can i make an stress test to a SOAP Web Service?
I have some web services and i want to do tests in high demand…
If u can helpo i will be grateful
Thanx in advance
–
Mauro
July 19th, 2011 on 12:37 am
Mauricio, you can use SoapUI + LoadUI.
July 19th, 2011 on 9:51 am
Hi dekoo,
Thank you for providing us the information about this great tool for load testing. I have found the reference document for Load testing from SOAPUI site which also may be very helpful:
http://www.soapui.org/Load-Testing/using-loadui-for-loadtesting.html
Magic Team shares 20 Bonus Magic Points with you for sharing a Great Stuff 🙂
.
.
Keep Sharing 🙂
Thanks
Jay SenSharma
August 3rd, 2011 on 7:26 pm
Hi Jay,
I have an issue with our web servce deployed on Weblogic Cluster. We have deployed one rws-service web service to cluster and later if i am tring to test the web service from the Testing Tab, i am getting the error like “Webpage cannot be found”. But if i click on WSDL link, it is working fine and SOAP URL also working fine. Also i am not able to find any errors in an log files. Could you please suggest some options on troubleshoot.
Regards,
Baji.
August 3rd, 2011 on 9:42 pm
Hi Baji,
Sometimes the TestClient page is not getting generated at the time of WebService deployment. So please do the following Just deploy the “wlstestclient.ear” in your WebLogic server First… This is a TestClient provided by WLS to test our WebServices:
The EAR Location is : “C:bea103wlserver_10.3serverlibwlstestclient.ear”
Once the above application is deployed access the following URL: http://localhost:7001/wls_utc and then enter the WSDL address of any webservice in the text box (Whether it is deployed on the same Server or a remote server) then you will get the test page.
This Technique we use Specially in case of Clustered and Production Env.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
August 5th, 2011 on 2:43 pm
Hi Jay,
I have deployed the wlstestclient.ear file. But as you said i tried to access the link http://localhost:7001/wls_utc but itis also giving the “Webpage cannot be found” error. But there is another link or this application like http://localhost:7001/wls_utc/begin.do which is working fine and asking for WSDL to test. If i have given any of the web service WDSL here to test it is working fine even for the WSDLs. But i am failed to understand why the “Test Client” is not working on Cluster and working on Single node(as i said even wlstestclient.ear application also has the same issue). Is there any otherway to test.
Thanks for your help.
Regards,
Baji.
August 7th, 2011 on 11:44 pm
Hi Baji Babu,
The Testclient which get generated after webservice deployment is not designed for a Clustered Environment. The testclient is simply a utility to test your webservices are designed an functioning properly o not.
So wlstestclient.ear is not intended for testing a clustered webservice. You will have to contact Oracle Support to know exactly when they are going to release a new webService test client which will have more focus on a webservice which is deployed on cluster.
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
August 8th, 2011 on 1:44 pm
Thanks Jay, I thought the same and contacted Oracle already and they suspected it may be a bug. Currently they working on it.
Anyway, thanks for clarifying my doubts Jay. New think i learned is from our last conversation is that we have wlstestclient.ear application to test web services(i don’t know it earlier 🙂 ).
Regards,
Baji.
January 31st, 2012 on 5:19 pm
Hello admins, im trying to create a ws client using clientgen task with ant for weblogic 10.2 My problem is that when i try to use type=”JAXWS” i got this error:
The ant task is:
and when i use the follow ant task i got the same error too:
If you need more info or if you need the url of the wsdl to test please tell me… but i can do it on private message.
PS. When i run the clientgen task without attribute “type” i can get the client artifacts and source.
Thanx in advance for your help.
best regards,
Mauro
January 31st, 2012 on 8:31 pm
HI Mauricio,
Are you using the Old style “ClientGen” ? I mean are you defining the ?
“taskdef” need to be defined in your “build.xml” file in order to use the latest “clientgen” (by default it will be WLS8.1 compitable clientgen which may cause some issues like above)
<taskdef name=”clientgen” classname=”weblogic.wsee.tools.anttasks.ClientGenTask” />
So please try adding the above clientgen taskdef in your Client Gen build script (if your client classpath contains WLS9.x or higher WLS Classes).
If above does not resolve the issue then If possible can you please provide us the WSDL File? (at contact@middlewaremagic.com )
.
.
Keep Posting 🙂
Thanks
Jay SenSharma
February 1st, 2012 on 12:35 am
Hello Jay, i use the clientgen task with task definition you mention above. So to be able to create the clint i use the wsimport in this way:
/System/Library/Frameworks/JavaVM.framework/Versions/1.6/Commands/wsimport -d src -keep http://localhost:port/Service.wsdl -p mypackage -B-XautoNameResolution
I wanted to create those objects with java version 1.5 but wsimport is not present in 1.5
I sent the wsdl to you via mail
thanx!!
June 12th, 2012 on 5:37 pm
Hi Jay,
I’m working on the Client Application for calling a remote WebService. I’m facing an issue when I’m trying to invoke the WebService call.
We are using Weblogic Server 10.0 MP1 version and JRockit JDK 1.5.
I have created JAX-RPC Client using ClientGen Ant Task of the Weblogic Server to generate the Client Artifacts for the WebService.
When I try to invoke the Webservice Call, I’m getting the below remote exception:-
Incoming message missing code = 1001
Remote Exception Occured: java.rmi.RemoteException: Error codes: 1001 Error code:1001; nested exception is:
weblogic.wsee.security.wss.policy.SecurityPolicyInspectionException: Error codes: 1001 Error code:1001
……
……
Caused by: weblogic.wsee.security.wss.policy.SecurityPolicyInspectionException: Error codes: 1001 Error code:1001
at weblogic.wsee.security.wss.sps.SmartPolicySelector.getSmartPolicyBlueprint(SmartPolicySelector.java:425)
at weblogic.wsee.security.wss.SecurityPolicyInspector.processMessagePolicy(SecurityPolicyInspector.java:78)
at weblogic.wsee.security.wss.SecurityPolicyConductor.processResponseOutbound(SecurityPolicyConductor.java:169)
at weblogic.wsee.security.wss.SecurityPolicyConductor.processResponseOutbound(SecurityPolicyConductor.java:141)
at weblogic.wsee.security.wssp.handlers.WssHandler.postValidate(WssHandler.java:339)
at weblogic.wsee.security.wssp.handlers.PreWssClientPolicyHandler.processResponse(PreWssClientPolicyHandler.java:59)
at weblogic.wsee.security.wssp.handlers.WssHandler.handleResponse(WssHandler.java:128)
at weblogic.wsee.handler.HandlerIterator.handleResponse(HandlerIterator.java:236)
……
……
I even tried some googling on this issue but could not find any information related to this issue
Can you help me in solving this issue?
Thanx in advance!
Thanks,
Pooja
June 12th, 2012 on 5:40 pm
Incoming message missing code = 1001
Remote Exception Occured: java.rmi.RemoteException: Error codes: 1001 Error code:1001; nested exception is:
weblogic.wsee.security.wss.policy.SecurityPolicyInspectionException: Error codes: 1001 Error code:1001
……
June 12th, 2012 on 6:03 pm
Uploading this exception details again… since it was missing few information of the exception while uploading here
<WSEE:41>Incoming message missing code = 1001<SmartSecurityPolicyBlueprint.tellMeWhy:348>
Remote Exception Occured: java.rmi.RemoteException: Error codes: 1001 Error code:1001; nested exception is:
weblogic.wsee.security.wss.policy.SecurityPolicyInspectionException: Error codes: 1001 Error code:1001
February 11th, 2013 on 11:39 am
Dear Jay/Team,
Configuration
==============
Weblogic: 10.3.6.0
JVM: IBM J9 VM build 2.4, JRE 1.6.0 IBM J9 2.4 AIX
OS: AIX 6
Heap Size: 1.5GB
We are having an issue with web service call, when we are performing load testing for online banking.
We are using Oracle Flexcube for core banking and vendor developed application for online banking, which make web service call to Flexcube.
When we are hitting with 500 web service call at a time, all the web services are not being processed at once, instead the request are being pile up some where (Not sure where) and causing the delay in processing the web service request.
I have tried the below, but it didn’t help.
1000
500
What I have observed is, only 20-30 request are being processed at a given point of time, not all.
The datasource, these web service used has max pool size of 150 and it didn’t crossed >20 at any point of time.
There is no network issue and we have confirmed these using TCP monitor.
Some where these request are being piled up but not sure where
Below is the snap shot of weblogic-ejb-jar.xml
Any help on this greatly appreciated.
Best Regards,
Sohel.
I have tried the below, but it didn’t help.
max-beans-in-free-pool 1000
initial-beans-in-free-pool 500
The above part is missing in the above comment
February 13th, 2013 on 1:25 pm
Thank you very much Rene. Creating work manager to handle the thread pool really helps.
Regards,
Syed Sohel Ahmed.
July 3rd, 2013 on 4:23 am
Hi René/Jay/Ravish,
Your site is great.It’s a wonderful place to gain knowledge.I am facing below issue with SOAP Handlers in my webservice.
I am using SOAP web service and have generated the java stubs through WSDL using apache axis with JAX-WS via ant. I want to print the request and response SOAP XML in log file as well as store them in the database.
The approach i’m following for this is mentioned below :
I added following annotation in my JWS file :
@WebService(serviceName = “EnterprisePatientService”, targetNamespace = “http://www.rxconnect.cvs.com/resi”, endpointInterface = “com.cvs.rxconnect.resi.EnterprisePatientServicePort”)
@WLHttpTransport(contextPath = “RESI/PatientService”, serviceUri = “EnterprisePatientService”, portName = “EnterprisePatientServicePort”)
@HandlerChain(file=”SimpleChain.xml”, name=”SimpleChain”)
Defined External Configuration file named(SimpleChain.xml) for handler chain :
com.cvs.rxconnect.resi.Handler1
Defined Handler Class(Handler1.java) as below to extract SOAP Message from request :
package com.cvs.rxconnect.resi;
import java.util.Collections;
import java.util.Set;
import javax.xml.namespace.QName;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPException;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.ws.handler.MessageContext;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
public class Handler1 implements SOAPHandler {
public Set getHeaders() {
return Collections.emptySet();
}
public void close(MessageContext arg0) {
// TODO Auto-generated method stub
}
public boolean handleFault(SOAPMessageContext arg0) {
// TODO Auto-generated method stub
return true;
}
public boolean handleMessage(SOAPMessageContext messageContext)
throws java.lang.RuntimeException {
Boolean outboundProperty = (Boolean) messageContext.get (MessageContext.MESSAGE_OUTBOUND_PROPERTY);
if (!outboundProperty.booleanValue()) {
System.out.println(“n Inbound Message:”);
SOAPMessage soapMessage = messageContext.getMessage();
SOAPPart soapPart = soapMessage.getSOAPPart();
try {
SOAPEnvelope soapEnvelope = soapPart.getEnvelope();
System.out.println(“Values in soapEnvelope are :” + soapEnvelope);
} catch (SOAPException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
return true;
}
}
I’m using Weblogic as Application Server.When i’m trying to build this project using JWSC ant task it gives following error:
[jwsc] [ERROR] – javax.jws.WebService.endpointInterface com.cvs.rxconnect.r
esi.EnterprisePatientServicePort is invalid.
[jwsc] C:Documents and Settingsnjain2Release10_Handlers_POCRxCWebServic
eGatewaysrccomcvsrxconnectresiEnterprisePatientServicePortImpl.java 60:8
[jwsc] [ERROR] – Handler chain file validation error for file: file:/C:/Doc
uments and Settings/njain2/Release10_Handlers_POC/RxCWebServiceGateway/src/com/c
vs/rxconnect/resi/SimpleChain.xml. C:Documents and Settingsnjain2Release10_Ha
ndlers_POCRxCWebServiceGatewayfile:C:Documents and Settingsnjain2Release10
_Handlers_POCRxCWebServiceGatewaysrccomcvsrxconnectresiSimpleChain.xml:0:
error: The document is not a handler-config@http://www.bea.com/xml/ns/jws: docu
ment element local name mismatch expected handler-config got handler-chains
[AntUtil.deleteDir] Deleting directory C:DOCUME~1njain2LOCALS~1Temp_ha4pt
BUILD FAILED
C:Documents and Settingsnjain2Release10_Handlers_POCRxCWebServiceGatewaybui
ld.xml:160: weblogic.wsee.tools.WsBuildException: JWS Validation failed.
Total time: 21 seconds
I’m not able to identify the root cause of this issue.Your help in this regard is highly appreciated.
I’m using Weblogic9.2 as Application Server.
Regards,
Neetigya
July 29th, 2013 on 10:32 pm
I am fairly new to web services on SOA Suite and want to get an understanding of how the information flows. we have some backend systems that are exposed to our system either via JDBC or EJB calls. As a middleware application we normally perform some transformations, validations and basic checks on the data to and from these systems. In the olden golden days of WebLogic Integration, we would just have Java EAO/DAO [EJB/Data access objects] classes that would perform the earlier mentioned operations on the data.
With the SOA Suite the paradigm changes quite a lot for us. I want to understand the following, using SOA Suite:
1) What’s the best way to perform the above for JDBC calls?
2) What’s the best way to perform the above for EJB calls?
3) If I were to create session beans for either or both, expose them as a web service and have the SOA Suite call those web services, would it be a reasonable solution?
4) For #3, would the session bean based web service and the SOA Suite run on the same JVM if they are located in the same Managed server?
5) For #3, how would the information flow with both session bean and SOA Suite on the same managed server – please include low level details such as http calls involving network communication or …?
Thanks for all the information you can provide.
August 12th, 2013 on 12:30 am
Hi Rene,
I have an environment with two osb nodes in cluster, when I start the Admin server the server start succesfully and the osb servers also works fine, but I got the following messages starting the managed server:
I am worried because I see in the deployment screen that the applications File Transport Provider, SFTP Transport Provider, Ftp Transport Provider and Email Transport Provider are not running.
How can I solve this issue?
My installation is osb 11.1.1.6 and my operating system is solaris 11 (64 bits)
thanks
Sanjeev