|
|
Doh. Of course. Sorry... You could use a JAX-RPC handler to add the necessary SOAP Header elements. Here's a sketch: public class MySessionIdHandler implements javax.xml.rpc.handler.Handler { ... public boolean handleRequest(MessageContext context) { try { SOAPMessageContext smc = (SOAPMessageContext) context; SOAPEnvelope envelope = smc.getMessage().getSOAPPart().getEnvelope(); SOAPFactory soapFactory = SOAPFactory.newInstance(); SOAPElement authHeaderElement = soapFactory.createElement("AuthenticationHeader", "nsprefix", "nsuri"); SOAPElement sessionIdElement = soapFactory.createElement("SessionID", "nsprefix", "nsuri"); sessionIdElement.addTextNode(MY_SESSION_ID); authHeaderElement.addChildElement(sessionIdElement); ... |
Hello, I thinmkl i'm missing soemthing - well i must be think cos i'm not understanding this i think i'm barking up the wrong tree - surely it can't be this hard !!! Most of the code i'm writing at the moment is server-side, so i haven't done any of the wsdlxml etc.. files yet If my client creates a header ... |
|
|
|
|
|
|
|
An easy way to send out a SOAP message with header is: String xmlString = "\n" + "\n" + " \n" + " \n" + " Tony\n" + " \n" + " \n" + " \n" + " \n" + " GENT\n" + " \n" + ... |
Here is the soap message after it is signed using AXIS 1.4, WSS4J 1.5: 123MIIB5jCCAU8CBEQyyzkwDQYJKoZIhvcNAQEFBQAwOjELMAkGA1UEBhMCVVMxDTALBgNVBAoTBEFN EwE9/d/aFPCf7CpqoKdbHSrhNN0= lCIbgyn1nzA/7Y2tAVQ+WuVTX/WoOKE0Xv1dOTDBJ+BIY1w6ulg17apQ2taLmfDHGEFtLOCO TKdvhev5CMNCvmsbZQVv5Mli+ttFSpumNf8yOkf0BwDCcSyTVbuiotJJXOFVGRTXB5oxIv8q ... |
Hi ALl, I am using AXIS 1.4 for the development of a webservice client. I am using WSAD 5.1 as the IDE. I have used the WSDL2Java tool to generate the Client stubs. The remote operation of the webservice that I need to invoke accepts an object as a parameter. Now this object will basically form the body part of the ... |
Hi all, I am using SAAJ to access web service. I am having a arbitary xml in my soap request. I am forming that xml seperately. but the problem is I am unable to add that xml document to the header element(In Soap body I can add another xml through body.addDocument() but Soap Header doesn't have one).I tried using header.addTextNode() but ... |
I'm using Axis2 and Rampart to encrypt SOAP messages. I'm trying to understand the structure of encrypted SOAP message. My current understanding is, the soap body is encrypted using AES-128, and the AES key is encrypted and embedded in the soap header, in tag. Is that right? could someone confirm? (or point out my mistakes) Here's a encrypted SOAP request ... |
|
Hi Team I need to communicate with a third party application via web service which is authenticated via a trust relationship which is established by using the OASIS specification called Username Token with the WSS: SOAP Message Service. Can anyone advice on the steps to do this authentication currently i had deployed the web service using eclipse3.1 the client i ... |
I create a simple axis Message whith this simple procedure : private static final String soapMsg2 = "" + "" + " " + " " + " Hello world!" + " " + " " + ""; Message msg = null; InputStream inStream = new ByteArrayInputStream(soapMsg2.getBytes()); msg ... |
|
|
Hello! Correct me if I am wrong, but if you are using JAXB in connection with JAX-WS, to marshal and unmarshal messages sent to and received by a web service, then JAXB will only concern itself with the contents of the SOAP body. Of course, JAXB can be used to marshal and unmarshal standalone XML fragments but will not automatically retrieve ... |
Hi Ivan and All, I have run further testing and it looks like the SchemaValidationFeature validates the SOAP body fine and also the SOAP header to some degree. The problem is that within the SOAP header, if a field is mandatory and is left blank, it is not flagged by the SchemaValidationFeature. It seems to pick out mandatory fields being left ... |
|
|
Im in need to read some info from SOAP header as well... What I have is a POJO class with @WebService and @Soap declaration and a few @WebMethod methods. In this case how will i read the soap header the web service takes me directly to my methods... If this type of web service cannot be used, then please tell me ... |
Hi all, I'm doing a client using axis-1.4... I'm dealing with trouble in removing namespace declaration "soapenv". I have tried removeNamespaceDeclaration(), but it didn't work. I have tested the header the axis generates using SoapUI, for the request containing this header web service gives error of "No WS-Security header found" But if I remove xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" and soapenv:mustUnderstand="0" from the request things ... |
Hi all, I am using JDK 1.4. I need all the supported jar's for creating a soapheader and adding it to the soap message. I created a sample client as below, but I get the jar mismatch errors, all the jars I downloaded are JDK 5.0 or 6.0 compatible. Currently it is a test client but I have to include this ... |
|
Hi all, I am writing a java client to consume a web service that I have no control of. The web service requires a sign message. I have configured Rampart to sign the message with file policy.xml and code. Server WS return this error: org.apache.axis2.AxisFault: SOAP header missing [java] at org.apache.rampart.handler.RampartReceiver.setFaultCodeAndThrowAxisFault(RampartReceiver.java:166) [java] at org.apache.rampart.handler.RampartReceiver.invoke(RampartReceiver.java:99) [java] at org.apache.axis2.engine.Phase.invoke(Phase.java:318) [java] at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:251) [java] ... |
|
Hi John, From your sample soap message, it looks like your service expects x509 security. In case you are using J2ee based client (client implementation in WAR or EAR file) this security could be configure using deployment descriptor. It requires a number of settings to be done in deployment descriptor along with the certificate. I do not remember the detailed steps ... |
Hi, SOAP actor or role definition is: Actor or Role is a global attribute can be used to indicate the recipient of a header element. The value of the SOAP actor attribute is a URI. The special URI "http://schemas.xmlsoap.org/soap/actor/next" indicates that the header element is intended for the very first SOAP application that processes the message. This is similar to the ... |
|
|
|
|
package com.netcentric.security.handlers; import java.io.IOException; import javax.com.urity.auth.callback.Callback; import javax.com.urity.auth.callback.CallbackHandler; import javax.com.urity.auth.callback.UnsupportedCallbackException; import org.apache.ws.com.urity.WSPasswordCallback; public class ServicePWCallback implements CallbackHandler { @Override public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException { try { for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof WSPasswordCallback) { WSPasswordCallback pc = (WSPasswordCallback) callbacks[i]; String login = pc.getIdentifier(); int n = pc.getUsage(); // this is 2 ... |
WS-Addressing Support WS-Addressing support for Axis2 is implemented by the addressing module. To enable addressing, you need to engage the addressing module in both server and client sides. 1. To enable addressing at the server side, you need to copy the addressing.mar file to the modules directory of the server's axis2 repository. To engage the module, add a to ... |
But the format I want to generate is : MIME-Version: 1.0 Content-Type: Multipart/Related; boundary=MIMEBoundary; type="text/xml" Content-Description: Transmission file for IRS MeF X-eFileRoutingCode: MEF --MIMEBoundary Content-Type: "text/xml"; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Location: Envelope2290 << And here is my SOAP.xml file>> --MIMEBoundary Content-Type: application/octet-stream Content-Transfer-Encoding: Binary Content-Location: MeFAttachment << And here is my attachment zip file>> --MIMEBoundary I am not able to generate the ... |
|
Hi my name's Michele i have a problem! I developed simply ws with JWSDP 2.0 (jax-wsi) I use wsimport for generate artifcats (with XAdditionalHeader), but for Method Async i don't have object for header, in other words i have this situation 1)Proxy with call Sync ok: public void WebMetod(Obj body,SoapAut header); // ok body and SoapAut (Header Soap) 2) Async ko: ... |
|