Java client call "ArrayOfString".
I hava a .net Web Service like
public string[] Func(string[] param)
public string[] helloworld(string echo)
return "hello world," + echo;
I want use java call it .
and Download axis and find a samples :DynamicInvoker.java
I Test "helloworld" ,it working.
but I don't known how to call Func, because of string[].
I need use ArrayDeserializer??
I need help ,thanks
up
Similar Messages
-
Trying SAML sender-vouches, standalone Java client call to service bus.
I've built a standalone Java client using Jax-ws. It produces a wsse header containing both a SAMLAttribute and an optional SAMLAuthentication statement.
I've tried to configure a proxy service on the servicebus (10gR3) using ws-policy (weblogic version, not ws-1.2), configured a SAMLIdentityAsserter (v2), an identity provider partner and a SAMLIdentityNameMapper.
I get the message weblogic.xml.crypto.wss.SecurityTokenValidateResult@ca32f2[status: false][msg The SAML token is not valid.]
when sending SAML assertions which looks valid to me.
If you see something missing or invalid in the SAML, something missing in the configuration or something else, I would be really glad.
All examples are using a SAMLCredentialmapper, but I'm building a standalone client, so a weblogic SAMLCredentialMapper is out of the question (?).
request header:
<S:Header>
<wsse:Security xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" S:mustUnderstand="1">
<saml:Assertion xmlns:saml="urn:oasis:names:tc:SAML:1.0:assertion" xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:exc14n="http://www.w3.org/2001/10/xml-exc-c14n#" xmlns:xs="http://www.w3.org/2001/XMLSchema" AssertionID="1246342701761" IssueInstant="2009-06-30T06:18:21.683Z" Issuer="http://openuri.org/service/customer/contact/contactInformationService" MajorVersion="1" MinorVersion="1">
<saml:Conditions NotBefore="2009-06-30T06:17:21.683Z" NotOnOrAfter="2009-06-30T07:18:21.683Z"/>
<saml:AuthenticationStatement AuthenticationInstant="2009-06-30T06:18:21.683Z" AuthenticationMethod="urn:oasis:names:tc:SAML:1.0:am:unspecified">
<saml:Subject>
<saml:NameIdentifier Format="urn:oasis:names:tc:SAML:1.1:nameid-format:X509SubjectName" NameQualifier="sb1sk">uid=vsb,ou=smn</saml:NameIdentifier>
<saml:SubjectConfirmation>
<saml:ConfirmationMethod>urn:oasis:names:tc:SAML:1.0:cm:sender-vouches</saml:ConfirmationMethod>
</saml:SubjectConfirmation>
</saml:Subject>
</saml:AuthenticationStatement>
</saml:Assertion>
</wsse:Security>
response:
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body>
<env:Fault xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<faultcode>wsse:InvalidSecurityToken</faultcode>
<faultstring>Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenValidateResult@1061c5e[status: false][msg The SAML token is not valid.]</faultstring>
</env:Fault>
</env:Body>
</env:Envelope>
If the client leaves out the wsse:security element in the header, the service complains
<faultstring>No Security header in message but required by policy.</faultstring>
The SAMLIdentity name mapper is never loaded at all (checked by logging at class loading)
The configuration in the Identity provider partner:
audience uri: target:*:/
issuer uri: /service/customer/contact/contactInformationService (also tried with a unique string equal to what the client sends)
virtual user: enabled
confirmation method: sender-vouches
I am not using any certificates (tryed both with and without)
Policy in use for the proxy service:
<?xml version="1.0"?>
<wsp:Policy
xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"
xmlns:wssp="http://www.bea.com/wls90/security/policy"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
xmlns:wls="http://www.bea.com/wls90/security/policy/wsee#part"
wsu:Id="samlSV"
>
<wssp:Identity>
<wssp:SupportedTokens>
<wssp:SecurityToken TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-2004-01-saml-token-profile-1.0#SAMLAssertionID">
<wssp:Claims>
<wssp:ConfirmationMethod>sender-vouches</wssp:ConfirmationMethod>
</wssp:Claims>
</wssp:SecurityToken>
</wssp:SupportedTokens>
</wssp:Identity>
</wsp:Policy>
Stacktrace:
weblogic.xml.crypto.wss.WSSecurityException: Security token failed to validate. weblogic.xml.crypto.wss.SecurityTokenVal
idateResult@a4fc20[status: false][msg The SAML token is not valid.]
at weblogic.xml.crypto.wss.SecurityImpl.unmarshalAndProcessSecurityToken(SecurityImpl.java:630)
at weblogic.xml.crypto.wss.SecurityImpl.unmarshalChildren(SecurityImpl.java:556)
at weblogic.xml.crypto.wss.SecurityImpl.unmarshalInternal(SecurityImpl.java:448)
at weblogic.xml.crypto.wss.SecurityImpl.unmarshal(SecurityImpl.java:416)
at weblogic.xml.crypto.wss.api.WSSecurityFactory.unmarshalAndProcessSecurity(WSSecurityFactory.java:66)
at weblogic.wsee.security.WssServerHandler.processRequest(WssServerHandler.java:35)
at weblogic.wsee.security.WssHandler.handleRequest(WssHandler.java:74)
at com.bea.wli.sb.security.wss.WssInboundHandler.processRequest(WssInboundHandler.java:116)
at com.bea.wli.sb.security.wss.WssHandlerImpl.doInboundRequest(WssHandlerImpl.java:201)
at com.bea.wli.sb.context.BindingLayerImpl.addRequest(BindingLayerImpl.java:257)
at com.bea.wli.sb.pipeline.MessageProcessor.processRequest(MessageProcessor.java:66)
at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:508)
at com.bea.wli.sb.pipeline.RouterManager$1.run(RouterManager.java:506)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
at weblogic.security.service.SecurityManager.runAs(Unknown Source)
Edited by: user6080617 on Jun 29, 2009 11:39 PMThank you for the tip. I've tried it, the result is below. It suspect something missing in my configuration, but I do not know what.
<WSEE:17>Class of cred is: class weblogic.xml.saaj.SOAPElementImpl<SAMLCredentialImpl.<init>:85>
<WSEE:17>Instantiating SAMLAssertionInfoFactory<SAMLCredentialImpl.<init>:87>
<WSEE:17>Getting SAMLAssertionInfo from DOM Element<SAMLCredentialImpl.<init>:97>
<WSEE:17>Got SAMLAssertionInfo<SAMLCredentialImpl.<init>:117>
<WSEE:17>Assertion ID: 1246358297862<SAMLCredentialImpl.verbose:69>
<WSEE:17>Assertion CM: urn:oasis:names:tc:SAML:1.0:cm:sender-vouches<SAMLCredentialImpl.verbose:70>
<WSEE:17>Assertion Subject: uid=vsb,ou=smn<SAMLCredentialImpl.verbose:71>
<WSEE:17>Assertion Version: 1.1<SAMLCredentialImpl.verbose:72>
<WSEE:17>Attempting assertIdentity<CSSUtils.assertIdentity:310>
<WSEE:17>SAML_TARGET_RESOURCE is: /service/customer/contact/contactInformationService<CSSUtils.assertIdentity:312>
<WSEE:17>Got Principal Authenticator<CSSUtils.assertIdentity:314>
<WSEE:17>Cred type is: SAML.Assertion.DOM, Node: [saml:Assertion: null]<CSSUtils.assertIdentity:320>
<WSEE:17>Exception while asserting identity: javax.security.auth.login.LoginException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: SAML.Assertion.DOM<CSSUtils.assertIdentity:325>
<WSEE:17>javax.security.auth.login.LoginException: [Security:090377]Identity Assertion Failed, weblogic.security.spi.IdentityAssertionException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: SAML.Assertion.DOM<CSSUtils.assertIdentity:326> -
Create a JAVA client calling a proxy...
Hi,
I succeed creating a servlet that calls a web service via a "deployable proxy".
Is it possible to create a java class (not a servlet or jsp) that connect to this proxy ?
Here is a sample of my client class:
InitialContext ic = new InitialContext();
Z_RFC_WS_TESTService sampleWS =
(Z_RFC_WS_TESTService) ic.lookup("java:comp/env/SampleWSProxy");
The WEB server is not local....how do I insert the url and how do I get the name of the Context.INITIAL_CONTEXT_FACTORY ?
Thanks a lot.Hi David,
first, once again, I'm not familiar with this proxy stuff. So about this I cannot say anything in detail.
All I recognized was that it seems that you try to access your J2EE servers JNDI context from outside, right? This is done by the now following solution, which shows you the whole context-tree of the J2EE's server JNDI root context:
package com.btexx.jndi.remote.test;
import java.util.Arrays;
import java.util.Properties;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NameClassPair;
import javax.naming.NamingEnumeration;
import javax.naming.NamingException;
public class Accessor {
public static void main(String[] args) {
Properties props = new Properties();
props.put(Context.INITIAL_CONTEXT_FACTORY, "com.sap.engine.services.jndi.InitialContextFactoryImpl");
props.put(Context.SECURITY_PRINCIPAL, "Administrator");
props.put(Context.SECURITY_CREDENTIALS, "BTXadm");
props.put(Context.PROVIDER_URL, "prag:50004");
try {
InitialContext ctx = new InitialContext(props);
showInnerContent(ctx, 0);
} catch (NamingException e) {
e.printStackTrace();
private static void showInnerContent(Context ctx, int indent) throws NamingException {
NamingEnumeration enum = ctx.list("");
while (enum.hasMore()) {
NameClassPair pair = (NameClassPair) enum.next();
char[] spcs = new char[indent];
Arrays.fill(spcs, ' ');
System.out.println(new String(spcs) + pair.getName());
try {
Context innerCtx = (Context) ctx.lookup(pair.getName());
showInnerContent(innerCtx, indent+2);
} catch (Exception e) {
For this, you need the following JARs from the server (maybe there exists a client package with all together):
<classpathentry kind="lib" path="frame.jar"/>
<classpathentry kind="lib" path="naming.jar"/>
<classpathentry kind="lib" path="util.jar"/>
<classpathentry kind="lib" path="exception.jar"/>
<classpathentry kind="lib" path="boot.jar"/>
<classpathentry kind="lib" path="iq-lib.jar"/>
<classpathentry kind="lib" path="p4.jar"/>
<classpathentry kind="lib" path="log_api.jar"/>
<classpathentry kind="lib" path="cross_api.jar"/>
<classpathentry kind="lib" path="appclient.jar"/>
<classpathentry kind="lib" path="security_api.jar"/>
<classpathentry kind="lib" path="security.jar"/>
<classpathentry kind="lib" path="bytecode.jar"/>
<classpathentry kind="lib" path="logging.jar"/>
Alltogether about 3MB.
Hope it helps (it should be precious anyhow),
Detlev -
How to call a text FTP proxy service from a Java client ?
Greetings,
I've configured a text FTP proxy service which downloads files from a FTP server. It pols a directory on the FTP server and, as soon as a file respecting a given pattern apears it is downloaded. I tested the service in the test console and by putting some test files onto the FTP server. Now, I need to be able to test it from a Java client. How may I do that ? I need to write a Java client to connect to the OSB and to tell to it to use the FTP proxy in order to download a given file, from a given location and to put it in a given location on the client machine. Many thanks in advance for any help. A sample would be great !
Kind regards,
NicolasOk, I understand. The crucial question here is "what is a caller that you refer to?"
Don't get me wrong, but the problem here is that you probably don't understand, what OSB is good for. OSB is an event-driven system. The event in your case is a new message in remote FTP server. You have to define what should happen when that event is fired. And that's all. You don't have to involve other client (or caller) for this case.
You should define your FTP proxy to retrieve all relevant files from FTP server and then you should route them based on their name/content/encoding/whatever to different consumers. You can also have many proxies if you want - one for each name. It's up to you. But you don't have any "callers" in either case. -
Calling .asmx Web Service from Java Client
hi
I have created one java client in WSAD 5.1 to invoke .asmx web service. I have used the following code for it.
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import org.apache.axis.encoding.XMLType;
import javax.xml.namespace.QName;
import javax.xml.rpc.NamespaceConstants;
import javax.xml.rpc.ParameterMode;
import java.net.URL;
public class JavaWS3
public static void main(String [] args)
try
// Responds the same with or without the ?WSDL
String strEndPoint = "http://www.meizlik.com/Service.asmx";
String strSoapAction = "http://www.meizlik.com/BigAdd";
String strSchemaURL = "http://www.w3.org/2001/XMLSchema";
String strParamName1 = "addend_1";
String strParamName2 = "addend_2";
String strParameterVal1= "10";
String strParameterVal2= "7";
String strFunctionName = "BigAdd";
//Call call = (Call) new Service().createCall();//Works
//Call call = new Call(strSoapAction);//Works same
//Call call = new Call(strEndPoint);//Works same
Service service = new Service();
Call call= (Call) service.createCall();
call.setEncodingStyle(NamespaceConstants.NSURI_SOAP_ENCODING);
call.setTargetEndpointAddress(new URL(strEndPoint));
// first parameter in QName seemingly takes ANYTHING
call.setOperationName(new QName("http://www.meizlik.com", strFunctionName));
// Set the name of the parameter and the return type
call.setReturnType(XMLType.XSD_STRING);
call.addParameter(new QName("http://www.meizlik.com",strParamName1), XMLType.XSD_STRING, ParameterMode.IN);
call.addParameter(new QName("http://www.meizlik.com",strParamName2), XMLType.XSD_STRING, ParameterMode.IN);
// Catch the result and print it
// Parameter count is now ONE (1).
// call.setUseSOAPAction(true);//Not Necessary
call.setSOAPActionURI(strSoapAction);//Yes Necessary
String strResult = (String) call.invoke(
new Object[] {
new String(strParameterVal1),
new String(strParameterVal2)
System.out.println("Result='" + strResult + "'");
catch (Exception e)
e.printStackTrace();
System.out.println(e.toString());
}this code is giving me the exception as :
java.net.ConnectException: Operation timed out: connect due to invalid addressI visited web service URL http://www.meizlik.com/Service.asmx and its working fine.
I also tried Java Proxy method in WSAD 5.1 but it is showing me the same error.
Where am I wrong? Can anyone plz give me solution 4 this.
Thanks..Hi,
I have even generated folowing code with SoaMoa, it is perfect. Please try SoaMoa it is a useful tool.
The generated code of SoaMoa :
/* Generated Testcase by SoaMoa, :ridvan at Thu Jun 04 21:53:14 CEST 2009 */
import java.util.Map;
import javax.xml.namespace.QName;
import javax.xml.soap.MessageFactory;
import javax.xml.soap.SOAPBody;
import javax.xml.soap.SOAPConstants;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPMessage;
import javax.xml.soap.SOAPPart;
import javax.xml.ws.Dispatch;
import javax.xml.ws.Service;
import javax.xml.ws.BindingProvider;
import javax.xml.ws.soap.SOAPBinding;
import java.util.Iterator;
import junit.framework.TestCase;
public class BigAddTest extends TestCase {
public void testBigAdd() throws Exception {
String endpointURL = "http://www.meizlik.com/Service.asmx";
QName serviceName = new QName("http://www.meizlik.com", "Bob_Services");
QName portName = new QName("http://www.meizlik.com", "Bob_ServicesHttpPost");
Service service = Service.create(serviceName);
service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, endpointURL);
Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
BindingProvider bindingProvider = (BindingProvider) dispatch;
// Optionally Configure RequestContext to send SOAPAction HTTP
Map<String, Object> rc = bindingProvider.getRequestContext();
rc.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE);
rc.put(BindingProvider.SOAPACTION_URI_PROPERTY, "http://www.meizlik.com/BigAdd");
MessageFactory messagefactory = MessageFactory.newInstance(SOAPConstants.SOAP_1_1_PROTOCOL);
SOAPMessage request = messagefactory.createMessage();
SOAPPart part = request.getSOAPPart();
SOAPEnvelope env = part.getEnvelope();
SOAPBody body = env.getBody();
body.addNamespaceDeclaration("www", "http://www.meizlik.com");
SOAPElement BigAdd = body.addChildElement("BigAdd", "www");
SOAPElement addend_1 = BigAdd.addChildElement("addend_1", "www");
addend_1.addTextNode("11");
SOAPElement addend_2 = BigAdd.addChildElement("addend_2", "www");
addend_2.addTextNode("11");
request.saveChanges();
SOAPMessage response = dispatch.invoke(request);
SOAPBody replyBody = response.getSOAPBody();
SOAPElement BigAddResponse = (SOAPElement) replyBody.getChildElements(new QName("http://www.meizlik.com", "BigAddResponse")).next();
assertNotNull( "BigAddResponse is null", BigAddResponse);
SOAPElement BigAddResult = (SOAPElement) BigAddResponse.getChildElements(new QName("http://www.meizlik.com", "BigAddResult")).next();
assertNotNull( "BigAddResult is null", BigAddResult);
assertEquals("BigAddResult", "0000000000000000000000000022", BigAddResult.getTextContent());
} -
Java client for calling a XI web service
Hello,
does anyone have created a Java client
with Apache Axis? I tried it and it works
for web service which aren't provided by
SAP XI, but if I use to call a XI web service
something went wrong.
The XI web service works. I tested it with
XML Spy.
I think there must be something special with
XI web service.
So anyone got a tutorial/guide for this???
thanks
chrisHola mi nombre es Luis,
Creyendo que eres español te escribo en tal idioma.
He visto que a ti también te devolvía un error de autentificación 401, y que lo subsanaste, pero a mi con la solución que te dieron no me vale, ya que implemento el código que te ofrecieron para arreglarlo y ahora me da un fallo de "Server Error" poniendo en usuario y password, los correspondientes a XI.
+Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay req=new Request_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay();
wdContext.nodeRequest_MI_outTurnoverDetailsDisplay_MI_outTurnoverDetailsDisplay().bind(req);
req._setUser("username");
req._setPassword("password");+
No sé si es que ese usuario y contraseña son otros distintos.
Si pudieras ayudarme, te lo agradecería.
Un saludo, Luis -
How to call webservice using java client
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venujuser10394151 wrote:
Hi,
I am new to webservice related stuff.Can any body help me.
How can i call the webservice using simple java programing using jdeveloper tool is very useful for me.
Thanks
venujTry this simple webservice client.
You will need apache-axis.jar in your classpath. The following client is apache axis based. A similiar client can be built also using the JAX-WS only[without apache-axis.jar].
import org.apache.axis.client.Call;
import org.apache.axis.client.Service;
import javax.xml.namespace.QName;
public class WEBSERVICE_CLIENT{
public static void main(String [] args) {
try {
String endpoint ="<YOUR WS ENDPOINT>";
Service service = new Service();
Call call = (Call) service.createCall();
// YOU CAN SET VARIOUS PROPERTIES IN THE "CALL" OBJECT...LIKE
// USERNAME,PASSWORD,PROPERTIES OF HTTP HEADER. SEE "CALL" OBJECT'S API FOR MORE PROPERTIES.
call.setTargetEndpointAddress( new java.net.URL(endpoint) );
call.setOperationName(new QName("<YOUR WS SERVICE NAMESPACE>", "<WS SERVICE TO BE INVOKED>"));
String msg = (String) call.invoke( new Object[] { "data" } );
System.out.println("RETURNED MESSAGE : "+msg);
} catch (Exception e) {
System.err.println(e.toString());
} -
Hi',
I am trying to call OSB from java client,
The OSB proxy Service type is "WSDL Web Service", I am able to get response from SOAP UI with below request, Please help me with Java code,
I have been Googling a lot for this however didnt got enough.
Thanks
Yatan
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:v1="http://core.xxx.com/schema/ServiceHeader/V1.0" xmlns:v11="http://core.xxx.com/schema/Customer/V1.0" xmlns:v12="http://core.xxx.com/schema/Customer/V1.0">
<soapenv:Header>
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">
<wsse:UsernameToken wsu:Id="UsernameToken-2" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsse:Username>weblogic</wsse:Username>
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">welcome1</wsse:Password>
</wsse:UsernameToken>
</wsse:Security>
<v1:GMWSHeader>
<v1:SourceId>String</v1:SourceId>
<v1:TransactionId>String</v1:TransactionId>
<v1:TransactionTimeStamp>1967-08-13</v1:TransactionTimeStamp>
<v1:ServiceVersion>LATEST</v1:ServiceVersion>
</v1:GMWSHeader>
</soapenv:Header>
<soapenv:Body>
<v11:GetDetailsRequest>
<v11:Condition>
<v12:SellingSource>?</v12:SellingSource>
<v12:FulfillingFCNNbr>?</v12:FulfillingFCNNbr>
</v11:Condition>
</v11:GetDetailsRequest>
</soapenv:Body>
</soapenv:Envelope>Thanks Guys, I tried the ways you mentioned I am getting below error, this error is coming in both weblogic clientgen and webservice proxy from jdeveloper,
I understand that this error has something to do with my process however not sure why is it coming, I will really appreciate if you can provide me some pointers.
error:
Buildfile: C:\JDeveloper\OSBClient\TestOSBClient\build.xml
javaFromWSDL:
[clientgen]
*********** jax-ws clientgen attribute settings ***************
wsdlURI: http://localhost:8001/xx/som/contracts/CustomerContract?wsdl
packageName : com.osb.client
destDir : C:\OSB
*********** jax-ws clientgen attribute settings end ***************
[clientgen] Consider using <depends>/<produces> so that wsimport won't do unnecessary compilation
[clientgen] parsing WSDL...
[clientgen]
[clientgen]
[clientgen] [ERROR] A class/interface with the same name "com.osb.client.SOMMessage" is already in use. Use a class customization to resolve this conflict.
[clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Relevant to above error) another "SOMMessage" is generated from here.
[clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] A class/interface with the same name "com.osb.client.TaskCompletionMessage" is already in use. Use a class customization to resolve this conflict.
[clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Relevant to above error) another "TaskCompletionMessage" is generated from here.
[clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
[clientgen] line 89 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Related to above error) This is the other declaration.
[clientgen] line 51 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] Two declarations cause a collision in the ObjectFactory class.
[clientgen] line 82 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
[clientgen] [ERROR] (Related to above error) This is the other declaration.
[clientgen] line 76 of http://localhost:8001/xx/som/contracts/CustomerContract?SCHEMA%2FSOMResources%2FXSD%2FSOMCommon
[clientgen]
BUILD FAILED
weblogic.wsee.tools.WsBuildException: Error running JAX-WS clientgen: null
at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:175)
at weblogic.wsee.tools.anttasks.ClientGenFacadeTask.execute(ClientGenFacadeTask.java:244)
at weblogic.wsee.tools.anttasks.ClientGenTask.execute(ClientGenTask.java:365)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatinxxethodAccessorImpl.invoke(DelegatinxxethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.Main.start(Main.java:179)
at org.apache.tools.ant.Main.main(Main.java:268)
Caused by: Error starting wsimport:
at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:757)
at weblogic.wsee.tools.clientgen.jaxws.ClientGenImpl.execute(ClientGenImpl.java:169)
... 19 more
Caused by: com.sun.tools.ws.wscompile.AbortException
at com.sun.tools.ws.processor.modeler.wsdl.JAXBModelBuilder.bind(JAXBModelBuilder.java:136)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildJAXBModel(WSDLModeler.java:2255)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.internalBuildModel(WSDLModeler.java:194)
at com.sun.tools.ws.processor.modeler.wsdl.WSDLModeler.buildModel(WSDLModeler.java:140)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:261)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:203)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:188)
at com.sun.tools.ws.ant.WsImport2.execute(WsImport2.java:738)
... 20 more
Total time: 3 seconds -
Problem defining a java client on tomcat to call the esb web service
Dear Support,
I have a java program that has been incorporated on the oracle SOA suite. We now have a problem defining a java client on tomcat to call the esb web service. The Oracle SOA part is running fine”.
The software versions we are using :
1 - Oracle SOA suite on 10.1.3.3 Oracle AS
2 – Java 1.5
3 – Tomcat 5.5
4 – OS XP ProfessionalIf you have a main method in jour generated WSclient class (by the proxy) add the following code below the //add your own code:
AddFileResponseType testResponse = myPort.addFile(testRequest);
where AddFileResponseType is the responsetype of the WS and addFile is the method to call. this is just an example of my own webservice.
Next stap is to put the cursor in the main method and choos debug or run.
This should invoke the main method en call the webservice
I hope this helps you
Kim -
Calling Java - Client application Through Servlet/JSP/HTML
Hi,
I have a Java Client Application to display presentation(BI Bean) , made thru wizard provided in JDev.
Now i want to open this application from a link in HTML page.
I am running the application thru J Developer only.
please help,
thanks,
VaibhavHi,
Thanx for ur help..
My application is a JSP one..
My J Client application is named :-
BIApplication1.java.
When i call it thru JSP..
BIApplication1 bi=new BIApplication1();
bi.setSize(800, 620);
bi.setVisible(true);
the application opens..
but when i attempt to open a presentation..
it give me the following error..
"no configuration file found"
but when i open BIApplication independently..it works just fine...
thanks,
Vaibhav -
Calling a webservice(JAX-RPC) from non java client ?
Hi,
I read JAX-RPC is used for accessing webservices by calling the webservice methods from a java-based client.
Is it possible to call the Webservice methods(writeen using jax-rpc) from a non-java client,who sends his request in the form of SOAP based calls?
If JAX-RPC is not the correct one to call a RPC from a non-java client,In what way i can do this?
Can anyone please clarify my doubt..,
Thanks in Advance
Rao.,Hi Arun,
Can i write a my client program using cgi scripts?
In the JAX-RPC docs it was said that i can invoke my Webservices through my Service endpoints or using WSDL location?
If iam using a Non-java Client,it will be easier(I think) to use the WSDL file to call the Web-Service(deployed using JAX-RPC).But,the Client should be aware of that WSDL file.
I have to develop a small Application using webServices(must use XML,SOAP technologies).The user will pass some Parameters as request and the Response should be an XML(SOAP message) message.User should be able to request via browser.(http://localhost:8080/)
Can you please suggest me which technology is correct to use,so that i can use the XML,SOAP in it.
Please let me know...,
thank you once again..,
Regards
Rao., -
ESB Webservice call from Java client
Hi,
i need to call webservice from Java client which inturn will call ESB
I tried creating proxy from the WSDL in jDeveloper and tried setting the following end points
My concrete WSDL path :http://10.237.25.63:8889/esb/wsil/SubroCaseESBSystem/InputRouter?wsdl
My EM -path:"http://10.237.25.63:8889/event/subrotest/SubroInputrouter"
When i call the concreteWSDL im getting
"HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Bad response: 405 Method Not Allowed"
If i call the EM pathim getting
"javax.xml.rpc.soap.SOAPFaultException"
Any guess as how i need to call my ESB from client.Hello Venkat,
- I have created Java Proxy using Jdeveloper for ESB webservice and I usually use http://host:port/event/...?wsdl, and it creates stub which works without any modification. Let me know, may be I can try sending sample project
- I would like to verify if you are having issue with Java client or ESB itself, are you able to execute that ESB process/service from EM test page or from any other BPEL process?
Regards,
Chintan -
Calling ABAP BAPIs from a JAVA client - Web Services vs. JCo
Hi All,
When calling BAPIs from a JAVA client, what are the pros/cons for making the call employing JCo vs web service technologies. I understand that using SOAP would play better into the SOA theme and that there are nice tools to generate a WSDL document from a BAPI. Aside from the obvious, are there any performance considerations and/or other major pros/cons to each
Thanks,
MarkHi Mark,
Have you got any information on this. If you have any information on this pls forward to me at <b>[email protected]</b> I am also having this confusion. My question is a bit deviating from your point. If we use XI when developing WDJs with WS, will it help in improving performance and maintenance.will it give any advantage if I use XI with BAPIs to connecto backend from WDJ apps. I got this confusion, becasue of a requirement to develop WDJ apps that will be accessed by 50,000 users. Somebody told client that use of XI willimprove performance.
Any help is greatful
Regards
Ravindra
Message was edited by:
Ravindra Babu Tanguturi -
J2me Mobile client calling method which return byte[]
java.rmi.MarshalException: Expected Byte, received: SGVsbG8gV29ybGQ=
WebService1_Stub ws=new WebService1_Stub();
try {
String s=ws.getStringHelloWorld();// works fine
byte s[]=ws.helloWorld(); // error java.rmi.MarshalException: Expected Byte, received: SGVsbG8gV29ybGQ=
}catch(Expception e){
ex.printStackTrace();
}This same ws working fine in java standalone application please guide me what can be a problem ??
Regards
Haroon Idreesclear your app. server logs ( or make copies of them if will you need them) and redo the whole process. check out the logs and you should see some reason for this. i do not know if Borland's logs will turn out helpful, but it did help me out in certain other situations.
-
How do I call an ejb from a java client?
I put ejb classes in a jar file along with java client code and deployed it on my OC4J server. Now I am trying to run the ejb by calling the client code on my OC4J server from the command line but I am not having success. Am I doing this the right way? Should I also deploy my client code? Should the client code also be in a directory on my OC4J server?
MikeHi. Here is a part of the code for a java client. In this particular case it is also an EJB but it is a Message Driven Bean.
public class MDBEjbMecomsIFSBean implements MessageDrivenBean,
MessageListener {
// context
private MessageDrivenContext m_ctx = null;
// properties filename
private String m_propFile = DEF_PROPFILE;
// application
private String m_app;
// callable function from properties
// private String m_dsJndiName;
// private String m_dsType;
// private String m_dsFunc;
private int m_connRetryMax;
private int m_connRetryWait;
// initial stylesheet transformation file
private String m_xsltFile;
// web service operation name
private String m_operationName;
// trap emitter members from properties
private String m_trapMbeanURL;
private String m_trapObjectName;
private String m_trapAction;
private String m_trapAppName;
private Severity m_trapMax = Severity.CRITICAL;
private int m_trapAfterDelivery;
private boolean m_trapStart;
// jmx members for auto shutdown from properties
private String m_mdbMbeanURL;
private String m_mdbMbeanAccount;
private String m_mdbMbeanPassword;
private String m_mdbObjectName;
private String m_mdbAutoShutdown;
// clob allocator to be used by Oracle jdbc call
// private CLOB m_clob;
* Remember the context for this MDB.
* @param ctx the context for this MDB
public void setMessageDrivenContext(MessageDrivenContext ctx) {
logger.log(Level.FINEST, "Setting MessageDrivenContext");
m_ctx = ctx;
* ejbCreate() is called when the server wants to create a new instance of this MDB.
* At this time a connection with the target is established and the callable statement
public void ejbCreate() {
readProperties();
// Connection errors are IGNORED, because it seems that raising Exceptions from here
// does NOT result in a container managed rollback. Instead the dequeue is commited,
// resulting in AQ message status 2 (success).
// By ignoring the fault, another Exception will occurr in onMessage(), from where
// a propagated exception DOES result in a rollback.
String logStr = "Started TenneT-MDB-" + m_app;
logger.log(Level.FINEST, prefixLog(logStr));
if (m_trapStart)
notify(Severity.NORMAL, logStr);
* This method is called whenever a message is sent to the queue associated with this MDB.
* @param msg assumed to be a javax.jms.TextMessage containting an xml string
public void onMessage(Message msg) {
* msg id, timestamp and length are logged at info level
* msg content is logged at debug level
String msgText = "uninitialized";
String msgId = "undefined";
int msgDeliveryCount = 0;
// this block retrieves msg info from the jms header
// errors are logged as info and ignored
try {
// get msgid first so any subsequent error can be associated with the msg
msgId = msg.getJMSMessageID();
logger.log(Level.FINE, prefixLog("MessageID: " + msgId));
logger.log(Level.FINE,
prefixLog("Enq_time : " + msg.getJMSTimestamp()));
// delivery count can be used to send a critical trap only on the last retry
if (msg.propertyExists(JMS_X_RCV_TIMESTAMP)) {
logger.log(Level.FINE,
prefixLog("Deq_time : " + msg.getIntProperty(JMS_X_RCV_TIMESTAMP)));
// delivery count can be used to send a critical trap only on the last retry
if (msg.propertyExists(JMS_X_DELIVERY_COUNT)) {
msgDeliveryCount = msg.getIntProperty(JMS_X_DELIVERY_COUNT);
logger.log(Level.FINE,
prefixLog("DeliveryCnt: " + msgDeliveryCount));
} catch (Exception e) {
String errStr =
"Minor exception in JMSConsumeMDBBean.onMessage() receiving msg \"" +
msgId + "\": " + e.getMessage();
logger.log(Level.SEVERE, prefixLog(errStr));
// next the message content is addressed
try {
TextMessage message = (TextMessage)msg;
msgText = message.getText();
logger.log(Level.FINE,
prefixLog("MessageLength: " + msgText.length()));
logger.log(Level.FINEST, prefixLog("Msg: " + msgText));
} catch (Exception e) {
String errStr =
"Error in JMSConsumeMDBBean.onMessage() retrieving msg \"" +
msgId + "\": " + e.getMessage();
logger.log(Level.SEVERE, prefixLog(errStr));
notify(Severity.CRITICAL, errStr);
throw new EJBException(errStr);
// From now we can do intial stylesheet transformation if necessary
try {
// Prepare input
XMLDocument xslInput;
XMLDocument xmlInput;
DOMParser parser = new DOMParser();
parser.setPreserveWhitespace(true);
// Parse XSL
parser.parse((MDBEjbMecomsIFSBean.class.getResourceAsStream(m_xsltFile)));
xslInput = parser.getDocument();
// Parse XML
parser.parse((Reader)new StringReader(msgText));
xmlInput = parser.getDocument();
// Instantiate XSL Processor
XSLProcessor processor = new XSLProcessor();
XSLStylesheet stylesheet;
stylesheet = processor.newXSLStylesheet(xslInput);
XMLDocumentFragment xmlOutput =
(XMLDocumentFragment)processor.processXSL(stylesheet,
xmlInput);
// Now prepare xml for use with entity bean
Document xmlDoc = new XMLDocument();
xmlDoc.appendChild(xmlOutput);
*// Invoke Entity Bean to perform lookup of destination Web Service*
Context ctx;
ctx = new InitialContext();
EBEjbMecomsIFSLocalHome ebOppIfsLH =
*(EBEjbMecomsIFSLocalHome)ctx.lookup("java:comp/env/ejb/local/EBEjbopp_ifs");*
EBEjbMecomsIFSLocal ebOppIfs;
ebOppIfs = ebOppIfsLH.create();
*// pass message content to entity bean*
ebOppIfs.setXMLmessage((Element)xmlDoc.getDocumentElement());
*// provide correct soap action*
ebOppIfs.setOperationName(m_operationName);;
*// do actual work*
ebOppIfs.doWork();
} catch (XSLException e) {
logger.log(Level.INFO,
prefixLog("XSL Exception during onMessage " +
e.getMessage()));
} catch (SAXException e) {
logger.log(Level.INFO,
prefixLog("SAX Exception during onMessage " +
e.getMessage()));
} catch (CreateException e) {
logger.log(Level.INFO,
prefixLog("Create Exception during onMessage " +
e.getMessage()));
} catch (NamingException e) {
logger.log(Level.INFO,
prefixLog("Naming Exception during onMessage " +
e.getMessage()));
} catch (IOException e) {
logger.log(Level.INFO,
prefixLog("IO Exception during onMessage " + e.getMessage()));
private void notify(Severity severity, String message) {
logger.log(Level.FINEST,
prefixLog("Started method notify() with severity level " +
severity));
try {
if (m_trapMbeanURL == null || m_trapMbeanURL.equals("")) {
logger.log(Level.WARNING,
prefixLog("No MBean URL! Skipping SNMP trap."));
} else {
logger.log(Level.INFO,
prefixLog("Setting up JMX connection with " +
m_trapMbeanURL));
ObjectName delegateName = null;
MBeanServerConnection mbsc = null;
try {
JMXServiceURL jmxServiceURL =
new JMXServiceURL(m_trapMbeanURL);
JMXConnector connector =
JMXConnectorFactory.connect(jmxServiceURL);
mbsc = connector.getMBeanServerConnection();
delegateName = new ObjectName(m_trapObjectName);
logger.log(Level.FINEST,
prefixLog("JMX connection established with " +
m_trapMbeanURL));
} catch (Exception ex) {
logger.log(Level.SEVERE,
prefixLog("Error while initializing JMX Server connection"),
ex);
throw new EJBException("Error while initializing JMX Server connection",
ex);
String localHost = null;
try {
InetAddress addr = InetAddress.getLocalHost();
localHost = addr.getCanonicalHostName();
logger.log(Level.FINEST,
prefixLog("Localhost=" + localHost));
} catch (UnknownHostException ex) {
logger.log(Level.SEVERE, prefixLog(ex.getMessage()), ex);
throw new EJBException(ex.getMessage(), ex);
// invoke the trapemitter
try {
if (mbsc != null) {
if (severity.ordinal() > m_trapMax.ordinal()) {
severity = m_trapMax;
String severityArg = severityMap.get(severity);
Object[] arguments =
{ severityArg, message, m_trapAppName, localHost };
String[] signature =
{ "java.lang.String", "java.lang.String",
"java.lang.String", "java.lang.String" };
mbsc.invoke(delegateName, m_trapAction, arguments,
signature);
logger.log(Level.INFO,
prefixLog("TrapEmitter invoked: severity=" +
severityArg + " - message=" +
message));
} else {
logger.log(Level.SEVERE,
prefixLog("Error: No MBean server connection established with " +
m_trapMbeanURL));
} catch (MBeanException e) {
logger.log(Level.SEVERE,
prefixLog("Error occured in invoked method"),
e);
} catch (ReflectionException e) {
logger.log(Level.SEVERE, prefixLog(e.getMessage()),
e.getCause());
} catch (IOException e) {
logger.log(Level.SEVERE,
prefixLog("A communication problem occurred when talking to the MBean server"),
e);
} catch (InstanceNotFoundException e) {
logger.log(Level.SEVERE,
prefixLog("The MBean specified is not registered in the MBean server."),
e);
} catch (Exception e) {
logger.log(Level.SEVERE,
prefixLog("Error in method notify. Handling resumes..."));
} finally {
if (severity.equals(Severity.CRITICAL)) {
stopConsuming();
private void stopConsuming() {
logger.log(Level.FINEST, prefixLog("Started method stopConsuming()"));
if ("true".equals(m_mdbAutoShutdown)) {
if (m_mdbMbeanURL == null || m_mdbMbeanURL == "") {
logger.log(Level.WARNING,
prefixLog("No MDB MBean URL! Skipping stopConsuming()."));
} else {
JMXConnector jmxCon = null;
try {
Hashtable<String, String> credentials =
new Hashtable<String, String>();
credentials.put("login", m_mdbMbeanAccount);
credentials.put("password", m_mdbMbeanPassword);
// Properties required to use the OC4J ORMI protocol
Hashtable env = new Hashtable();
env.put(JMXConnectorFactory.PROTOCOL_PROVIDER_PACKAGES,
"oracle.oc4j.admin.jmx.remote");
env.put(JMXConnector.CREDENTIALS, credentials);
JMXServiceURL serviceUrl =
new JMXServiceURL(m_mdbMbeanURL);
jmxCon =
JMXConnectorFactory.newJMXConnector(serviceUrl, env);
jmxCon.connect();
MBeanServerConnection mbs =
jmxCon.getMBeanServerConnection();
logger.log(Level.FINEST,
prefixLog("JMX connection established with " +
m_mdbMbeanURL));
ObjectName objectName = new ObjectName(m_mdbObjectName);
MessageDrivenBeanMBeanProxy MDBMBean =
(MessageDrivenBeanMBeanProxy)MBeanServerInvocationHandler.newProxyInstance(mbs,
objectName,
MessageDrivenBeanMBeanProxy.class,
false);
MDBMBean.stop();
logger.log(Level.WARNING,
prefixLog("Message consumption suspended"));
} catch (Exception ex) {
logger.log(Level.SEVERE,
prefixLog("Error while initializing JMX Server connection"),
ex);
throw new EJBException("Error while initializing JMX Server connection",
ex);
} else {
logger.log(Level.WARNING,
prefixLog("No AutoShutdown. property=false"));
* Called when the server no longer wants to keep this MDB instance.
* Closes the connection and statement objects created in <code>ejbCreate</code>.
public void ejbRemove() {
try {
cleanup();
} catch (Throwable t) {
logger.log(Level.SEVERE,
prefixLog("Error in ejbRemove(): " + t.getMessage()));
/* Cleanup resources cleanly */
private void cleanup() {
logger.log(Level.INFO, prefixLog("TenneTMDB.cleanup() called."));
// m_dsService = null;
// m_dsCall = null;
private String prefixLog(String logText) {
String logPrefix = "%" + m_app + ": ";
//System.out.println(logPrefix + logText);
return logPrefix + logText;
private void logCause(Throwable e, LogLevel logLevel) {
int i = 0;
String causeStr;
Throwable exception = e.getCause();
while (exception != null) {
i++;
causeStr = "Cause " + i + ": " + exception.getMessage();
switch (logLevel) {
case INFO:
logger.log(Level.INFO, prefixLog(causeStr));
break;
case WARN:
logger.log(Level.WARNING, prefixLog(causeStr));
break;
case ERROR:
logger.log(Level.SEVERE, prefixLog(causeStr));
exception = exception.getCause();
}
Maybe you are looking for
-
Web-Cam does not work on Lenovo G480, PLEAS HELP!!
Hello, I have a Lenovo G480 (20165), and my built-in Web-Cam is not working. When I enable it by pressing Fn+Esc the little light by the Web-Cam turns on, then shuts off after a second. So I downloaded the Lenovo Easy Capture, and when I open the sof
-
I am trying to revive my i-pod fifth generation because it has not been set up yet!! I am looking to wipe out everything on my i-pod and clean it out!! Thank you! Shawn Stopper
-
Hi, I am aware that this is community for After Effects, and also this example contains some objects probably maded in some 3D programs, but I want to hear opinion form an expert how exampes below are did: These are examples from one tv station i Eur
-
How to disable spell checker in editable forms?
Hello, everyone, Asking for an advice. I want to disable spell checking in an editable PDF form, since I don't have the dictionary of my language. Spell checking in this case is bit annoying and slows down the editing. I have the checker disabled in
-
How to manage work center in Production order
Hi, I am producing a material having one operation (suppose cutting), which I have mentioned in the routing. I have also mentioned the work center in routing on which cutting operation will be performed. When I make the Production order of 1000 pcs t