Dynamic WSDL Client troubles
First I would love a dynamic client example that actualy used the wsdl type generated by Workshop. BEA's example is using the "URN:" format not using their own format.
I havent been able to get the example dynamic client to work yet against their generated wsdl for my simple method
which has no inputs or outputs.
I am getting the following error and need help, Im not sure where to go from here.
Any pointers would be very welcome.
ERROR{
javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAP
Elementweblogic.xml.schema.binding.SerializationException: mapping lookup failur
e. class=interface javax.xml.soap.SOAPElement class context=TypedClassContext{sc
hemaType=['http://www.openuri.org/']:test}
at weblogic.webservice.core.DefaultPart.invokeSerializer(Ljavax/xml/soap
/SOAPElement;Ljava/lang/Object;Lweblogic/xml/stream/XMLOutputStream;Lweblogic/xm
l/schema/binding/SerializationContext;)V(DefaultPart.java:332)
at weblogic.webservice.core.DefaultPart.toXML(Ljavax/xml/soap/SOAPElemen
t;Ljava/lang/Object;Lweblogic/xml/schema/binding/SerializationContext;ZLjavax/xm
l/rpc/encoding/TypeMapping;)V(DefaultPart.java:297)
target service{
package testset;
* @editor-info:link autogen-style="stateless" source="TestImpl.jcs" autogen="true"
public class TestTest implements com.bea.jws.WebService
static final long serialVersionUID = 1L;
/** @common:control */
public testset.Test test;
/** @common:operation
public void test()
{ test.test(); }
Client {
public void run(String wsdl_url,String service_url,String namespace,String jws_name,String conn_port,String operation,String[] args) throws Exception {
// Setup the global SAAJ message factory
System.setProperty("javax.xml.soap.MessageFactory",
"weblogic.webservice.core.soap.MessageFactoryImpl");
// Setup the global JAX-RPC service factory
System.setProperty( "javax.xml.rpc.ServiceFactory",
"weblogic.webservice.core.rpc.ServiceFactoryImpl");
// create service factory
ServiceFactory factory = ServiceFactory.newInstance();
if (service_url.length() == 0){
service_url = "http://www.themindelectric.com/wsdl/";
if (namespace.length() == 0){
namespace = "net.xmethods.services.stockquote.StockQuote";
if (wsdl_url.length() == 0){
wsdl_url = "http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl";
if (operation.length() == 0){
operation = "getQuote";
if (jws_name.length() == 0){
jws_name = namespace+"Service";
if (conn_port.length() == 0){
conn_port = namespace+"Port";
// define qnames
String targetNamespace = service_url+namespace+"/";
QName serviceName =
new QName(targetNamespace,
jws_name);
QName portName =
new QName(targetNamespace,
conn_port);
QName operationName = new QName(targetNamespace,
operation);
URL wsdlLocation =
new URL(wsdl_url);
//new URL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
// create service
Service service = factory.createService(wsdlLocation, serviceName);
// create call
Call call = service.createCall(portName, operationName);
// invoke the remote web service
Float result = (Float) call.invoke(args);
System.out.println("\n");
System.out.println("This example shows how to create a dynamic client"+
"application that invokes a non-WebLogic Web Service.");
System.out.println("The webservice used was:"+
"http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
System.out.println("The quote for BEAS is: ");
System.out.println(result);
}
Hi,
When I add a valueChangeListener for the App selection, the method is called before the ExecuteWithParams action is run. This means that I cannot get the new value for the Table selection list. And since I never know both the value of App and the value of Table, I cannot force the dynamic table to refresh.
did you try to execute the query within the managed bean and then access the iterator to obtain the value ?
Frank
Similar Messages
-
JAX-RPC - dynamic wsdl - non-built-in data types
I thought my recent exp with developing a JAX-RPC client using a dynamic wsdl to communicate to a non-weblogic Web Service might help somebody out there. :-)
JAX-RPC Mechanism in Weblogic for dynamic_wsdl seems to work only with built-in data types. Weblogic also supports non-built-in data types, but you need to do some extra work! For the user-defined objects, you need to generate their types and register them.
Note: The samples given in Weblogic 8.1 do not use non-built-in data types!
Make sure you use the ant task "autotype" in your build.xml to generate the appropriate types (objects to support java-xml and xml-java converstion), types.xml from the wsdl. Register the types.xml file in your calling client code.
If you do not use register the types for the user-defined classes used in the web services method signatures, then you are likely to get the foll. exception.
javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementw
eblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml
.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.wsdlgen.jipi
lot.vodafone.com']:getStock}
C:\Tutorial\WS\dynamic_wsdl>ant run
Buildfile: build.xml
run:
[java] Creating the service...
[java] Creating the call...
[java] invoking the call....
[java] javax.xml.rpc.JAXRPCException: failed to invoke operation 'getStock' due to an error in
the soap layer (SAAJ); nested exception is: Message[ failed to serialize interface javax.xml.soap.SO
APElementweblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface
javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.ws
dlgen.jipilot.vodafone.com']:getStock}]StackTrace[
[java] javax.xml.soap.SOAPException: failed to serialize interface javax.xml.soap.SOAPElementw
eblogic.xml.schema.binding.SerializationException: mapping lookup failure. class=interface javax.xml
.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVodafonePooled.wsdlgen.jipi
lot.vodafone.com']:getStock}
[java] at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:328)
[java] at weblogic.webservice.core.DefaultPart.toXML(DefaultPart.java:297)
[java] at weblogic.webservice.core.DefaultMessage.toXML(DefaultMessage.java:645)
[java] at weblogic.webservice.core.ClientDispatcher.send(ClientDispatcher.java:206)
[java] at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:143)
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
[java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:558)
[java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
[java] at Main.main(Main.java:61)
[java] Caused by: weblogic.xml.schema.binding.SerializationException: mapping lookup failure. c
lass=interface javax.xml.soap.SOAPElement class context=TypedClassContext{schemaType=['http://svcVod
afonePooled.wsdlgen.jipilot.vodafone.com']:getStock}
[java] at weblogic.xml.schema.binding.RuntimeUtils.lookup_serializer(RuntimeUtils.java:151)
[java] at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:187)
[java] at weblogic.xml.schema.binding.RuntimeUtils.invoke_serializer(RuntimeUtils.java:174)
[java] at weblogic.webservice.core.DefaultPart.invokeSerializer(DefaultPart.java:324)
[java] ... 9 more
[java] ]
[java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:578)
[java] at weblogic.webservice.core.rpc.CallImpl.invoke(CallImpl.java:411)
[java] at Main.main(Main.java:61)
[java] Exception in thread "main"
[java] Java Result: 1The foll. code worked fine for me in Weblogic 8.1 SP3, on Windows 2000.
Note: the 2 important lines of code:
TypeMappingRegistry registry service.getTypeMappingRegistry();
registry.registerDefault(new DefaultTypeMapping("types.xml"));
package auth;
import java.net.URL;
import javax.xml.rpc.ServiceFactory;
import javax.xml.rpc.Service;
import javax.xml.rpc.Call;
import javax.xml.rpc.ParameterMode;
import javax.xml.namespace.QName;
import javax.xml.rpc.encoding.TypeMapping;
import javax.xml.rpc.encoding.TypeMappingRegistry;
import weblogic.webservice.core.encoding.stream.SOAPElementCodec;
import javax.xml.rpc.encoding.*;
import weblogic.webservice.encoding.DefaultTypeMapping;
public class DClient1 {
static private void print(String msg) {
System.out.println("DClient1: " + msg);
public static void main(String[] argv) throws Exception {
System.setProperty("javax.xml.soap.MessageFactory", "weblogic.webservice.core.soap.MessageFactoryImpl");
System.setProperty( "javax.xml.rpc.ServiceFactory", "weblogic.webservice.core.rpc.ServiceFactoryImpl");
ServiceFactory factory = ServiceFactory.newInstance();
String targetNamespace = "http://www.vishwa.com/amazingworld";
QName serviceName = new QName(targetNamespace, "GeminiPasswordService");
QName portName = new QName(targetNamespace, "GeminiPasswordServicePort");
QName operationName = new QName("", "checkPassword");
URL wsdlLocation = new URL("http://localhost:7001/GeminiPasswordService/GeminiPasswordService?WSDL");
print("Creating the service...");
Service service = factory.createService(wsdlLocation, serviceName);
print("Creating the call...");
Call call = service.createCall(portName, operationName);
TypeMappingRegistry registry = service.getTypeMappingRegistry();
registry.registerDefault(new DefaultTypeMapping("types.xml"));
print("invoking the call....");
Object[] inParams = new Object[2];
inParams[0] = "clark1";
inParams[1] = "kent1";
Object result = call.invoke(inParams);
print("Client return value: = " + result.toString());
QName operationName1 = new QName("", "getBook");
print("Creating the call...");
Call call1 = service.createCall(portName, operationName1);
print("invoking the call....");
Name n = new Name();
n.setFirstname("Walker");
n.setAge(50);
Object[] inParams1 = new Object[1];
inParams1[0] = n;
Book b = (Book) call1.invoke(inParams1);
print("author: " + b.getAuthor());
print("money: " + b.getMoney());
} -
hello,
im running a dynamic proxy client for a simple web service. I have the web service up and running but when i run the client i get the following error:
run-client:
[java] java.lang.NoClassDefFoundError: dynamicproxy/BookClient
[java] Exception in thread "main"
[java] Java Result: 1
run:
BUILD SUCCESSFUL
Total time: 2 seconds
My client code is as follows:
package dynamicproxy;
import java.net.URL;
import javax.xml.rpc.Service;
import javax.xml.rpc.JAXRPCException;
import javax.xml.namespace.QName;
import javax.xml.rpc.ServiceFactory;
import dynamicproxy.BookIF;
public class BookClient{
public static void main(String[] args){
try{
String UrlString = args[0] + "?WSDL";
String nameSpaceUri = "urn:Foo";
String serviceName = "MyBookService";
String portName = "BookIFPort";
System.out.println("UrlString = " + UrlString);
URL bookWsdlUrl = new URL(UrlString);
ServiceFactory serviceFactory = ServiceFactory.newInstance();
Service bookService = serviceFactory.createService(bookWsdlUrl,
new QName(nameSpaceUri, serviceName));
dynamicproxy.BookIF
myProxy = (dynamicproxy.BookIF)
bookService.getPort(new QName(nameSpaceUri, portName),
dynamicproxy.BookIF.class);
System.out.println("The sum of the 2 numbers is:");
System.out.println(myProxy.add(1, 2));
catch (Exception ex)
ex.printStackTrace();
Any ideas??thnx kwalsh1 i got it working. It was the targets.xml file in jaxrpc/common, i edited the package-dynamic to include all class files!
-
Hi all,
iam trying to use the dynamic proxy client with the following lines
String UrlString =
"http://localhost:8080/ProxyHelloWorld.wsdl";
String nameSpaceUri = "http://proxy.org/wsdl";
String serviceName = "HelloWorld";
String portName = "HelloIFPort";
URL helloWsdlUrl = new URL(UrlString);
ServiceFactory serviceFactory =
ServiceFactory.newInstance();
Service helloService =
serviceFactory.createService(helloWsdlUrl,
new QName(nameSpaceUri, serviceName));
//HelloIF myProxy = (HelloIF) helloService.getPort(
//new QName(nameSpaceUri, portName),
//proxy.HelloIF.class);
when i try to do this i get the following exception
Exception in thread "main" java.lang.NoSuchMethodError
at com.sun.xml.rpc.wsdl.parser.Util.verifyTagNSRootElement(Util.java:59)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
arser.java:191)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitionsNoImport(WSDLP
arser.java:165)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parseDefinitions(WSDLParser.ja
va:96)
at com.sun.xml.rpc.wsdl.parser.WSDLParser.parse(WSDLParser.java:91)
at com.sun.xml.rpc.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLMod
eler.java:85)
at com.sun.xml.rpc.processor.config.ModelInfo.buildModel(ModelInfo.java:
77)
at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.getModel(ServiceInfoBui
lder.java:96)
at com.sun.xml.rpc.client.dii.ServiceInfoBuilder.buildServiceInfo(Servic
eInfoBuilder.java:59)
at com.sun.xml.rpc.client.dii.ConfiguredService.<init>(ConfiguredService
.java:44)
at com.sun.xml.rpc.client.ServiceFactoryImpl.createService(ServiceFactor
yImpl.java:32)
at JAXRPCClient.main(JAXRPCClient.java:38)
what am i doing wrong
sureshHi,
Yeah the Wsdl is hosted at http://localhost:8080/ProxyHelloWorld.wsdl.I also tried binding with a few xmethods service i get the same error.
same error. -
Hey ,
I have an application which requires to talk to 2 different published webservices
from 2 different systems. Now instead od designing static webservice clients for
each of these systems(which would involve having separate proxy jars etc),
I am planning to design a dynamic webservice locator and invoker....
I know that we can have webservice clients which are dynamic to the extent that
we can create proxy objects at runtime once we know the endpoint WSDL..
eg:
ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName =new QName targetNamespace,"net.xmethods.services.stockquote.StockQuoteService");
QName portName = new QName(targetNamespace,"net.xmethods.services.stockquote.StockQuotePort");
QName operationName = new QName("urn:xmethods-delayed-quotes","getQuote");
URL wsdlLocation = new URL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
// create service
Service service = factory.createService(wsdlLocation, serviceName);
// create call Call call = service.createCall(portName, operationName);
My question on this...if I have a dynamic approach like the above what are the
pros and cons..I guess it would surely have more overhead compared to a static
client...?
Secondly ,is it even feasible to design a dynamic client in such a way that the
endpoint WSDL could also be an unknown and my generic client would also locate
the end-point dynamically and then invoke dynamic calls as above...
If anybody can share their insights on a dynamic webservice client , I would really
appreciate it...
Thanx,
Krish
KRISH.VENKATARAMAN
Senior Technology Analyst
Bank of America Corp.
Email:[email protected]Hi Krish,
In WSDL, the data types passed between applications are described in schema
and
this is key for interop. I dont know of any standard/natural mapping for
values types,
object reference, etc in a binary protocol (like JRMP, IIOP) to schema. For
eg:
say there is serializable object Foo, which is the argument to a remote
method in RMI.
Object Foo can have data + behavior. It may be possible (not always, i
think) to
describe the data in Foo as schema, but how can one describe the behavior?
So, if WSDL is the only contract between the server and client (key
requirement
for interop), then IMHO RMI can not be described by WSDL.
Also, WSDL was designed for future extensions and does not map well to a
programming API. WSIF trys to expose all the gory WSDL details and its apis
are very clumsy.
These were the two main reason to vote it down at JAX-RPC EC.
I am attaching an example that shows, how to introspect WSDL and invoke
a method using JAX-RPC (with little extension to the std api). Also, it
shows
how to handle complex type without data binding. Will this solve your
problem?
I am very interested to get your feedback on this.
BTW, This example will only work with WLS 8.1.
regards,
-manoj
"Krish Venkataraman" <[email protected]> wrote in message
news:[email protected]...
>
>
Mike...thanx for the inputs...
As per ur suggestion...I have taken this offline and mailed u [email protected]
also....lemme know if thatz cool...
there are my observations..lemme know what am i missing..
1) The main difference I see between JAX-RPC and WSIF, is that with WSIFclient
it is easier to port to services talking
via other ports like RMI,IIOP etc...where as JAX-RPC is understandsonly SOAP(atleast
for now).
2) Lets assume for the time-being that I would be interested only to talkto services
talking SOAP.
Then why do I need WSIF ?
3) I can have a JX-RPC client , I can have a similar generic(reflection)code
for built-in/primitive datatypes and for
complex datatypes I anywayz would be doing the same thing(requiringthe java
representation of the datatype unless I use
something like JROM or something which I do not want to) in JAX-RPC orWSIF.
>
4) As far as syncronous or asyncronous invocation is concerned , myunderstanding
is that my client call is going to remain the
same ..the service provider is going to either use message-oriented orRPC
on his side...
Again assuming that I am interested only with services talking SOAP, thiscould
be my generic client invocation design
Background is that my client is going to run from within a WLS70sp1
Actors:
a) webSevice1ClientSessionBean : This will be a stateless session beanwhich might
have knowledge about webSevice1's end-point ,
complex dataTypes if any.
(There would be other session beans like this which would haveknowledge about
other specific webservice)
b) GenericWebServiceInvoker : This will have knowledge about everythingwithin
the webservice-standards/protocols.
eg:
//set weblogic ServiceFactory
System.setProperty( "javax.xml.rpc.ServiceFactory",
"weblogic.webservice.core.rpc.ServiceFactoryImpl" );
//create service factory
ServiceFactory factory = ServiceFactory.newInstance();
//define qnames
String targetNamespace = "http://soapinterop.org/";
QName serviceName = new QName( targetNamespace, "SimpleTest" );
QName portName = new QName( targetNamespace, "SimpleTestSoap" );
QName operationName = new QName( "http://soapinterop.org/",
"echoStruct" );
//create service
Service service = factory.createService( serviceName );
TypeMappingRegistry registry = service.getTypeMappingRegistry();
TypeMapping mapping = registry.getTypeMapping(
SOAPConstants.URI_NS_SOAP_ENCODING );
mapping.register( SOAPElement.class,
new QName( "http://soapinterop.org/xsd", "SOAPStruct" ),
new SOAPElementCodec(),
new SOAPElementCodec() );
//create call
Call call = service.createCall();
//set port and operation name
call.setPortTypeName( portName );
call.setOperationName( operationName );
call.addParameter( "inputStruct",
new QName( "http://soapinterop.org/xsd", "SOAPStruct" ),
ParameterMode.IN);
All parameter values specific to a particular webservice likeQName,targetNameSpace
etc will be sent to this invoker by
webSevice1ClientSessionBean. The GenericWebServiceInvoker will invokethe
service
(using reflection for primitive/builtin types) and alwayz accept anobject
from the service operation and just return
that "object" back the webSevice1ClientSessionBean.ThewebSevice1ClientSessionBean
will know how to interpret the
complexdataType or builtInDatatype whichever is returned.TheGenericWebServiceInvoker
will not have any application
specific knowledge...it will just have knowledge about how todiscover, invoke
any SOAP webservice...
Somewhere in the beginning of GenericWebServiceInvoker I will use JAXRto
discover services from UDDI if needed.
This way I will have a generic webservice client invocation frameworkwhich
can invoke any service which talks SOAP.
Now lemme know how the above picture looks and what is missing...
I have some questions :
1) Incase of complex dataTypes, I will have itz XML representation inthe
publisher's WSDL and the publisher will give
me the java representation of the complex dataType.But how does myclient
JAX-RPC know how to map the XML
to the java representation unless I specify the mapping somewhere?Does
the TypeMapping/TypeMappingRegistry do this ?
Thanx,
Krish
"Michael Wooten" <[email protected]> wrote:
You know, it's really cool to hear guys thinking things through, before
they "jump
on a bandwagon" :-)
Anyway, I suspect that the performance overhead of doing reflection,
and heavy
server-side code intrusion, is what has made a lot of developers balk
at using
WSIF. I would check out the IBM newsgroups, to see what the general
developer
sentiment is on WSIF.
To achieve any sort of decent performance with JAX-RPC based webservices,
you
need to do a fair amount of optimization/tuning on both the client and
server
side. I recommend setting up your own "lab environment" for doing these,
so you
can see exactly what's making things improve/degrade. If you are really
interested
in this topic, we should talk about it "off-line".
In general, the more "dynamic" things are on the client side, the slower
things
will be, the more you really need to question if you really need them
to be dynamic
:-) Does making it "dynamic" really offer something that you can't get
from a
"static" version? If not, who's really benefiting here. I mean, com'n.
All you
really want to do is invoke an operation, right? By the time you get
all the information
it takes to do a dynamic invocation (i.e. port, target namespace, data
type for
input argument, serializer/deserializer for each non-built-in data type,
etc.),
your client looks like you are trying to boot a PDP-11! LOL! For those
of you
who don't know what a PDP-11 is, it's an early computer (from the'60-'70),
that
you actually had to use switches to create the "binary instructions"
to boot it
up!
From a PM's (product manager's) perpective, I wouldn't even let thedevelopers
modify "working" EJBs to expose them as a web service. Alarm bells should
go off
in your head, if you have to modify existing server-side code to expose
a company
asset as a web service.
Response to OT comment: WebLogic Server 7.0 uses its own implementation
of JAX-RPC
1.0. This implementation, I've been told by one of the BEA engineering
that worked
on it, has been certified to be JAX-RPC compliant by Sun. Don't know
about Apache
Axis, in this regard. I use both Apache Axis and the JWSDP with WLS 6.1,
but I
haven't really spent a lot of time looking for differences between our
(BEA's)
implementation, and theirs.
Regards,
Mike Wooten
"Krish Venkataraman" <[email protected]> wrote:
Hey Mike ...
I hear ya..and I see the significance of WSIF...but that IBM started
it a year
back and itz not yet stabilized is what is holding me back...
U mite have a better hold of what WSIF can do...whatever I could grasp
from yesterday
is this...
a)It reads meta data from the wsdl and using a reflection mechanismcalls
the
service operations...
I see examples with primitive datatypes..but what happens when
complex/custom
datatypes come into play...
Would the client code differ between synchronous invocation toasynchronous
invocation...
And aleast in the samples for the WSIF distribution for connectors like
EJB/JMS
etc, the code does not look generic anymore..there are specific calls
to operations
and parameters...
Also Mike , what is the trade-off on performance between having adynamic
client(lets
say based on WSIF)or having a static client...the extent of reflection
a dynamic
client will have to do and create SAAJ objects at runtime will beenormous..
Also I know that there is a relevant API...but can u give an examleshowing
me
how I could discover services from UDDI ..?
Out of this current topic...does BEA use itz own implementation of SOAP
in itz
webservice implementation...and how does it compare with AXIS ?
Thanx,
Krish
"Michael Wooten" <[email protected]> wrote:
Hi Krish,
Well, I guess that's how things are when "needed functionality exceeds
the current
state of a technology" :-)
I (not necessarily BEA) look at it like way:
1. IBM co-authored the "Big 3" XML grammars for the current web
services
stack.
2. IBM always appears to be "there, somewhere" in the new crop ofproposed
additional
XML grammars for "partially agreed upon extension layers", for theweb
services
stack.
3. IBM donated it's original SOAP implementation to the open-sourcecommunity.
4. IBM came up with WSIF over a year ago.
5. IBM's WSTK uses the Apache Axis stuff.
6. A lot of the JAX-RPC/JAXM API is based on the Apache SOAP and Apache
Axis implementations.
7. It looks like IBM may have donated WSIF to Axis.
8. You appear to need something like WSIF :-)
So, there's probably at least a 60/40 chance that some WSIF-like thing
will make
it into the JWSDP, right? If you want "higher odds", you should talk
to the folks
working on the JWSDP, as they are somewhat "in charge" here :-)
Regards,
Mike Wooten
"Krish Venkataraman" <[email protected]> wrote:
Yes...I am surely lookin at something similar...but that framework
not
being standardized
scares me as I have seen many good ideas not seeing the light of the
day...and
I do not want to design something using a framework which might remain
un-standardized..
what are ur thots..
Thanx,
Krish
"Michael Wooten" <[email protected]> wrote:
Hi Krish,
It sounds like you want WSIF :-)
"WSIF allows stubless or completely dynamic invocation of a Web
service,
>>>>>>
based upon examination of the meta-data about the service at runtime.
It
also allows updated implementations of a binding to be plugged intoWSIF
at
runtime, and it allows the calling service to defer choosing a
binding
until
runtime."
Correct?
This is a relatively new "unofficial" addition to the Web ServicesStack,
so it
is not in WLS 7.0 (or Sun's JWSDP) yet. See the following link formore
details:
http://xml.apache.org/axis/wsif
Regards,
Mike Wooten
"Krish Venkataraman" <[email protected]> wrote:
Hey ,
I have an application which requires to talk to 2 different
published
webservices
from 2 different systems. Now instead od designing static webservice
clients for
each of these systems(which would involve having separate proxyjars
etc),
I am planning to design a dynamic webservice locator and invoker....
I know that we can have webservice clients which are dynamic tothe
extent
that
we can create proxy objects at runtime once we know the endpoint
WSDL..
eg:
ServiceFactory factory = ServiceFactory.newInstance();
QName serviceName =new QName
targetNamespace,"net.xmethods.services.stockquote.StockQuoteService");
>>>>>>>
QName portName = newQName(targetNamespace,"net.xmethods.services.stockquote.StockQuotePort");
>>>>>>>
QName operationName = newQName("urn:xmethods-delayed-quotes","getQuote");
>>>>>>>
URL wsdlLocation = newURL("http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl");
>>>>>>>
// create service
Service service = factory.createService(wsdlLocation, serviceName);
// create call Call call = service.createCall(portName,
operationName);
>>>>>>>
>>>>>>>
My question on this...if I have a dynamic approach like the abovewhat
are the
pros and cons..I guess it would surely have more overhead comparedto
a static
client...?
Secondly ,is it even feasible to design a dynamic client in such
a
way
that the
endpoint WSDL could also be an unknown and my generic client wouldalso
locate
the end-point dynamically and then invoke dynamic calls as above...
If anybody can share their insights on a dynamic webservice client
I would really
appreciate it...
Thanx,
Krish
KRISH.VENKATARAMAN
Senior Technology Analyst
Bank of America Corp.
Email:[email protected]
[BrowserClient.java]
[DynamicClient.java] -
Building WSDL client for OIM SPML webservice
Has any one created WSDL client for OIM SPML webservice,
Any help is appreciated.
Thanks,
Pandu
old thread -->
add udfs to spml prov. request to oim
==========================
Hi,
I am provisioning users in OIM from by sending spml requests
I used the sample client that comes in xellerate directory.
How can I update spml requests to include UDFs to create user in him with udf s.
Thanks
Pandu
Edited by: pandu345 on Aug 5, 2009 3:27 PMHello there,
There is a .NET web service client which is successfully able to access the weblogic application server wsdl from oim 9101 and it can see the complete user profile as a response from the same.
1.) Now, there is a situation where oim needs to send some attribute values to that .NET web service client, after the data from their side comes to OIM and updates a single attribute values for e.g. PIN. How can we do that ?
2.) and I want to add some UDFs into the existing SPML provisioning user profile. How can I do that ?
3.) Also, how will OIM know that it was able to successfully send the attribute values to the web service client.
http://download.oracle.com/docs/cd/E10391_01/doc.910/e10360/creategtc.htm#Toc153968032
I have gone through this. I didnt found this in OIM 9101.
Any ideas/references/clues/hints appreciated in this concern.
Thanks in advance,
- oidm. -
Hi,
there is a way to create a dynamic JCO.Client?
I have this code:
JCO.Client jcoclient = JCO.createClient(
"data",
"data",
"password",
"it",
"10.140.5.122",
"12");
jcoclient.connect();
I want to get dynamically from the system the parameters for method "createClient". It's possible??There is a way??
THANS>
Andrea Ruocco wrote:
> Hi,
> there is a way to create a dynamic JCO.Client?
> I have this code:
>
>
> I want to get dynamically from the system the parameters for method "createClient". It's possible??There is a way??
> THANS
To avoid hard coding the JCO connection details, take a look at the [Destination Service API|http://help.sap.com/saphelp_nw04/helpdata/en/8b/8e7dac1e661d44bf2a676fd3948cc6/frameset.htm].
Here is a [blog|https://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/wlg/10300] on how to use the SAP Enterprise Connector (which is used to call JCOs) with the Destination Service API. Once the Destination service is set up, you can then create your JCO.client as follows
final InitialContext ctx = new InitialContext();
final DestinationService dstService = (DestinationService)ctx.lookup(DestinationService.JNDI_KEY);
if (dstService == null)
throw new NamingException("Destination Service not available");
RFCDestination dst;
// get the ERPR3 destination created in visual administrator
dst = (RFCDestination) dstService.getDestination("RFC", "ERPR3");
Properties jcoProperties = dst.getJCoProperties();
//Establish a direct connection
JCO.Client client = JCO.createClient(jcoProperties);
client.connect(); -
JAX-RPC Dynamic Proxy Client Question
I have a very simple web service successfully deployed using Tomcat 5 and Apache Axis. It simply takes a string and returns a String. Regardless, it's working.
Now I'm wanting to create a JAX-RPC dynamic proxy client as described on the following page:
http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC5.html
There are numerous other articles out there describing the same method.
My problem is that I'm getting a ServiceException on the following line every time I try to run my client:
ServiceFactory factory = ServiceFactory.newInstance();
Would anyone have any ideas why this might be or what I might be missing? All the articles make it seem like this is just a trivial line and never mention much about it.
Any help would be appreciated. Thanks.Hello,
You are getting a service Exception on ServiceFactory.newInstance() method?
Actually, I have never seen this problem before. Is it possible that there are
classpath issues? That is, are you using just the jars from the jwsdp?
Regards,
Kathy -
No SOAPAction in dynamic proxy client
I am trying to consume a .NET Web service from a J2EE client. I am using a dynamic proxy client from http://java.sun.com/webservices/docs/1.3/tutorial/doc/JAXRPC5.html#wp79973
However, I am have a problem with the SOAPAction HTTP header. .NET requires this header element to be set but the proxy sends an empty SOAPAction header. What is the solution to this problem?message.getHeaders().addHeader("SoapAction","http://some.action.here");
this piece of code is not working. This what i'm using.
my .net service is running at ""http://192.168.4.214/dmwebservice/service1.asmx";" and my method name is "disconnect_cabinet"
mesg.getMimeHeaders().addHeader("POST" , " /dmwebservice/service1.asmx HTTP/1.1");
mesg.getMimeHeaders().addHeader("HOST" , " http://192.168.4.214");
mesg.getMimeHeaders().addHeader("SOAPAction", " http://tempuri.org/disconnect_cabinet");
the request & response is:
[java] **** request ****
[java] <?xml version="1.0" encoding="utf-8"?>
[java] <SOAP-ENV:Envelope soap:encodingStyle="http://schemas.xmlsoap.org/so
ap/encoding" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xs
d="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema
-instance"><SOAP-ENV:Header><SOAPAction xmlns="http://192.168.4.214/dmwebservice
/service1.asmx/disconnect_cabinet"/></SOAP-ENV:Header><SOAP-ENV:Body><disconnect
_cabinet xmlns="http://tempuri.org/"><credentials>123456</credentials></disconne
ct_cabinet></SOAP-ENV:Body></SOAP-ENV:Envelope>
[java] **** response ****
[java] <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="htt
p://schemas.xmlsoap.org/soap/envelope/"><soap:Header><wsu:Timestamp xmlns:wsu="h
ttp://schemas.xmlsoap.org/ws/2002/07/utility"><wsu:Created>2004-06-28T05:00:50Z<
/wsu:Created><wsu:Expires>2004-06-28T05:05:50Z</wsu:Expires></wsu:Timestamp></so
ap:Header><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>
System.Web.Services.Protocols.SoapHeaderException: The message is not a valid XM
L message ---> System.Xml.XmlException: 'soap' is an undeclared namespace. Li
ne 2, position 20.
[java] at System.Xml.XmlNSAttributeTokenInfo.FixNames()
[java] at System.Xml.XmlTextReader.ParseElement()
[java] at System.Xml.XmlTextReader.Read()
[java] at Microsoft.Web.Services.XmlSkipDTDReader.Read()
[java] at System.Xml.XmlLoader.LoadDocSequence(XmlDocument parentDoc)
[java] at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, B
oolean preserveWhitespace)
[java] at System.Xml.XmlDocument.Load(XmlReader reader)
[java] at Microsoft.Web.Services.SoapEnvelope.Load(Stream stream)
[java] at Microsoft.Web.Services.WebServicesExtension.BeforeDeserializeS
erver(SoapMessage message)
what does this means and how can i fix? "The message is not a valid XML message ---> System.Xml.XmlException: 'soap' is an undeclared namespace. Line 2, position 20."
please let me know.
subhani. -
Hello,
I made a WSDL client and now I've seen that java has a native client JAX-WS that I could of use.
My original client knows how to use PKCS11 and how to set HTTP header vars(including basic HTTP authentication).
I don't know how to translate PKCS11 and HTTP header vars in JAX-WS.
I should find a place where to specify a SSLSocketFactory in JAX-WS.
I started with the example from here: http://www.mkyong.com/webservices/jax-ws/jax-ws-hello-world-example/ and I tried to add these 2 functionalities.
But the problem line is at
{Service service = Service.create(url, qname);}
and I can't add here my new functionality.
What should I do?
This is the client:
package com.mkyong.client;
import java.net.URL;
import javax.xml.namespace.QName;
import javax.xml.ws.Service;
import com.mkyong.ws.HelloWorld;
public class HelloWorldClient{
public static void main(String[] args) throws Exception {
URL url = new URL("http://localhost:9999/ws/hello?wsdl");
QName qname = new QName("http://ws.mkyong.com/", "HelloWorldImplService");
Service service = Service.create(url, qname);
HelloWorld hello = service.getPort(HelloWorld.class);
System.out.println(hello.getHelloWorldAsString("mkyong"));
Thank youThis is what I tryed:
URL url = new URL(protocol+"://"+host+":"+port+servicePath);
QName portName = new QName(protocol+"://"+host+":"+port, servicePath);
System.out.println("URL IS "+url.toString());
Service service = Service.create(url, portName);
OnlineSIUIDef portSIUI = service.getPort(OnlineSIUIDef.class);
BindingProvider bindingProvider = (BindingProvider)portSIUI;
Map requestContext = bindingProvider.getRequestContext();
requestContext.put(BindingProvider.USERNAME_PROPERTY, SIUI_USERNAME);
requestContext.put(BindingProvider.PASSWORD_PROPERTY, SIUI_PASSWORD);
PKCS11 pk11 = new PKCS11();
pk11.loadSecurityProviders();
RetStruct statD = pk11.getKeyManagerFactory();
if(statD.succes) {
kKeyManagerFactory = (KeyManagerFactory)statD.returnParameters.get("KeyManagerFactory");
} else {
System.out.println("Eroare "+statD.errMessage);
SSLContext context = SSLContext.getInstance("TLS");
context.init(kKeyManagerFactory.getKeyManagers(), null, null);
factory = context.getSocketFactory();
Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
dispatch.getRequestContext().put (JAXWSProperties.SSL_SOCKET_FACTORY, factory);
dispatch.getRequestContext().put(BindingProvider.SOAPACTION_URI_PROPERTY, protocol+"://"+host+":"+port+servicePath);
OnlineSIUIDef hello = service.getPort(OnlineSIUIDef.class);
System.out.println(hello.getOnlineSIUIDefString("mkyong"));
The error is at line 4 - before setting the user, password and the SSL Context.
So the error is normal because the application never got to the line where the user, password and ssl context was set.
But how do I set these before line 4?
The error is
Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: https://www.siui.ro:443/svapntws/services/SiuiWS?wsdl. It failed with:
Got Server returned HTTP response code: 401 for URL: https://www.siui.ro:443/svapntws/services/SiuiWS?wsdl while opening stream from https://www.siui.ro:443/svapntws/services/SiuiWS?wsdl.
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:173)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:155)
at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:120)
at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:257)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:220)
at com.sun.xml.internal.ws.client.WSServiceDelegate.<init>(WSServiceDelegate.java:168)
at com.sun.xml.internal.ws.spi.ProviderImpl.createServiceDelegate(ProviderImpl.java:96) -
Installed noip dynamic update client from community repo for ssh access if my ip changes while at work.
No info in wiki or man pages. Resorted to "noip2 help" no-ip.com support pages and Google for config info.
Have noip installed and working, although it's not automatically updating no-ip.com when my dynamic ip changes.
Have noip2 in my daemons list in /etc/rc.conf
Can access my home computer from work via "ssh *********.no-ip.org" rather than ip addy.
Logging into no-ip.com account after ip changes shows it does not update the ip.
Running "noip" in a terminal updates the ip in my no-ip.com account.
Ran sudo noip2 -C to configure x times and still have an empty no-ip2.conf, except for "0.0.0.0"
Running "sudo noip2 -S" get the following:
1 noip2 process active.
Process 18169, started as noip2, (version 2.1.9)
Using configuration from /etc/no-ip2.conf
Last IP Address set 7*.***.***.***
Account j*******@*****.***
configured for:
host *********.no-ip.org
Updating every 10 minutes via /dev/eth0 with NAT enabled.
Using nano rather than leafpad to look at no-ip2.conf shows the following:
0.0.0.0^@^@^@^@^@^@^@^@^@
^@!L2JA\^@^@^@^A^A^A^@eth0^@^@^@^@^@^@^@^@^@^@^@^@dXNlcm5hbWU9amVmZnJzMTIlND5jb20mcGFzcz1tYXh4d29vZCZoW109amV==
Should I manually put something into the no-ip2.conf and if so, what?
I see a bunch of files similar names to this "NO-IPinGDWE" now that are empty in /etc.
It'd be cool if someone who knows more than me would start a noip wiki page. If no one bites, I'll make one after I get this figured out.
Last edited by jeff story (2012-07-21 04:50:24)Thanks Mektub,
Yea I'm pretty sure the password was correct and verified by running "noip2" in a terminal and that updated it. Thanks for the binary no-ip2.conf info. That explains what I saw. Any idea why would it be a binary file?
Got it updating now. First prob, I think originally, I ran noip2 -C as user rather than root. Second may have been file permission for no-ip2.conf was read write root only. I changed "root group" and "others" to read only access.
Not sure which change fixed it but it's updating the ip correctly now. -
About my Dynamic DHCP Client List
In my eH100 Network settings under Dynamic DHCP Client List it shows two hosts. My MAC address with no name and another MAC address with a name. Does that mean someone is using access through my router. Now it's only showing one host.
What is a EH100? A DSL or cable modem or router with wireless capability? IF so, it is likely that somebody is "fare-jumping" wirelessly onto your network, if you have no security set up on your wireless.
IF you currently are an open network, I would recommend a combination of configuring your wireless access point with WPA-PSK security plus MAC authentication. (I hear there is a better one than WPA, which is itself better than WEP, but neither my computers nor modem support any better than WPA). On my ActionTec DSL modem/router/WAP, this is set in Advanced Settings under wireless settings (to specify WPA) and a clearly labeled MAC authentication link for the MAC address list. For MAC authentication, manually add hardware ethernet addresses as found in each authorized computer's system preferences > network > Airport or Built-in Ethernet as Airport ID or Ethernet ID given in the form of xx:xx:xx:xx:xx:xx), depending on how they will be accessing your WAP/router/modem.
FWIW, this actually would have probably been more fitting to post over in the networking forum.
(if you find that this solves your problem, or is actually helpful towards arriving at a solution to your problem, please consider clicking on either the "helpful" or "solved" buttons in the header of my post) -
Dynamic webservice client for User-defined datatypes
Hi All,
I have a webservices with user-defined datat types. I want to write a dynamic client that will work even if there are any changes in the wsdl, so that I do not want to recompile the client or make any changes on the client side.
I tried using DII but we need to modify the custome objects and recompile the same. Suggest me any alternative.
Regards,
SanjayRob, unfortunately not. If I ever come across the solution, I will post it here.
The reason I wanted to use weblogic webservices was to take advantage of the asynchronous webservice functionality. I ended up using xfire instead for my webservices, as we already had that in place in the application, and then using polling clients to get the response. Not an ideal solution, but it works very good anyway.
regards,
Marcus -
Dynamic WebService client within a WebService Handler
We have a WebService running on WebLogic 10.3 that has a handler that contains a Webservice client that connects to a set of IIS WebServices.
The client is called with code like this:
QName qname = new QName("http://www.company.com/Webservices/", "UserService");
UserService service = new UserService(url, qname);
service.setHandlerResolver(resolver);
UserServiceSoap uss = service.getUserServiceSoap();
The URL is dynamic, we have different servers that contain different data other than that they are the same. When this is called the first time with URL http://abc it works just fine. If it is called again but this time pointing to URL http://xyz, the client still goes to http://abc. We have check through debugging to ensure that we are really passing the correct URL, and we are. I traced this through a tool called WireShark and can see our client making 2 GET requests to the proper WSDL but then does the POST to http://abc. URLS have been altered to protect the innocent :) This same webservice containing this handler works as expected within Tomcat, it is in WebLogic that things get weird. Any help would be appreciated.
Thanks,Hi
<b>Bojja Guruvulu</b>
My Email Id is : <b>[email protected]</b> -
Dynamic wsdl for web service proxy
Hi,
I have generated the Web service proxy client based on wsdl used in dev env,
if i have to deploy to production, i have to manually change the WSDL url to point to production.
Is there anyway, I can deploy without changing manually.
thanksthanks all from the prompt replies.
I still have a query. All i can do is create various WS references in connections.xml and call dynamically. like
Context ctx = ADFContext.getCurrent().getConnectionsContext();
WebServiceConnection wsc = (WebServiceConnection) ctx.lookup("MyConnection1"); // here i can make a dynamic call ...
but this piece of code can work only in UI. what if i need to do the same approach in model from my AM.
Is there a way ??
Maybe you are looking for
-
How can I get the music I download from an app to show in my library to use my dj app?
I need to get my music but I can't use iTunes so help me
-
Creation of folder/"SAVE AS "option
Dear all / baneka raj 1) I want to give a authorization for creation of folder to HOD only in easy DMS . Please le me know the detail procedure. Its burning issue to me . 2) "SAVE AS "( Kindly refer my last thread/Deactivate this SAVE AS option) opt
-
How to avoid the "Enter Employee Responsible" error in an Opportunity
Hi CRM gurus, My employer wants me to create a custom Lead Type (and an Opportunity Type) which will look just like the SAP default Lead (and Opportunity Type respectively), except that he wants a custom Partner Function called "Sales Person" instead
-
How do i consolidate my i tunes library if i cant open itunes?
Itunes wont work after latest update. Keeps coming up with R6034 runtime error. The support section has a fix detailed. First it says consolidate your Itunes library before copying it to an external hard drive. But I cant consolidate my library if IT
-
Dear sir, The given below my subscription purchase details, but still i can not get that subscrition First payment was taken on: Aug 4, 2013 Next payment will be taken on: Sep 14, 2013 Order reference: [removed for privacy] Total amount: $8.99