Soap response with envelope

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 this

Hi,
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

Similar Messages

  • 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

  • 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

  • SOAP response without envelope

    Hi!!!
    Anybody can help me please?
    I send a SOAP message to a WebService and I receive a reply message.
    The problem is that I can see correctly the answer using
    replyMessage.writeTo(System.out);
    but if I call
    SOAPBody body = reply.getSOAPBody();
    I have an Exception because the envelope (and obviously also the body) is null.
    I have the same problem using the sample uddiping, so I think that the error is not due to the WebService...
    I have Java version 1.4.2_04 and I use the JWSDP 1.6.
    I have included in my classpath all the libraries copied from JWSDP installation (activation.jar;FastInfoset.jar;saaj-api.jar;mail.jar;saaj-impl.jar;jaxp-api.jar;sax.jar;dom.jar;xercesImpl.jar;xalan.jar;)
    Thx in advice

    I solve the problem reading the source that is inside the SOAPPart
    SOAPPart lSoapPart = reply.getSOAPPart();
    JAXMStreamSource source = (JAXMStreamSource)lSoapPart.getContent();
    InputStream is = source.getInputStream();
    byte[] toRead = new byte[is.available()];
    is.read(toRead);
    String toRet = new String(toRead);
    In toRet there is the answer message in SOAP format...
    BUT WHY there isn't an ENVELOPE part?

  • SOAP Response with attachment

    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
    -Kulwant

    Just 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
    Prasgh

    http://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:50

    Hi 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?

  • 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 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
    Holger

    1)
    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 AM

    Raphael_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

  • Mapping problem in SOAP response to RFC response - RFC-XI-SOAP scenario

    Hi gurus,
    response structure from SOAP is as below (inbound msg - in SXMB_MONI)
    MONI and RWB shows successful(I am using graphical mapping)
    <?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
    - <!--  Inbound Message
      -->
    - <ns0:testrequestResponse xmlns:ns0="conversion" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" Status="Success">
    - <ns0:SAP_OUT>
           <ns0:F1 Value="1234" />
           <ns0:F2 Value="2345" />
         - <ns0:SAP_LINES>
             - <ns0:SAP_LINE>
                    <ns0:SAP_L Value="1" />
                    <ns0:Field5 Value="" />
                  - <ns0:SAP_S1>
                           - <ns0:SAP_S>
                                   <ns0:ID Value="11111" />
                                   <ns0:SAP__NO Value="0001" />
                                   <ns0:DATE1 Value="08/15/2008 00:00:00:000" />
                                   <ns0:FST/>
                             </ns0:SAP_S>
                    </ns0:SAP_S1>
             </ns0:SAP_LINE>
          </ns0:SAP_LINES>
      </ns0:SAP_OUT>
      </ns0:testrequestResponse>
    I make the RFC response with same structure and mapped it but it is not giving the full structure rather it is giving only this (Outbound Msg in SXMB_MONI)
      <?xml version="1.0" encoding="UTF-8" ?>
    - <ns1:Z_MYRFC.Response xmlns:ns1="urn:sap-  com:document:sap:rfc:functions">
      <STATUS>Success</STATUS>
      </ns1:Z_MYRFC.Response>
    what went wrong?

    Hi,
    You would have forgot to map parent node coming after <STATUS>Success</STATUS>
    Make sure that you have properly mapped all the parents and there child.
    Are you getting the same result while Testing it standalone?
    Thanks
    Sunil Singh

Maybe you are looking for