Log soap messages
I am using call.invoke() method for sending soap requests to a remote server..is there any way to log the soap request message i send and receive....
I am using call.invoke() method for sending soap requests to a remote server..is there any way to log the soap request message i send and receive....
Similar Messages
-
I need help on how to use handlers in Weblogic Workshop web services. I have the following logging handler from the bea documentation site.
Now, if I want to log my SOAP messages on the server side, do I just need to put the annotation:
* @jws:handler operation="handler.ConsoleLoggingHandler"
at the top of my JWS file? If that is the case, I don't see any messages being logged. Any help will be greatly appreciated.
Thanks.
gtata
package handler;
import java.util.Iterator;
import javax.xml.rpc.handler.MessageContext;
import javax.xml.rpc.handler.soap.SOAPMessageContext;
import javax.xml.soap.SOAPElement;
// for readability, using weblogic API instead of javax.xml.rpc.handler.GenericHandler
// See http://edocs.beasys.com/wls/docs81/webserv/interceptors.html#1060763
import weblogic.webservice.GenericHandler;
* Purpose: Log all messages to the Server console
public class ConsoleLoggingHandler extends GenericHandler
* Handles incoming web service requests and outgoing callback requests
public boolean handleRequest(MessageContext mc)
logSoapMessage(mc, "handleRequest");
return true;
* Handles outgoing web service responses and incoming callback responses
public boolean handleResponse(MessageContext mc)
this.logSoapMessage(mc, "handleResponse");
return true;
* Handles SOAP Faults that may occur during message processing
public boolean handleFault(MessageContext mc)
this.logSoapMessage(mc, "handleFault");
return true;
* Log the message to the server console using System.out
protected void logSoapMessage(MessageContext mc, String eventType)
try
System.out.println("*****************************");
System.out.println("Event: "+eventType);
System.out.println("Endpoint Method: " + getMethodName(mc));
System.out.println("Soap message is: \n " +
com.bea.wlw.runtime.jws.soap.util.SAAJUtil.SOAPPart2String(
((SOAPMessageContext)mc).getMessage() ) + "\n");
System.out.println("*****************************");
catch( Exception e )
e.printStackTrace();
* Get the method Name from a SOAP Payload.
protected String getMethodName(MessageContext mc)
String operationName = null;
try
SOAPMessageContext messageContext = (SOAPMessageContext) mc;
// assume the operation name is the first element
// after SOAP:Body element
Iterator i = messageContext.
getMessage().getSOAPPart().getEnvelope().getBody().getChildElements();
while ( i.hasNext() )
Object obj = i.next();
if(obj instanceof SOAPElement)
SOAPElement e = (SOAPElement) obj;
operationName = e.getElementName().getLocalName();
break;
catch(Exception e)
e.printStackTrace();
return operationName;
}You can use the logging and tracing functionality to write log statements anywhere in BPEL. refer http://wiki.open-esb.java.net/Wiki.jsp?page=LoggingFromWSBPELActivityInABusinessProcess . But you should keep in mind these are not soap messages that you log. They will be abstract WSDL message instances. If you want to log specifically the soap messages you need the support in HTTP-BC.
If you turn on logging you should see the line number of BPEL where it fails. That should give you some indication. I am not 100% sure, but in the logs, we should be logging the variable which was not initialized. I can't think of any other way to find out which variable caused this exception.
-Kiran Bhumana -
Logging soap messages invoked by BPEL process
Hi,
Is there any way to log the SOAP messages sent from an invoke? A receive?
Also, is there a way to capture which variable is throwing an uninitializedVariable exception?
JYou can use the logging and tracing functionality to write log statements anywhere in BPEL. refer http://wiki.open-esb.java.net/Wiki.jsp?page=LoggingFromWSBPELActivityInABusinessProcess . But you should keep in mind these are not soap messages that you log. They will be abstract WSDL message instances. If you want to log specifically the soap messages you need the support in HTTP-BC.
If you turn on logging you should see the line number of BPEL where it fails. That should give you some indication. I am not 100% sure, but in the logs, we should be logging the variable which was not initialized. I can't think of any other way to find out which variable caused this exception.
-Kiran Bhumana -
Hi!
I would like to check the outbound and inbound SOAP messages, can I do it?
So I have got a business service which calls remote webservice (OSB is a client here), i have to check the content of SOAP message (i use WS-security policy: digital signature, username+password)
Thank You very mucH!
ViktorHi Anuj!
Thank You for Your answer!
I have got a Routing action in my proxy service (which calls a business service), I see this on test console after I call the proxy service:
RouteNode1
Routed Service
+$outbound+
+$body+
+$header+
+$attachments+
Message Context Changes
added $outbound
changed $body
changed $attachments
changed $inbound
changed $header
So after the Message Context Changes I can see the eventual SOAP header which OSB will send?
I think I can't because the changed $body contains this XML:
+<soap:Body ...>+
+<soap:Fault>+
+<faultcode>code:FailedAuthentication</faultcode>+
+<faultstring>The security token could not be authenticated or authorized</faultstring>+
+<faultactor>https://...</faultactor>+
+</soap:Fault>+
+</soap:Body>+
I get this message back from remote webservice so the header above belongs to remote ws as well.
Or do I think badly?
Thanks! -
Hi,
I'm using weblogic 9 and weblogic web services. I would like to know how to configure weblogic for logging SOAP messages to a file/console. I have had a look at weblogic's log4j configuration but could'nt get any result.
Thanks a lot!Hi,
I'm using weblogic 9 and weblogic web services. I would like to know how to configure weblogic for logging SOAP messages to a file/console. I have had a look at weblogic's log4j configuration but could'nt get any result.
Thanks a lot! -
Dear All,
I wanted to log all my SOAP traffic so I created my own SOAPProvider for my Web Service Data Control.
I used below code
public class MySoapProvider extends SOAPProvider
private static final ADFLogger logger = ADFLogger.createADFLogger(MySoapProvider.class);
@Override
public void handleRequest(SOAPMessage soapMessage)
throws AdapterException
logSOAPMessage(soapMessage, "REQUEST");
super.handleRequest(soapMessage);
@Override
protected void handleResponse(SOAPMessage message) throws AdapterException {
logSOAPMessage(message, "RESPONSE");
super.handleResponse(message);
private void logSOAPMessage(SOAPMessage message, String origin){
ByteArrayOutputStream out = new ByteArrayOutputStream();
try {
message.writeTo(out);
} catch (Exception e) {
e.printStackTrace();
logger.info("SOAP Message :: " + origin + " :: " +out.toString());
}But it prints this line.
<SSSOAPProvider> <logSOAPMessage> Logging SOAP Message :: REQUEST :: oracle.j2ee.ws.saaj.soap.soap11.Message11@1466e35I am not sure, but how do you logged the SOAP envelope in ADF? I am expecting to print the soap header and soap body actually
ThanksThanks,
that set me in the right direction - I had tried the third parm before but must not have been just right being that there are multiple namespaces given. Appears I have to always use the namespace parm to accurately obtain the data. To conclude - this is what I ended up with to get this returning data properly:
SELECT
EXTRACTVALUE(VALUE(d),'/Destination/DestinationId', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS ID,
Get_Point(EXTRACTVALUE(VALUE(d),'/Destination/Longitude', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"'),
EXTRACTVALUE(VALUE(d),'/Destination/Latitude', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"')) AS geom,
EXTRACTVALUE(VALUE(p),'/Provider/ProviderName', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS provider_name,
EXTRACTVALUE(VALUE(p),'/Provider/ProviderSpecific/HospitalInformation/whoAvainFlu', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"') AS avaianflu,
VALUE(p) AS xmlb
FROM X_MEDAIRE xml
,TABLE (xmlsequence(EXTRACT(xml.object_value,
'/soap:Envelope/soap:Body/*', 'xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"'
))) e
,TABLE (xmlsequence(EXTRACT(VALUE(e),
'/long/path/after/soap', 'xmlns="http://xxx.xxx.xxx.xx/some_ws/"' ))) d
,TABLE (xmlsequence(EXTRACT(VALUE(d),
'/Destination/ProviderList/Provider', 'xmlns="http://xxx.xxx.xxx.xxx/some_ws/"' ))) p
WHERE
EXTRACTVALUE(VALUE(p),'/Provider/ProviderType', 'xmlns="http://xxx.xxx.xxx.xxx/some_ws/"') = 'Hospital' -
Hello,
I�m looking for a way to log all SOAP communication at a Axis Server.
I want to log the messages into my logdatabase or to files at least.
I am not interrested af SOAPMonitor or TCPMonitor, those are good tools but not for my purposes.
Anyone can help me out?Hi,
You should have a look at the Axis users guide, under "More deployment - Handlers and Chains". This part describes a LogHandler to be included in the WSDD that basically logs information about the requests and/or responses.
Also look at the class org.apache.axis.handlers.LogHandler -
Logging inbound SOAP Message in SALT 2.0
Is there a way to log the inbound SOAP message [valid or invalid] in SALT 2.0. We have a situation where the client is sending a SOAP message that we want to be able to intercept and log. The client is reporting that the SALT gateway is reporting an invalid SOAP message, we want to be able to log this message so we can let them know what we are receiving.
ThanksRam--
Everywhere in XI, the acronym "LCR" is synonymous with "SLD", System Landscape Directory. It seems like it may be a term they used early on, or maybe it's the German equivalent. The LCR acronym is sprinkled throughout SAP's underlying code.
In your error message, it's complaining about the Business System entry in the SLD.
My first thought would be that either the source or target business system is not configured in the SLD, or you haven't defined the business system properly in the SOAP adapter configuration. See the "XI20 Adapter Engine" manual for instructions on how to configure the SOAP adapter.
NOTE: You may be able to configure the SLD to make this solution work on your own, but for long-term usage, you're going to want an expert to model your system landscape and configure the SLD properly.
--Dan King
Capgemini -
How to Write Soap Message to Log File
Hello users,
Is there a config setting that causes soap messages to be written to the server log. I'm using JBoss/Turnkey. I found a reference in the JBoss documentation (Ch 5 J2EE Web Services) that offers this guidance:
(5.4. Monitoring webservices requests)
When processing web services requests, it is often useful to be able to observe the actual messages being passed between the client and the server. JBoss logs this information in the org.jboss.axis.transport.http.AxisServlet category.
To enable web services logging, add the following debug category to the log4j.xml file:
<category name="org.jboss.axis.transport.http.AxisServlet">
<priority value="DEBUG"/>
</category>
When enabled, all SOAP requests and responses will be logged to the server.log file.
Tried it but not working yet. Thanks for any help.
Jessehttp://www.google.com/search?q=java+web+service+tutorial&meta=
-
SAAJServet error when sending a SOAP message on 10.1.2
Hi,
We have deployed a server application in OC4J 10.1.2 with a servlet listening for SOAP messages (SAAJ 1.2). If we use Standalone OC4J with SSL enabled and HTTPS communication between client app and server, it works fine, but when we move it to an Application Server environment where client goes HTTPS to the frontend HTTP_Server and then AJP to the OC4J, the following exception appears on the application.log:
07/03/27 17:48:36 application/gpm-0.1: Servlet error
javax.servlet.ServletException: SAAJ POST failed Unable to internalize message
at com.sun.xml.messaging.soap.server.SAAJServlet.doPost(SAAJServlet.java:212)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind
Any ideas what can go wrong here, or where else to look?
Message was edited by:
[email protected]The standalone OC4J is 10.1.3, sorry. Nevertheless, we include all the libraries we use (saaj and dependencies) in the appliaction .ear archive that we deploy in both environments. May be a configuration issue?
-
ApplicationResponseFault with namespace longer than 60 in sync soap message
Hi,
we are on pi 7.0 and our scenario is a async-sync bpm. In the sync soap message, the webservice raise an application error. In the response soap message we get the following detail tag:
<detail><ApplicationResponseFault xmlns="http://schemas.datacontract.org/2004/07/BizLayerNT.ServiceLayer.v10"><DocumentResponse xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"><Response><ResponseCode xmlns="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">BusinessReject</ResponseCode></Response></DocumentResponse></ApplicationResponseFault></detail>
In sxi_monitor this application error isn't caught and a system error is generated.
In the system error message we get:
<SAP:Category>XIServer</SAP:Category>
<SAP:Code area="INTERNAL">HTTP_RESP_STATUS_CODE_NOT_OK</SAP:Code>
<SAP:P1>500</SAP:P1>
<SAP:P2>Internal Server Error</SAP:P2>
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>java.lang.NullPointerException at java.util.Hashtable.put(Hashtable.java:393) at com.sap.aii.messaging.mo.MessageContext.setAttribute(MessageContext.java:140) at com.sap.aii.adapter.xi.ms.XIMessage.updateHeaders(XIMessage.java:4271) at com.sap.aii.adapter.xi.ms.XIMessage.getTransportHeaders(XIMessage.java:572) at com.sap.aii.af.ra.ms.impl.ServerConnectionImpl.request(ServerConnectionImpl.java:212) at
In defaulttrace.trc we get ","<sap:ApplicationFaultMessageNamespace> is longer than 60 characters: http://schemas.datacontract.org/2004/07/BizLayerNT.ServiceLayer.v10",":
"09/04/2009","10:22:43:421","unable to generate the header map","Error","","com.sap.aii.adapter.xi.ms.XIMessage.getHeaderMap()","sap.com/com.sap.aii.af.app","SAPEngine_Application_Thread[impl:3]_14","34103150:F:\usr\sap\TPI\DVEBMGS03\j2ee\cluster\server0\log\defaultTrace.trc","001A64317EEE005E00005F2300000A6C000472BC344957CC","com.sap.aii.adapter.xi.ms.XIMessage","","","n/a","b82f88e0992b11dea4d8001a64317eee","","0","0","","0","","","0","com.sap.aii.adapter.xi.ms.XIMessage","SAPEngine_Application_Thread[impl:3]_14","","J2EE_GUEST",
"09/04/2009","10:22:43:421","<sap:ApplicationFaultMessageNamespace> is longer than 60 characters: http://schemas.datacontract.org/2004/07/BizLayerNT.ServiceLayer.v10","Error","","com.sap.aii.messaging.mo.xmb.XMBErrorHeader.marshal(XMLWriter)","sap.com/com.sap.aii.af.app","SAPEngine_Application_Thread[impl:3]_14","34103150:F:\usr\sap\TPI\DVEBMGS03\j2ee\cluster\server0\log\defaultTrace.trc","001A64317EEE005E00005F2200000A6C000472BC34495771","com.sap.aii.messaging.mo.xmb.XMBErrorHeader","http://schemas.datacontract.org/2004/07/BizLayerNT.ServiceLayer.v10,","http://schemas.datacontract.org/2004/07/BizLayerNT.ServiceLayer.v10,","n/a","b82f88e0992b11dea4d8001a64317eee","","0","0","","1","","","0","com.sap.aii.messaging.mo.xmb.XMBErrorHeader","SAPEngine_Application_Thread[impl:3]_14","","J2EE_GUEST",
"09/04/2009","10:22:43:421","Could not process message from 192.168.130.21 due to java.lang.NullPointerException.","Error","","com.sap.aii.af.ra.ms.impl.core.transport.http.MessagingServlet.doPost(HttpServletRequest, HttpServletResponse)","sap.com/com.sap.aii.af.ms.app","SAPEngine_Application_Thread[impl:3]_55","34103150:F:\usr\sap\TPI\DVEBMGS03\j2ee\cluster\server0\log\defaultTrace.trc","001A64317EEE0083000072F700000A6C000472BC344955F3","com.sap.aii.af.ra.ms.impl.core.transport.http.MessagingServlet","192.168.130.21,java.lang.NullPointerException,","192.168.130.21,java.lang.NullPointerException,","SAPDES_TPI_34103150","1d72b100992c11dec67f001a64317eee","PIISUSER","0","0","","1","","","15337","com.sap.aii.af.ra.ms.impl.core.transport.http.MessagingServlet","SAPEngine_Application_Thread[impl:3]_55","","PIISUSER",
"09/04/2009","10:22:43:421","The SAP XI Adapter Framework Messaging Service caught an exception during rendering an XML Message. Details can be found in the trace file for Location com.sap.aii.messaging.mo.xmb. Action: Please contact SAP Support and provide the trace file.","Error","/Applications/ExchangeInfrastructure/AdapterFramework/SAPLibraries/SAPXDK","com.sap.aii.messaging.mo.xmb.XMBErrorHeader.marshal(XMLWriter)","sap.com/com.sap.aii.af.app","SAPEngine_Application_Thread[impl:3]_14","34103150:F:\usr\sap\TPI\DVEBMGS03\j2ee\cluster\server0\log\defaultTrace.trc","001A64317EEE005E00005F2000000A6C000472BC3449559F","com.sap.aii.messaging.mo.xmb.XMBErrorHeader","","","n/a","b82f88e0992b11dea4d8001a64317eee","","0","0","","0","/Applications/ExchangeInfrastructure/AdapterFramework/SAPLibraries/SAPXDK","","0","com.sap.aii.messaging.mo.xmb.XMBErrorHeader","SAPEngine_Application_Thread[impl:3]_14","","J2EE_GUEST",
So I think the problem is due to the namespace length. I'm right?
We can't change the consumed webservice to reduce namespace length and our customer ask us to solve it in PI. Is there any way to change the namespace before to be treated and get a correct application error?
Thanks in advance,
Marc
Edited by: Marc Mauri on Sep 5, 2009 12:06 PMHi Neetesh,
we developed our own adapter module. We use it in our receiver soap adapter, module tab, before and after the standard module sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean.
In this audit log secuence you can see that the problem seems not to be solved, because the error is triggered when processing response message inside adapter module sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean, so our module is not called and the problem remains.
2009-09-22 19:06:41 Success Message successfully received by messaging system. Profile: XI URL: http://sapdes:50300/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
2009-09-22 19:06:41 Success The message status set to DLNG.
2009-09-22 19:06:41 Success Delivering to channel: CC_WS_DOS
2009-09-22 19:06:41 Success MP: Entering module processor
2009-09-22 19:06:41 Success MP: Processing local module *localejbs/AM_OWN_MODULE*
2009-09-22 19:06:41 Success GetHostName: Module called
2009-09-22 19:06:41 Warning Inside my own adapter Module <-- THIS IS A TRACE MESSAGE CODED INSIDE OUR MODULE
2009-09-22 19:06:41 Success MP: Processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
2009-09-22 19:06:41 Success SOAP: request message entering the adapter with user J2EE_GUEST
2009-09-22 19:06:41 Success SOAP: Web Services Security processing...
2009-09-22 19:06:41 Success SOAP: apply Web Services Security...
2009-09-22 19:06:41 Success SOAP: Web Services Security applied.
2009-09-22 19:06:42 Success SOAP: completed the processing
2009-09-22 19:06:42 Success SOAP: continuing to response message 4d2c88e0-a79a-11de-9ffa-001a64317eee
2009-09-22 19:06:42 Error SOAP: response message contains an error Application/UNKNOWN/APPLICATION_ERROR - application fault <----
THIS ERROR IS DUE TO NAMESPACE LENGHT (WE CAN SEE THIS ERROR IN DEFAULT_TRACE.LOG)
2009-09-22 19:06:42 Success MP: Processing local module localejbs/AM_OWN_MODULE
2009-09-22 19:06:42 Success MP: Leaving module processor
2009-09-22 19:06:43 Success The message was successfully delivered to the application using connection SOAP_http://sap.com/xi/XI/System. 2009-09-22 19:06:43 Success The message status set to DLVD.
Any suggestion?
Thanks in advance, -
High delay in deserializing soap message in Flex 3.0
We are developing a middle sized application using Flex and Axis Webservices. On the client side we AS code generated using Flex Builder 3.0 and the WSDL. On the server side we have Java code generated with Axis 1.3 using the same WSDL. The problems occurs when the server sends a 290Kb response to the Client. Flex spends 10 seconds (obtained from mx.rpc.* log facility) in deserialing this SOAP message. My question is:
¿Could I improve the performance of the deserialization?
Due to the fact that this is an unaceptable delay and that we have a code of 70.000 lines ¿what choices we have? ¿Should we use remote objects?
Thank youYes I think your app will perform better using remote objects, there's
a great app to test that named Census you can get it and do your own
tests or play with it on James Ward's blog.
Sincerely,
Michael
El 22/04/2009, a las 12:24, ijmarrero <[email protected]> escribió:
>
We are developing a middle sized application using Flex and Axis
Webservices. On the client side we AS code generated using Flex
Builder 3.0 and the WSDL. On the server side we have Java code
generated with Axis 1.3 using the same WSDL. The problems occurs
when the server sends a 290Kb response to the Client. Flex spends 10
seconds (obtained from mx.rpc.* log facility) in deserialing this
SOAP message. My question is:
>
¿Could I improve the performance of the deserialization?
>
Due to the fact that this is an unaceptable delay and that we have a
code of 70.000 lines ¿what choices we have? ¿Should we use remote ob
jects?
>
Thank you
> -
Outbound SOAP Message with Attachment
The requirement is to invoke a web service by sending attachments in the outbound SOAP message. The attachment body needs to be assigned in the message flow, using an element E1 extracted from the message incoming into the flow.
I am trying to use attachments variable to set content-type (text/xml) and body using E1. However, these are not getting assigned to attachments variable, as seen by logging the variable.
I was told that $attachments cannot be changed inside the flow (it is marked black in the console unlike the header and body that are marked green). If that is the case, how do we invoke services using attachments from a message flow?
Any pointers would be appreciated.Hi,
A SOAP message may need to be transmitted together with attachments of various sorts, ranging from facsimile images of legal documents to engineering drawings. Such data are often in some binary format. For example, most images on the Internet are transmitted using either GIF or JPEG data formats. In this document we describe a standard way to associate a SOAP message with one or more attachments in their native format in a multipart MIME structure for transport.
yes it is possible to send attachment with the SOAP.
SOAP Message Packages
A "SOAP message package" contains a primary SOAP 1.1 message. It may also contain additional entities that are not lexically within the SOAP message but are related in some manner. These entities may contain data in formats other than XML. The primary SOAP 1.1 message in a message package may reference the additional entities. Such additional entities are often informally referred to as "attachments." This section describes how to construct SOAP message packages and how SOAP processors will process them.
A SOAP message package is constructed using the Multipart/Related media type, which is defined in RFC 2387. The rules for the construction of SOAP message packages are as follows:
The primary SOAP 1.1 message must be carried in the root body part of the Multipart/Related structure. Consequently the type parameter of the Multipart/Related media header will always equal the Content-Type header for the primary SOAP 1.1 message, i.e., text/xml.
The MIME Multipart/Related encapsulation of a SOAP message is semantically equivalent to a SOAP protocol binding in that the SOAP message itself is not aware that it is being encapsulated. That is, there is nothing in the primary SOAP message proper that indicates that the SOAP message is encapsulated .
For more details you can refer these links
http://www.w3.org/TR/SOAP-attachments
http://www.w3.org/TR/soap12-af/
regards
Aashish Sinha
PS : reward points if helpful -
I use abapProxy to invoke an external webservice via SOAP adapter but i get an error "invalid http response: null" in sxmb_moni so i thought that there might be an mistake in request SOAP message and I installed TCPGateway to see logs about sending and coming message.
When i invoke the proxy, sending part of TCPGateway is empty but as you guess , coming part of it shows an error "java.net.ConnectException: Connection timed out : connect"
What maybe the reason for that SOAP adapter sends an empty SOAP message?
ThanksHi Abhishek;
As i mentioned , i used TCPGateway program on XI server to see going message to external webservice..this gateway program takes request and forwards it but it still comes as empty SOAP message from XI adapter to this TCPGateway program.
as you guess, when you send empty soap message , external webservice doesnt respond to this request so it gets timeout error.
ps: i tried to invoke this webservice via another third-party tool, it works properly.
What would another reason except firewall settings for this issue ? because i do all of these control on XI server, namely before empty soap message goes.
Thanks -
Changing the value of the SOAPElement in the SOAP message
Now another problem I encountered was of overwriting a value in the SOAP message by my value. SOAPElement interface which extends Node interface provides me the method getValue() to get the value of the node but doesnt give me any method to set any other value instead of this.
<token xsi:type="xsd:string">token123</token>
I want to replace the value "token123" with my value.
Is there no provision for altering a value in the SOAP message? Is this due to security contraints?
If yes then can we detach the same node and add a similar node with the new value. I wanted to try the same using addChildElements() method but then the problem here is how do I create a new SOAPElement in the handler as its an interface and not a class. Why I want to add a similar node is because I am having the definition of this object in the WSDL file, so if I attach the node corresponding to the parameter of the object then I would get the object populated with this value at J2EE or .net layer.
Also I thought of adding an attribute to the same node but then since this attribute will not be defined in the WSDL, the value of this attribute will not populate the java object at the J2EE layer. Hence attribute introduction also didnt help.
This is the userData object in the soap body:
</q1:FetchDetailsInput><q2:UserData xmlns:q2="java:com.anthem.enb.common.data" xsi:type="q2:UserData" id="id2">
<password xsi:type="xsd:string">12345</password>
<token xsi:type="xsd:string">token123</token>
<userID xsi:type="xsd:string">vikas123</userID>
</q2:UserData>
This is my code to extract the values from the above message:
Iterator i = ctx.getMessage().getSOAPPart().getEnvelope().getBody().getChildElements();
System.out.println(" i.hasNext() =" + i.hasNext());
while (i.hasNext())
Object obj = i.next();
System.out.println(" obj :" + obj.getClass());
if (obj instanceof SOAPElement)
SOAPElement e = (SOAPElement) obj;
System.out.println("e :" + e);
String operationName = e.getElementName().getLocalName();
LOG.info(CLASS_NAME + "operationName :" + operationName);
if (operationName.equals("UserData"))
Iterator j = e.getChildElements();
LOG.info(CLASS_NAME + " j.hasNext() : " + j.hasNext());
while (j.hasNext())
Object obj2 = j.next();
LOG.info(CLASS_NAME + " obj2 :" + obj2);
LOG.info(CLASS_NAME + " obj2 :" + obj2.getClass());
if (obj2 instanceof SOAPElement)
SOAPElement eGrandChild = (SOAPElement) obj2;
String operationName2 =
eGrandChild.getElementName().getLocalName();
if (operationName2.equals("userID"))
String strPass = eGrandChild.getValue();
LOG.info(CLASS_NAME + " strPass:" + strPass);
else if (operationName2.equals("password"))
String strUserID = eGrandChild.getValue();
LOG.info(CLASS_NAME + " strUserID:" + strUserID);
else if (operationName2.equals("token"))
String strToken = eGrandChild.getValue();
Please help.how do I create a new SOAPElement in the handler as its an interface and not a class?Here is an example:
<example>
MessageFactory messageFactory = MessageFactory.newInstance();
SOAPMessage m = messageFactory.createMessage();
SOAPEnvelope env = m.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();
SOAPElement fResponse =
body.addBodyElement(env.createName("fResponse"));
fResponse.addAttribute(env.createName("encodingStyle"),
"http://schemas.xmlsoap.org/soap/encoding/");
SOAPElement result =
fResponse.addChildElement(env.createName("result"));
result.addTextNode("test");
ctx.setMessage(m);
</example>
Jong
Maybe you are looking for
-
How do I get an actor to wait for its nested actors to stop running before stopping itself?
I'm developing a series of projects that are based on the Actor Framework and my actor dependency hierarchy is starting to get some depth. One of the issues I'm facing now is making sure that each actor will only stop running (and signal this via a L
-
When using Firefox to print most documents ( boarding passes, mastercard statements,genealogy documents) the printing only shows on 1/4 of the page, is in the lower left quarter and does not print part of the right side of the information. When I go
-
FRM-41361 Cannot navigate out of current form in Enter-Query Mode
Hi All, I am getting the FRM-41361 error in the bottom message area when opening a form from the function navigator. The issue does not exist when opening the form from the application homepage. The form is loaded in enter-query mode, and the enter_q
-
My new macbook pro (lion) iCal has been showing the wrong date?
My new macbook pro (lion) iCal has been showing the wrong date for stored events - even though i have put the appointment in on the right date when I look it up a week or so later it has changed? I think it might be showing 2011 date? How can i fix t
-
Ipod shuffle connected to a PC with a rootkit / malware
OK, so I tried to search this and only found some "old" posts....... Sorry If this is already covered - Please provide a link, if it is - thxs. So my ipod was connected to a windows PC, I got an "unable to disconnect, in use by another program" error