Setting SOAPAction in Static Stub Java Client - weblogic.developer.interest.webservices.general(Archived)

I have a static stub java client which invokes a WSE-enabled .NET web service. I programmed my client based on
BEA documentation at http://e-docs.bea.com/wls/docs100/webserv_sec/message.html#wp237755. How would I specify the SOAP Action so that it would also appear in the SOAP Header?
.Net is expecting this in the SOAP Header:
<soap:Header>
<wsa:Action>urn:digimarc.com:ImageServer:WebServices/ImagingFolioFetchMostRecent</wsa:Action>
....
</soap:Header>
Snippets of my client code:
//beas.xml is the custom policy file
FileInputStream [] inbound_policy_array = new FileInputStream[1];
inbound_policy_array[0] = new FileInputStream("beas.xml");
FileInputStream [] outbound_policy_array = new FileInputStream[1];
outbound_policy_array[0] = new FileInputStream("beas.xml");
ImageService imageService = new ImageService_Impl(args[0]);
ImageServiceSoap array_of_policy_port = imageService.getImageServiceSoap("ImagingFolioFetchMostRecent", inbound_policy_array, outbound_policy_array);
List credProviders = new ArrayList();
CredentialProvider cp = new ClientUNTCredentialProvider("dotNet", "password");
credProviders.add(cp);
Stub stub = (Stub)array_of_policy_port;
stub._setProperty(WSSecurityContext.CREDENTIAL_PROVIDER_LIST, credProviders);
......
The error message I am getting is:
[java] java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security] FaultString [Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.] FaultActor [http://192.168.254.102/TestImageserver2007/DLImageService.asmx]No Detail; nested exception is:
[java] javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.
[java] at digimarc.foto.webservice.clientstub.ImageServiceSoap_Stub.imagingFolioFetchMostRecent(ImageServiceSoap_Stub.java:137)
[java] at digimarc.foto.webservice.Client.main(Client.java:57)
[java] Caused by: javax.xml.rpc.soap.SOAPFaultException: Header http://schemas.xmlsoap.org/ws/2004/08/addressing:Action for ultimate recipient is required but not present in the message.

Related

Custom worklist authentication error.

We are trying to create a custom worklist application usingWe are using SAO suite 12.1.2.We created "web servise client and proxy" using wizards which Jdev 12.1.2 provides.Everything is OK.We tried to query human task using task query with following code.         TaskQueryService_Service taskQueryService_Service = new TaskQueryService_Service();        // Configure security feature        SecurityPoliciesFeature securityFeatures =            new SecurityPoliciesFeature(new String[] { "oracle/wss_http_token_client_policy" });        TaskQueryService taskQueryService = taskQueryService_Service.getTaskQueryServicePort(securityFeatures);        // Add your code to call the desired methods.               CredentialType credentialType = new CredentialType();        credentialType.setLogin("xxx");        credentialType.setPassword("xxx");        credentialType.setIdentityContext("jazn.com");          try {            taskQueryService.authenticate(credentialType);        } catch (WorkflowErrorMessage e) {            System.out.println("hata");                         }  But when we called taskQueryService.authenticate(credentialType) following exeption occurs.Thanks for your help. oracle.j2ee.ws.common.databinding.common.spi.DatabindingException: Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. at oracle.j2ee.ws.common.databinding.runtime.jaxb20.EclipselinkSerializerFactory.init(EclipselinkSerializerFactory.java:69) at oracle.j2ee.ws.common.databinding.runtime.spi.SerializerFactory.newInstance(SerializerFactory.java:55) at oracle.j2ee.ws.common.jaxws.runtime.ServiceEndpointRuntimeMetadata.createSerializerFactory(ServiceEndpointRuntimeMetadata.java:158) at oracle.j2ee.ws.common.jaxws.runtime.SoapInvocationSerializer.init(SoapInvocationSerializer.java:65) at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializer.init(SoapRequestorSerializer.java:64) at oracle.j2ee.ws.common.jaxws.runtime.SoapSerializerManager.getSerializer(SoapSerializerManager.java:55) at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializerManager.getSerializer(SoapRequestorSerializerManager.java:53) at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:233) at com.sun.proxy.$Proxy13.authenticate(Unknown Source) at com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryServicePortClient.main(TaskQueryServicePortClient.java:27) Caused by: javax.xml.bind.JAXBException: Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. - with linked exception: [Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.JAXBException Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType.] at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1135) at org.eclipse.persistence.jaxb.JAXBContext.(JAXBContext.java:193) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:165) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:152) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:112) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:102) at oracle.j2ee.ws.common.databinding.runtime.jaxb20.EclipselinkSerializerFactory.init(EclipselinkSerializerFactory.java:65) ... 9 more Caused by: Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.JAXBException Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. at org.eclipse.persistence.exceptions.JAXBException.nameCollision(JAXBException.java:219) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processTypeQName(AnnotationsProcessor.java:1898) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:856) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:773) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:302) at org.eclipse.persistence.jaxb.compiler.Generator.(Generator.java:158) at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1131) ... 15 more Exception in thread "main" java.lang.reflect.UndeclaredThrowableException at com.sun.proxy.$Proxy13.authenticate(Unknown Source) at com.oracle.xmlns.bpel.workflow.taskqueryservice.TaskQueryServicePortClient.main(TaskQueryServicePortClient.java:27) Caused by: oracle.j2ee.ws.common.databinding.common.spi.DatabindingException: Cannot create SerializerFactory for null at oracle.j2ee.ws.common.databinding.runtime.spi.SerializerFactory.newInstance(SerializerFactory.java:60) at oracle.j2ee.ws.common.jaxws.runtime.ServiceEndpointRuntimeMetadata.createSerializerFactory(ServiceEndpointRuntimeMetadata.java:158) at oracle.j2ee.ws.common.jaxws.runtime.SoapInvocationSerializer.init(SoapInvocationSerializer.java:65) at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializer.init(SoapRequestorSerializer.java:64) at oracle.j2ee.ws.common.jaxws.runtime.SoapSerializerManager.getSerializer(SoapSerializerManager.java:55) at oracle.j2ee.ws.client.jaxws.SoapRequestorSerializerManager.getSerializer(SoapRequestorSerializerManager.java:53) at oracle.j2ee.ws.client.jaxws.WsClientProxyInvocationHandler.invoke(WsClientProxyInvocationHandler.java:233) ... 2 more Caused by: oracle.j2ee.ws.common.databinding.common.spi.DatabindingException: Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. at oracle.j2ee.ws.common.databinding.runtime.jaxb20.EclipselinkSerializerFactory.init(EclipselinkSerializerFactory.java:69) at oracle.j2ee.ws.common.databinding.runtime.spi.SerializerFactory.newInstance(SerializerFactory.java:55) ... 8 more Caused by: javax.xml.bind.JAXBException: Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. - with linked exception: [Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.JAXBException Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType.] at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1135) at org.eclipse.persistence.jaxb.JAXBContext.(JAXBContext.java:193) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:165) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:152) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:112) at org.eclipse.persistence.jaxb.JAXBContextFactory.createContext(JAXBContextFactory.java:102) at oracle.j2ee.ws.common.databinding.runtime.jaxb20.EclipselinkSerializerFactory.init(EclipselinkSerializerFactory.java:65) ... 9 more Caused by: Exception [EclipseLink-50007] (Eclipse Persistence Services - 2.6.4.v20160829-44060b6): org.eclipse.persistence.exceptions.JAXBException Exception Description: Name collision.  Two classes have the XML type with uri http://xmlns.oracle.com/bpel/workflow/taskQueryService/types and name propertyType. at org.eclipse.persistence.exceptions.JAXBException.nameCollision(JAXBException.java:219) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processTypeQName(AnnotationsProcessor.java:1898) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.buildTypeInfo(AnnotationsProcessor.java:856) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.postBuildTypeInfo(AnnotationsProcessor.java:773) at org.eclipse.persistence.jaxb.compiler.AnnotationsProcessor.processClassesAndProperties(AnnotationsProcessor.java:302) at org.eclipse.persistence.jaxb.compiler.Generator.(Generator.java:158) at org.eclipse.persistence.jaxb.JAXBContext$TypeMappingInfoInput.createContextState(JAXBContext.java:1131) ... 15 more

Unable to get Webservices encryption to work.

Hi!
I have a Win2k machine, with weblogic workshop installed on it. I am playing with webservice security. I downloaded the webservice security sample that utilizes encryption on the client & server. I compiled the client, and set the appropriate security policies on both client and server.
When I run the client, I get an exception saying:
===================================================
[javac] Compiling 1 source file to D:\bea\user_projects\applications\Interop
\Security\Encryption\Client
[java] java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultExc
eption: Exception during processing: java.lang.AssertionError: weblogic.xml.stre
am.XMLStreamException: Unable to decrypt EncryptedKey - with nested exception:
[java] [weblogic.xml.security.encryption.EncryptionException: Unable to res
olve key wrapping key - with nested exception:
     [java] [weblogic.xml.security.keyinfo.KeyResolverException: Failed to resol
ve key from providers [] using weblogic.xml.security.keyinfo.KeyInfo{keyNames=si
ze:1[CN=client.com], keyValues=size:0[], x509Data=size:0[], encryptedKeys=size:0
[], tokenRefs=size:0[]}]] (see Fault Detail for stacktrace)
[java] Detail:
[java] <detail>
[java] <bea_fault:stacktrace xmlns:bea_fault="http://www.bea.com/servers
/wls70/webservice/fault/1.0.0">java.lang.AssertionError: weblogic.xml.stream.XML
StreamException: Unable to decrypt EncryptedKey - with nested exception:
[java] [weblogic.xml.security.encryption.EncryptionException: Unable to res
olve key wrapping key - with nested exception:
     [java] [weblogic.xml.security.keyinfo.KeyResolverException: Failed to resol
ve key from providers [] using weblogic.xml.security.keyinfo.KeyInfo{keyNames=si
ze:1[CN=client.com], keyValues=size:0[], x509Data=size:0[], encryptedKeys=size:0
[], tokenRefs=size:0[]}]]
===================================================
However, when I click on the webservice url, and go to the test console, it shows that the service was successful on the server, and a successful response was sent.
Why is this happening ? Why is the client throwing an exception, when the server is saying that everything was successful ?
Thanks.
feroze.

Unsupported Token Type: X.509

Hello,
I try to setup a 2-Way SSL connection with a Web Service and run in several problems. Can anybody of you provide me with support. In my opionion the handshake was successful, until the client reports this message. What does it mean?
Interner Anwendungsfehler: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: [S
ecurity:090380]Identity Assertion Failed, Unsupported Token Type: X.509
Detail:
null; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Asserti
on Failed, Unsupported Token Type: X.509
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: [Sec
urity:090380]Identity Assertion Failed, Unsupported Token Type: X.509
Detail:
null; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Asserti
on Failed, Unsupported Token Type: X.509
at com.itellium.ecom.webservice.EComAMSConnectionPort_Stub.operationalAv
ailability(EComAMSConnectionPort_Stub.java:30)
at Ssl2WayTest.main(Ssl2WayTest.java:122)
Caused by: javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Asse
rtion Failed, Unsupported Token Type: X.509
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.ja
va:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.j
ava:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
a:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.jav
a:443)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:303)
at com.itellium.ecom.webservice.EComAMSConnectionPort_Stub.operationalAv
ailability(EComAMSConnectionPort_Stub.java:25)
... 1 more
Kind regards,
Stefan 
I have the same problem, but no solution yet.
With
-Dwblogic.webservice.verbose=true -Dssl.debug=true
-Dweblogic.StdoutDebugEnabled=true
you'll see more details:
22485234 read B returns 483
<!-------------------- RESPONSE TO CLIENT --------------->
URL : https://DBGERWS1421.de.db.com:7004/services/legi
StatusCode : 401
Headers :
WWW-AUTHENTICATE = Basic realm="weblogic"
CONNECTION = Keep-Alive
CONTENT-LENGTH = 483
CONTENT-TYPE = text/xml
DATE = Wed, 16 Mar 2005 154457 GMT
Envelope :
<?xml version="1.0" encoding="utf-8" standalone="yes"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" x
lns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsd="htt
://www.w3.org/2001/XMLSchema"><env:Body><env:Fault><faultcode>Client.Authentication</faultcode><faultstring>[Security:090380
Identity Assertion Failed, Unsupported Token Type: X.509</faultstring></env:Fault></env:Body></env:Envelope>
<!-------------------- END RESPONSE TO CLIENT ----------->
NEW ALERT with Severity: WARNING, Type: 0
java.lang.Exception: New alert stack
at com.certicom.tls.record.alert.Alert.<init>(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.closeWriteHandler(Unknown Source)
at com.certicom.tls.interfaceimpl.TLSConnectionImpl.close(Unknown Source)
at javax.net.ssl.impl.SSLSocketImpl.close(Unknown Source)
at weblogic.webservice.binding.https.HttpsBindingInfo.closeSharedSocket(HttpsBindingInfo.java:145)
at weblogic.webservice.binding.https.HttpsClientBinding.releaseSocket(HttpsClientBinding.java:75)
at weblogic.webservice.binding.soap.HttpClientBinding.receive(HttpClientBinding.java:272)
at weblogic.webservice.core.handler.ClientHandler.handleResponse(ClientHandler.java:63)
at weblogic.webservice.core.HandlerChainImpl.handleResponse(HandlerChainImpl.java:231)
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:243)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:303)
at test.com.db.legi.ejb.LegiConnectorPort_Stub.checkPassword(LegiConnectorPort_Stub.java:27)
at test.com.db.legi.service.WSLegiTestClient.main(WSLegiTestClient.java:75)
avalable(): 22485234 : 0 + 0 = 0
write ALERT, offset = 0, length = 2
Wrong Password !!!
exception:
java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Assertion Failed, Unsu
ported Token Type: X.509
Detail:
null; nested exception is:
javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: X.509
at test.com.db.legi.ejb.LegiConnectorPort_Stub.checkPassword(LegiConnectorPort_Stub.java:38)
at test.com.db.legi.service.WSLegiTestClient.main(WSLegiTestClient.java:75)
Caused by: javax.xml.rpc.soap.SOAPFaultException: [Security:090380]Identity Assertion Failed, Unsupported Token Type: X.509
at weblogic.webservice.core.ClientDispatcher.receive(ClientDispatcher.java:313)
at weblogic.webservice.core.ClientDispatcher.dispatch(ClientDispatcher.java:144)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:457)
at weblogic.webservice.core.DefaultOperation.invoke(DefaultOperation.java:443)
at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:303)
at test.com.db.legi.ejb.LegiConnectorPort_Stub.checkPassword(LegiConnectorPort_Stub.java:27) 
Now I have the solution.
The error means
http://e-docs.bea.com/wls/docs81/messages/Security.html:
===
BEA-090380
Error: Identity Assertion Failed, Unsupported Token Type: tokenType
Description
The token type tokenType is not supported because it is not configured as an active type for any Identity Assertion provider.
Cause
Token type is not configured as an active type.
Action
Define the token type tokenType in the Active Types attribute of the configured Identity Assertion provider.
===
So I added in the console the type X.509 to Types:
Security->Realms->myrealm->Providers-->Authentication->
DefaultIdentityAsserter Tab General
then in Tab Details I activated
Use Default User Name Mapper
and eventually I created a corresponding user and it worked! 
I'm having similar issues, but my problem is a bit different.
I would rather that my software had access to the client certificate and authenticate the user on the application level. My problem is that Weblogic is forcing my hand to have the SSL certificate authenticated.
I can't put in a fixed user user UserNameMapper, as that would force the whole domain to use that class (and have it in the classpath).
So basically I need weblogic to handle SSL and ask the client to provide a certificate and just forget about mapping the certificate to a WL user.
I'm using 8.1sp5, and I already know how to access the certificate from the application. I just need to know how to turn off this silly mapping. 
Today I thought I found the answer to my problem. Unfortunately the server does not work according to specification.The page http://e-docs.bea.com/wls/docs81/webserv/wsp.html#web-service describes the attribute "ignoreAuthHeader" to the web-service element:
"Specifies that the Web Service ignore the Authorization HTTP header in the SOAP request.
Note: Be careful using this attribute. If you set the value of this attribute to True, WebLogic Server never authenticates a client application that is attempting to invoke a Web Service, even if access control security constraints have been defined for the EJB, Web Application, or Enterprise Application that make up the Web Service. Or in other words, a client application that does not provide athentication credentials is still allowed to invoke a Web Service that has security constraints defined on it.
Valid values are True and False. Default value is False."
It even emphasizes "never". However, when this is set to true, weblogic 8.1sp5 still tries to assert an identity to the caller based on the certificate.
How can I disable this inane feature?

