Soap response with cdata
I got one scenario SOAP-2-SAP where I receive a req in format in PI 7.0:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<Req>
<Message><![CDATA[<?xml version="1.0" encoding="UTF-8"?>
<ADT_A05>
...data...
</ADT_A05>]]></Message>
<Creator></Creator>
</Req>
</soapenv:Body>
</soapenv:Envelope>
Which I parse correctly, then I give my answer, which should contain a CDATA too, e.g.:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header/>
<SOAP:Body>
<Res>
<Message><!CDATA[[
...data....
]]></Message>
</Response>
</SOAP:Body>
</SOAP:Envelope>
Instead, the SOAP channel return this:
<SOAP:Envelope xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP:Header/>
<SOAP:Body>
<Response> <Message><ACK>
...data...
/ACK></Message>
</Res>
</SOAP:Body>
</SOAP:Envelope>
But btw, in monitor I can see the resp message, without soap envelope, of course:
<?xml version="1.0" ?>
<Res>
<Message>
<![CDATA[ <ACK>
...data...
</ACK>
]]>
</Message>
</Res>
Which is correct! Why the soap adapter convert the brackets into ascii code?
thx for help,
regards
Hi Paola,
please check following thread may be helpful to resolve your issue
Creating CDATA sections in output XML
Regards,
Amit
Similar Messages
-
Hi
My PI server is able to make a soap call to the SFDC ( webservice ) ...however the response that is received within PI
has a SOAP envelope...and hence the response mapping is going in error....because the source data type in response mapping doesnot match with the soap response ( with envelope )
<?xml version="1.0" encoding="UTF-8" ?>
- <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com">
- <soapenv:Body>
- <upsertResponse>
- <result>
<created>false</created>
<id>a0UT0000004aeaMMAQ</id>
<success>true</success>
</result>
</upsertResponse>
</soapenv:Body>
</soapenv:Envelope>
how do i handle thisHi,
I think there is an option while configuration of SOAP adapter, where you can define, not to keep SOAP envelop. Please check the option Conversion Parameters\Do Not Use SOAP Envelope and set it as per your requirement. That might solve the problem. Here is the link which can be helpful
http://help.sap.com/saphelp_nw04/helpdata/en/29/5bd93f130f9215e10000000a155106/content.htm
Alternatively you need a java mapping or XSLT mapping to remove the envelop.
Here is the java mapping code to remove SOAP envelop
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.Map;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import com.sap.aii.mapping.api.StreamTransformation;
import com.sap.aii.mapping.api.StreamTransformationException;
public class RemoveSoapEnvelop implements StreamTransformation{
public void execute(InputStream in, OutputStream out)
throws StreamTransformationException {
try
DocumentBuilderFactory factory=DocumentBuilderFactory.newInstance();
DocumentBuilder builderel=factory.newDocumentBuilder();
/*input document in form of XML*/
Document docIn=builderel.parse(in);
/*document after parsing*/
Document docOut=builderel.newDocument();
TransformerFactory tf=TransformerFactory.newInstance();
Transformer transform=tf.newTransformer();
Element root;
Node p;
NodeList l;
int mm,n1;
//if you need to include namespace use next two lines
//root=docOut.createElement("ns0:upsertResponse");
//root.setAttribute("xmlns:ns0","http://connectsystems.be/MAINFR/AccDocument");
root=docOut.createElement("upsertResponse");
p=docIn.getElementsByTagName("upsertResponse").item(0);
l=p.getChildNodes();
n1=l.getLength();
for(mm=0;mm<n1;++mm)
Node temp=docOut.importNode(l.item(mm),true);
root.appendChild(temp);
docOut.appendChild(root);
transform.transform(new DOMSource(docOut), new StreamResult(out));
catch(Exception e)
e.printStackTrace();
public void setParameter(Map arg0) {
public static void main(String[] args) {
try{
RemoveSoapEnvelop genFormat=new RemoveSoapEnvelop();
FileInputStream in=new FileInputStream("C:\\Apps\\my folder\\sdn\\sd2.xml");
FileOutputStream out=new FileOutputStream("C:\\Apps\\my folder\\sdn\\removedEnvelop.xml");
genFormat.execute(in,out);
catch(Exception e)
e.printStackTrace();
input xml file sd2.xml
<?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns="urn:enterprise.soap.sforce.com">
<soapenv:Body>
<upsertResponse>
<result>
<created>false</created>
<id>a0UT0000004aeaMMAQ</id>
<success>true</success>
</result>
</upsertResponse>
</soapenv:Body>
</soapenv:Envelope>
Here is the output xml removedEnvelop.xml
<?xml version="1.0" encoding="UTF-8" ?>
<upsertResponse>
<result>
<created>false</created>
<id>a0UT0000004aeaMMAQ</id>
<success>true</success>
</result>
</upsertResponse>
Helpful articles on java mapping for PI 7.1
http://wiki.sdn.sap.com/wiki/display/XI/SampleJAVAMappingcodeusingPI7.1+API
You can also try following XSLT mapping to get the same output as java mapping
<xsl:stylesheet version="1.0"
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="SOAP-ENV">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:for-each select="SOAP-ENV:Envelope/SOAP-ENV:Body">
<upsertResponse>
<result>
<xsl:variable name="var" select="normalize-space(.)"></xsl:variable>
<xsl:variable name="tokenizedSample" select="tokenize($var,' ')"/>
<created><xsl:value-of select="$tokenizedSample[1]"/></created>
<id><xsl:value-of select="$tokenizedSample[2]"/></id>
<success><xsl:value-of select="$tokenizedSample[3]"/></success>
</result>
</upsertResponse>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
Other than these please refer to following links for further examples on the topic
Remove SOAP-ENV tags from xml RECEIVER RESPONSE payload (XSL needed?)
Remove SOAP Envelop using XSLT mapping.
Hope this helps your cause.
regards
Anupam -
SOAP Response with WS-Addressing elements
Hi All,
I have an issue with the response message of SOAP - PI - RFC Sync scenario.
In the request of the SOAP message, we receive following header(WS-Addressing) Elements in the SOAP Header part of the envelope.
<wsa:Action wsu:Id="wssecurity_signature_id_281" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
http://partnername/interfacedetails
</wsa:Action>
<wsa:MessageID wsu:Id="wssecurity_signature_id_285" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
uuid:463BF10F-0126-4000-E000-604DAC152914
</wsa:MessageID>
<wsa:RelatesTo wsu:Id="wssecurity_signature_id_283" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
urn:uuid:02875597AE9A49ABAB1229340545618
</wsa:RelatesTo>
Now the issue is the, our interface partner(who actually sends the SOAP Request), wants SOAP response containing the above WS-Addressing elements.
Is it possible with SAP PI?. Can anybody help me with this.
By the way, our interface( SOAP-PI-RFC Sync ) working fine. We just need these elements inside SOAP Response.
Thanks in advance.
Kind Regards,
Prasad.Hi Prasad,
I am not sure if the problem is solved.
I guess you are talking about a scenario in which a non-SAP consumer sends a request to SAP ABAP provider. The consumer requests the enabling of WS-Addressing. The answer nothing is required to configure the ABAP provider, which will send back a SOAP response either with WS-A or without depending if WS-A is sent by the consumer or not. That might be the case that you can see these headers with the SXMB_MONI.
Hope this helps.
Regards,
Wei -
Hi all,
I have a scenario where PI is calling a webservice, the webservice has a response attachment having a CSV file. I want to know how to handle this attachment. I want to keep this attachment ina folder on our FTP to start another process, Can you please suggest?
Thanks
-KulwantJust to complement: if you're on PI 7.0, only chance would be to handle it on a custom adapter module. You'd need to read the attachment and save it directly to the file system (not so good solution).
On PI 7.1, you could handle it in the mapping level, using the new PI 7.1 Mapping API.
Best,
Henrique. -
SOAP client fails to validate SOAP Response
Hi,
I have developed and deployed a document style web service (with use="literal")
on Web Logic 7.0 server using servicegen ant task. I am using a non Web Logic
client to invoke this service.
The WSDL generated by the service, uses "elementFormDefault="qualified" but in
the SOAP response, all elements are not qualified by namespace. The client is
failing to validate this SOAP response against the types defined in WSDL file
because of this.
I would like to know how to generate a SOAP response with all elements qualified
with namaspace.
Thanks
Prasghhttp://newsgroups.bea.com/cgi-bin/dnewsweb?cmd=article&group=weblogic.developer.interest.webservices&item=2831&utag=
prasgh wrote:
>
Hi Bruce,
Thanks for your reply. It works fine with 8.1 but it doesn't with WLS 7.0. What
we have is 7.0. How can I resolve this on 7.0
Appreciate your help.
Thanks
Prasgh
Bruce Stephens <[email protected]> wrote:
Hello,
Are you using the latest WLS 7.0SP2?
We recently updated the interop instance: http://webservice.bea.com:7001
with WLS 8.1 so I don't have v7 stack (online) to show you, however I
did try it locally using the Compound1 test (doc/lit with
"elementFormDefault="qualified") and it works as shown below.
HTHs,
Bruce
<!--REQUEST.................-->
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Header>
</env:Header>
<env:Body>
<ns100:x_Person xmlns:ns100="http://soapinterop.org/xsd"
Male="true"
Name="sample string">
<ns101:Age
xmlns:ns101="http://soapinterop.org/xsd">20.2</ns101:Age>
<ns102:ID
xmlns:ns102="http://soapinterop.org/xsd">10.1</ns102:ID>
</ns100:x_Person>
</env:Body>
</env:Envelope>
Response from the server
<!--RESPONSE.................-->
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<ns100:result_Person xmlns:ns100="http://soapinterop.org/xsd"
Name="sample string"
Male="true">
<ns101:Age
xmlns:ns101="http://soapinterop.org/xsd">20.2</ns101:Age>
<ns102:ID
xmlns:ns102="http://soapinterop.org/xsd">10.1</ns102:ID>
</ns100:result_Person>
</env:Body>
</env:Envelope>
[email protected] wrote:
Hi,
I have developed and deployed a document style web service (with use="literal")
on Web Logic 7.0 server using servicegen ant task. I am using a nonWeb Logic
client to invoke this service.
The WSDL generated by the service, uses "elementFormDefault="qualified"but in
the SOAP response, all elements are not qualified by namespace. Theclient is
failing to validate this SOAP response against the types defined inWSDL file
because of this.
I would like to know how to generate a SOAP response with all elementsqualified
with namaspace.
Thanks
Prasgh -
How can i custom the xml soap response in my ws?
Hello there,
Im developing a ws in weblogic 10.2 and i need to return a complex type soap response with a custom xml created by me... can any one give me an advice on how can i do that? Im not used to soap ws
And i need to return a lot of info some times and some of them are ArrayList of an object. Like the info of a Client and all the contracts of this client (and the info of that contract)... a lot of xml element with childs.
Thanx in advance for any help
PS. I tried to post an xml as example but i couldnt do it using '{' code '}' tag
Edited by: mgaldames on 08-dic-2010 8:50Hi Riyaz,
Thanks for your immediate response.
Here is my requirement.
I have created a ZTABLE with Field AUART and this table is maintain table using SM30.
When I Press F4, it will giving the list of all the order types available in T003O table and can select one and I can proceed succussfully.
But when using SM30 I need to give '*' in the column for AUART which is not available in T003O table.
I need to save my entires for AUART with * also( The value "*" is not available in Check table T003O ).
Please let me know how can I do this.
Thanks in advance. -
MessageHandlers - caching of SOAP responses
I have a webservice which has a number of clients who will all consume the same
message once. I've determined that one of my bottlenecks is actually turning
the results of the EJB call into the SOAP message. Since all the clients will
receive the same message once I think it would be nice to cache the soap message
resulting from a call.
Can I use a message handler to do this, or will the SOAP message already have
been generated?Hi Tom,
Your previous reply clears things up :-) But for the record, serialization (converting
the value returned from the EJB to XML) has already occurred when the handleResponse(MessageContext)
method is called. That's why you can get access to (and manipulate) the SOAP response
in the handleResponse(MessageContext) method. This SOAP response has the value
returned from the EJB in it, when the handleResponse(MessageContext) method is
called.
Later,
Mike Wooten
"Tom Hennen" <[email protected]> wrote:
>
I need to call the EJB because what it returns will determine if the
message is
already cached. You see the ejb returns a message from a queue. That
message
needs to be removed from the queue, and the handler won't know if it
has the message
cached until it gets a response from the EJB.
At any rate it sounds like you're saying the serialization takes place
after handlerResponse
gets through with the Message? If that's the case then this won't work
anyways.
"Michael Wooten" <[email protected]> wrote:
Hi Tom,
You'd have to store something in the MessageContext DURING the handleRequest(MessageContext)
method processing, to make any sense here :-)
The JAX-RPC Handler infrastructure is only guaranteeing that the property
stored
during the handleRequest(MessageContext) call, will be available during
the handleResponse(MessageContext)
call.
I don't quite understand why you need to call the EJB, if you already
know what
the value of the return object will be. I'm assuming that the EJB will
return
the same result, for a given value assigned to the input arguments.If
this is
true, why can't you use a byte[] created from the payload of the <SOAPBody>
request,
as the cache item key. If you don't find the cache item key (you look
in the
handleRequest method), set a MessageContext property with the payload
byte[],
and call the EJB. When the EJB returns, retrieve the property and use
it to create
a cache item that has the value of the property as the key, and a byte[]
of the
SOAP response as a value. When the handleResponse method is called,it
will contain
the response that will become the cache item value. Create a byte[]from
it, assign
the value of the property as the key, and a byte[] of the SOAP response
as the
value. If you find the key in the cache during the handleRequest(MessageContext)
call, retreive the cache value, put it in a MessageContext property,
return false
from handleRequest(MessageContext), grab the MessageContext property
value in
the handleResponse(MessageContext) method, and create the SOAP response
with it.
I take it that this isn't something you can do in your situation :-)
Calling the EJB from inside the handleRequest(MessageContext) method
will still
have performance issues, because you'll still need to deal with serializing/deserializing
XML.
Regards,
Mike Wooten
"Tom Hennen" <[email protected]> wrote:
Hmm, that's what I was afraid of.
We actually have to call the EJB. Skipping it isn't an option.
The
ejb only
accesses data in memory, so caching it's response would be of little
value anyways.
When using RMI to bypass the jax-rpc stack I'm seeing CPU usage about
1/3 less
than when using webservices. Overall throughput also more than doubles.
Would I see a benefit to calling the EJB from the handleRequest method
and then
based upon it's response sticking a cached SOAP message into the message
context?
Of course this would bring up the problem of what to do if the message
hasn't
been cached (calling the EJB twice isn't allowed).
"Michael Wooten" <[email protected]> wrote:
Hi Tom,
The SOAP message will have already been created for both client andserver-side
JAX-RPC Handlers, but you can avoid the EJB call :-)
The flow is as follows:
1. Web service consumer code calls web service operation.
2. The client-side JAX-RPC stack creates a SOAP message from the call.
If a
client-side JAX-RPC Handler is in place for the called operation,
it's
handleRequest
callback method is invoked.
3. If handleRequest returns a true, or there is no client-side JAX-RPC
Handler
in place, the
JAX-RPC implementation connects to the endpoint URL and sends the
SOAP
message.
4. The server-side JAX-RPC stack invokes the handleRequest method,of
a server-side
JAX-RPC Handler for the operation, if one is defined. It (the server-side
JAX-RPC
stack) hasn't made the call to the EJB that is providing the service
implementation
yet.
NOTE: Seeing as the EJB hasn't been called yet, you could have thecode
in the
handleRequest method return a cached response. The assumption here,would
be that
this server-side JAX-RPC Handler had access to a shared database (or
a JCache-based
product), that it could query in the handleRequest method, and update
in the handleResponse
method. If the query returned a cached SOAP response, you would useit
to set
a property on the MessageContext object passed to handleRequest, using
the setProperty
method, and return false from handleRequest. The stack should then
bypass
invoking
the EJB and call the handleResponse, using the same MessageContextobject
you
set the property on in the handleRequest method. Call the getProperty
on the MessageContext
object in the handleResponse method, to get the cached SOAP response,
and use
it to replace the one currently in the SOAP response. If performance
is a major
factor (which sounds like the case), you might want to replace theshared
database
with an distributed cache product (i.e. Tangosol Coherence, an open-source
JCache
product, etc.), or an XML database :-)
5. If the handleRequest method of the server-side JAX-RPC Handler
returns
true,
or no server-side JAX-RPC Handler was defined for the operation, the
server-side
stack calls the EJB.
6. If a server-side JAX-RPC Handler is defined, the server-side stack
calls the
handleResponse method. If not, the stack uses the results of the EJB
call to create
the SOAP response.
7. If a client-side JAX-RPC Handler is defined, the client-side stack
calls the
handleResponse method. Afterwards, it processes the SOAP responseand
deserializes
the return value. If no client-side JAX-RPC Handler is defined, theclient-side
stack just processes the SOAP response and deserializes the return
value.
HTH,
Mike Wooten
"Tom Hennen" <[email protected]> wrote:
I have a webservice which has a number of clients who will all consume
the same
message once. I've determined that one of my bottlenecks is actually
turning
the results of the EJB call into the SOAP message. Since all the
clients
will
receive the same message once I think it would be nice to cache thesoap
message
resulting from a call.
Can I use a message handler to do this, or will the SOAP message
already
have
been generated? -
How to deal with complex SOAP responses when calling web services ???
Hi all,
I have an issue when calling a web service that returns a complex
SOAP response message. With simple responses (e. g. array of strings) it
worked.
I created the PDF as an Interactive form with Livecycle Designer 8.2.
The Javascript looks like this:
var cURL = "http://blabla";
var cTestString = "too";
SOAP.wireDump=true;
var response = SOAP.request(
cURL: cURL,
oRequest: {
"http://blabla.com/:complete" : {
arg0: cTestString
cAction: "http://bla.com:50000/"
var resp = response["http://blabla.com:serviceResponse"];
console.println("lenght:"+resp.length);
var myns = "http://blabla.com/namespace";
for (var nItem in resp.return)
console.println("" + nItem + " " + resp.return[nItem] );
for (var ConceptView in resp.return[nItem])
console.println(" "+resp.return[nItem].length);
console.println(" "+ConceptView+" "+resp.return[nItem][ConceptView] );
if (ConceptView == myns + ":Response")
for (var item2 in resp.return[nItem][ConceptView]){
console.println(" "+item2+" "+resp.return[nItem][ConceptView][item2] );
I call the service and when I realized that I do not find out the type of the object returned, I used the nested for-in-loops to iterate through it. But it seems that there is just one item in the Javascript object returned, although the SOAP message clearly shows that there are more than one item.
Can you help me?
One key problem when analyzing this issue is that I do not know at all
the Javascript type of response. We suspected it might be an array, but it is not
because the method .length returns "undefined". It would already be
helpful to know at least the type of this object and to know callable
methods and so on ...
Best regards
Christoph
P.S. As mentioned I used Livecycle Designer 8.2 and displayed and
debugged the document using Acrobat 9.Christoph,
Firstly LiveCycle Designer 8.2 is still not supported to develop forms as per my knowledge. The latest version compatible for SAP Interactive Forms is ALD 8.0.
There is a difference between Acrobat based forms and LiveCycle forms and based on your coding it looks to me that you are trying to create a LiveCycle based form with coding of Acrobat which is not supported in LiveCycle Desginer, which is why you may be getting the error.
I hope that does not confuse you, so may check this [link|http://www.acrobatusers.com/articles/2006/08/designer_or_forms/index.php] for some clear information on what point I was trying to make.
Chintan -
Synchronous RFC -- SOAP Scenario: problem with SOAP Response/Fault Mapping
Hi,
I've a synchronous RFC --> PI --> SOAP Scenario. The problem is that the message structure of the sending RFC doesn't match the Webservice Structure.
The (SAP standard) RFC has just a Request / Response message structure. Part of the Response Message structure is a exception structure.
The Webservice has a Request / Response message structure and in case of an error I get a SOAP:Fault.
Problem now is that I cannot configure that scenario without usage of BPM as I will have to map SOAP:Response or SOAP:Fault to the RFC Response structure.
Has anybody another idea to do that synchronous scenario (with usage of message mapping) without BPM?
BR
Holger1)
you maus define 3 mapping.
1)request
2)response
3)Fault
in Interface mapping define at response boths (2-3) mapping. its clear??
2)
otherwise sometjhing is not clear, why do you want fault?? why dont you get only response message. we implement this kind of response:
<response_MT>
<ID> (error ID)
<system> (target system)
<error> (Error Description)
</response>
by this way fault message is not needed. but if you must have it just follow the top of message else, propose second.
Thanks
Rodrigo
Thanks
Rodrigo
Edited by: Rodrigo Pertierra on Feb 25, 2008 11:52 AM -
Web service response contains SOAP Headers with "mustUnderstand" true
Hi
I have a requirement where in I have to consume a web service as adaptive web service model, and while executing the service pass a mandatory parameter to the soap header. We are able to set the mandatory parameter to the soad header. We got the code snippet to do this from a wiki link
http://wiki.sdn.sap.com/wiki/display/WDJava/FAQ-Models-AdaptiveWebService#FAQ-Models-AdaptiveWebService-WhatarethefunctionalgapsofthecurrentAdpativeWSModelImporter%3F
On executing the service now through web dynpro we are getting the below error
"Web service response contains SOAP Headers with "mustUnderstand" true which are not handled by the client runtime"
Any thoughts on how to handle this mustUnderstand attribute with some code snippet? Appreciate all help.
Thanks,
KN.Hi
Have you found the workaround?
Sorry for refreshing topic. Flag mustUnderstand ='1' in response is unussual thing.
BR -
SOAP Response Version Mismatch error with SAP web service
My company just recently upgraded to SAP CRM 7.
The old way of creating web services in SAP worked fine, but now, there is something a bit off with SAP. When I call the web service the send returns a Fault Event with the error : SOAP Response Version Mismatch
I had a simple web service created with only 1 text input and 1 text output to make sure that it wasn't the parameters or return type. I got the same error.
Searching on the forum or the web hasn't provided with any good answer to the issue.
Any thoughts on this?Problem solved
-
Unmarshal SOAP response, as raw XML String with JAXB
Hi,
I have a soap response, as raw xml (a java.lang.String), and I want to unmarshal it's content into the classes generated by wsimport.
This must be a simple task but I couldn't find a way to do it.
Can someone tell me how I can achieve this ?
Edited by: Raphael_Lemaire on May 25, 2010 8:30 AMRaphael_Lemaire wrote:
Yes it works this way.
I kind of hoped that i could use a jax-ws api to shorten the code.well, how exactly do you get that string full of xml? (as a side note, you need to be careful turning xml into strings, the data can easily broken if you don't translate the bytes into characters correctly). if you use the jaxws api to make soap calls, then you don't really need to deal with the xml at all.
Edited by: jtahlborn on May 26, 2010 7:38 AM -
Ws manager service fails with non-soap-response
I try to set up a service in wsm. Gateway, policy and service are defined via the defaults.
I can access my original service via BPEL and via the WSM test page, but calling the wsm service fails
with a non-soap-response error :
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns:p="http://schemas.oblix.com/ws/2003/08/Faults">p:Client.GenericFault</faultcode><faultstring>Service gibt Nicht-SOAP-Response zurück</faultstring><detail/></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
This is returned by the original web service :
<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:SendMessageResponse xmlns:n1="urn:ActionWebService"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</n1:SendMessageResponse>
</env:Body>
</env:Envelope>
What is going wrong here ?I try to set up a service in wsm. Gateway, policy and service are defined via the defaults.
I can access my original service via BPEL and via the WSM test page, but calling the wsm service fails
with a non-soap-response error :
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode xmlns:p="http://schemas.oblix.com/ws/2003/08/Faults">p:Client.GenericFault</faultcode><faultstring>Service gibt Nicht-SOAP-Response zurück</faultstring><detail/></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>
This is returned by the original web service :
<?xml version="1.0" encoding="UTF-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<env:Body>
<n1:SendMessageResponse xmlns:n1="urn:ActionWebService"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
</n1:SendMessageResponse>
</env:Body>
</env:Envelope>
What is going wrong here ? -
How do i return a CDATA section in a SOAP response?
hi,
i am relatively new to SOAP/web services. but i know what i want ;-). i naively thought that i could simply send a CDATA wrapped string in a SOAP response by simply doing SOAPElement.addTextNode("<![CDATA[..."). of course, WLS 8.1's javax.xml.soap implementation escapes the <pre>"<" & ">"</pre> as <pre>"<" and ">"</pre> in the response.
IF i could use the saaj 1.2 implementation, i would do something along the lines of the following to return a CDATA section in a SOAP response :
<pre>
org.w3c.dom.CDATASection myCDATASection ...;
SOAPBodyElement myBodyElement ...;
myBodyElement.appendChild(myCDATASection);
</pre>
or maybe even something like:
<pre>
String myCDATAString = "<![CDATA[...]]>";
javax.xml.soap.SOAPBody soapBody = ...;
javax.xml.parsers.DocumentBuilder builder = ...;
org.xml.sax.InputSource.InputSource inputSource = ...;
org.w3c.dom.Document document = builder.parse(inputSource);
soapBody.addDocument(document);
</pre>
but that is a BIG IF! of course, as i have learned after a lengthy trawl through this ng, WLS 8.1 uses its own implementation of the javax.xml.soap.* classes. in particular, weblogic's SOAPBody implementation is devoid of an addDocument(org.w3c.dom.Document) method. and SOAPBodyElement does not have an appendChild(org.w3c.dom.Node)
please, can anybody fill me in on how to go about doing what i am trying to do using WLS 8.1's javax.xml.soap classes?
many thanksif anybody else out there is also trying to do what i have described (return xml text in a soap response), the solution (told to me by my company's BEA rep) is to just add the raw xml text to the SOAPElement.addTextNode() and weblogic will do the right thing (namely, escape whatever needs to be escaped).
i had been lead to believe that you couldn't send entity refs (<pre>< and ></pre>) in a soap response. i was told i needed to wrap my raw xml in a CDATA section. but actually i don't need a CDATA section after all for the response i need to return (xml text). contrary to what i was lead to believe by another developer, entity refs are not a problem in a soap response (according to BEA, anyway). -
SOAP Response cannot be decoded.
Hello Everybody,
I created a simple web service in asp.net using the c# sharp language. The web service extracts data from an MS SQL Database, translates that data in to xml, assigns the xml to a string varible and returns the string varible to what ever called the service. I know the web service works becuase if you call it in a web browser at the following address http://www.jmmortimer.com/dataaccess/sqlhelper.asmx?wsdl, it will show you the xml that represents web service. Plus, I tested it by calling it in an asp.net application. However when I call it from a Flex 3 application it gives me the following error message. SOAP Response cannot be decoded. Raw response: " faultCode="DecodingError" faultDetail="null" The code that I have in Flex 3 is below. If anyone knows how to solve this problem, please let me know. Thanks in advance.
<?xml version="1.0" encoding="utf-8"?>
<mx:Application
xmlns:mx=http://www.adobe.com/2006/mxml layout="absolute">
<mx:Script>
<![CDATA[
import mx.rpc.soap.LoadEvent;
import mx.rpc.events.ResultEvent;
private function getData(evt:LoadEvent):void
var connString:String = "Data Source=Family\SQLExpress;Initial Catalog=SDJames;User ID=sa;Password=Password1";
var storedProc:String = "GetAuxiliaries";
myService.GetDataTable(connString, storedProc)
private function resultHandler(evt:ResultEvent):void
test.text = String(evt.result);
]]>
</mx:Script>
<mx:WebService id="myService" wsdl="http://jmmortimer.com/dataaccess/sqlhelper.asmx?WSDL"
load="getData(event)" result="resultHandler(event)" />
<mx:TextArea id="test" x="10" y="10" width="452" height="348"/>
</mx:Application>Hello Again Everybody,
I have found the answer to my problem. The Problem was that I had the wrong value assigned the variable "connString" insted of "Data Source=Family\SQLExpress;Initial Catalog=SDJames;User ID=sa;Password=Password1", it should have been "Data Source=Family\\SQLExpress;Initial Catalog=SDJames;User ID=sa;Password=Password1". Don't you just hate how just messing up with one character can mess up you entire application. Thanks to everybody who took time to look over my problem.
God Bless
Maybe you are looking for
-
It used to "open" but somehow must have flipped over to "save as"
-
I need help locating or locking my Iphone its been stolen.
-
Maximum model size of 32k reached
Hi I've reached the maximum model size of 32k. The problem is that the dashboard I'm creating is still only a fifth of what the final solution will be. So now I'm trying to think of ways to split the model into five models. And hopefully still mainta
-
Change home page of an application
How to change home page of an application ?
-
Needed - BW data model and list of Dimensions and Fact table from BW
Dear Friends, Can somebody please share SAP BW DATA MODEL (LOGICAL) and share the list of DIMENSION and FACT tables exist in BW? I don't have access to SAP or SAP BW and I am building data-mart and SAP FI/CO will be the source. Thank you very much in