SessionManagerServiceControl throwing error

Hi
I am using WebServiceControl mechanism to generate client side web service artifacts.On hitting the webservice method ,I am getting the below error:-
com.bea.control.ServiceControlException: Unexpected exception raised invoking getSession on control SendSMSWSDL.SessionManagerServiceControl. Use getCause() to see the root cause.[java.rmi.RemoteException: SOAPFaultException - FaultCode [{http://schemas.xmlsoap.org/soap/envelope/}Server] FaultString [Unable to add security token for identity] FaultActor [null]No Detail; nested exception is:
     weblogic.wsee.jaxrpc.soapfault.WLSOAPFaultException: Unable to add security token for identity]
     at com.bea.control.servicecontrol.impl.ServiceControlImpl.invoke(ServiceControlImpl.java:696)
I am tryiing to get the sessionid using Session Manager Web Service for establishing a session with Network Gatekeeper.
Could you please let me know how can I add security token for identity?
Regards,
Vidushi

Exception in calling web service from OAF page.

Hi,
I am trying to invoke a web service from OAF.
But my code error out at particular statement where I am sending the message i.e. at
SOAPMessage reply = connection.call(message, destination);
The error message is
java.security.privilegedactionexception: javax.xml.soap.SOAPException: Message send failed: For Input string "".
I am using the wsdl link in destination variable-
String destination = "http://soad.xxxxxxxxxx.org:80/soa-infra/services/default/xxxxxx/xxxxxxx?WSDL";
Please help me with the solution.

Categories

Resources