Extra node added to my SOAP response
When I call my test webservice, it seems coldfusion/axis
addes an extra "return" node to the reponse. Is there any way to
get rid of it? Any insight to why?
Here is an example of a webservice with a method of "test":
<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="
http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="
http://www.w3.org/2001/XMLSchema"
xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:TestResponse
soapenv:encodingStyle="
http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns1="
http://onesource.gmtorque.com/">
<TestReturn
xsi:type="xsd:string">test</TestReturn>
</ns1:TestResponse>
</soapenv:Body>
</soapenv:Envelope>
I expect the <TestResponse> node but not the
<TestReturn> node. Seems the response should just have the
<TestResponse>. How do I make it so the <TestReturn>
node is note part of the response?
It should be instant, try rebooting the device.
Similar Messages
-
BPEL process to create a PDF and send it as attachment in SOAP response
We have a requirement to have a webservice created using BPEL, which can receive input from a client and create a PDF using the input and send the PDF as attachment in the SOAP response.
We have found the below link in Oracle docs and our basic understanding on the functionality given is that the MIMEService is being used to read a SOAP attachment from some other service and send it as an attachment in the SOAP response to the requester. As explained above, this doesn't completely satisfy our requirement.
http://docs.oracle.com/cd/E11036_01/integrate.1013/b28981/manipdoc.htm#BABCJIAH
Please suggest if there is any other approach that suites our requirement.
Thanks.Hi,
I have a Weblogic webservice which returns me a PDF attachment as resposne ( here I have MIME related stuff).I need to get attachment as bpel response.
I have created a BPEL process to invoke the weblogic webservice. I have explictly added the MIME part in bpel.wsdl same as weblogic webservice wsdl.
I tried to assign the response variable( of type base64binary) of bpel.wsdl and my webservice .wsdl . I am getting some error with no attachment.
Below is my xsd used in BPEL.wsdl*
<?xml version="1.0" encoding="UTF-8"?>
<schema attributeFormDefault="unqualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"
xmlns="http://www.w3.org/2001/XMLSchema">
<complexType name="process">
<sequence>
<element name="input" type="string"/>
</sequence>
</complexType>
<complexType name="processResponse">
<sequence>
<element name="result" type="string"/>
</sequence>
</complexType>
<complexType name="GetAttachmentPDF">
<sequence>
<element minOccurs="0" name="Pdf" nillable="false" type="base64Binary"/>
</sequence>
</complexType>
</schema>
Below is my BPEL.wsdl*
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions name="BPELProcess1"
targetNamespace="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and use them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<wsdl:types>
<schema xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"
schemaLocation="xsd/BPELProcess1.xsd"/>
</schema>
</wsdl:types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<wsdl:message name="BPELProcess1RequestMessage">
<wsdl:part name="payload" type="client:process"/>
</wsdl:message>
<wsdl:message name="BPELProcess1ResponseMessage">
<wsdl:part name="payload" type="client:processResponse"/>
<wsdl:part name="attachment" type="client:GetAttachmentPDF"/>
</wsdl:message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the BPELProcess1 BPEL process -->
<wsdl:portType name="BPELProcess1">
<wsdl:operation name="process">
<wsdl:input message="client:BPELProcess1RequestMessage"/>
<wsdl:output message="client:BPELProcess1ResponseMessage"/>
</wsdl:operation>
</wsdl:portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="BPELProcess1">
<plnk:role name="BPELProcess1Provider">
<plnk:portType name="client:BPELProcess1"/>
</plnk:role>
</plnk:partnerLinkType>
<wsdl:binding name="BPELProcess1SOAP11Binding" type="client:BPELProcess1">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="process">
<soap:operation style="rpc"
soapAction="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1/process"/>
<wsdl:input>
<soap:body use="literal"
namespace="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"/>
</wsdl:input>
<wsdl:output>
<mime:multipartRelated>
<mime:part>
<soap:body use="literal"
namespace="http://xmlns.oracle.com/MIMEApp/test/BPELProcess1"/>
</mime:part>
<mime:part>
<mime:content part="attachment" type="application/pdf"/>
</mime:part>
</mime:multipartRelated>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
</wsdl:definitions>
Below is my WL WS WSDL*
<?xml version="1.0" encoding="UTF-8"?>
<WL5G3N0:definitions
name="NewWSDLFile"
targetNamespace="http://www.example.org/NewWSDLFile/"
xmlns:WL5G3N5="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:WL5G3N4="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:WL5G3N3="http://www.example.org/NewWSDLFile/"
xmlns:WL5G3N2="java:com.rogers.service"
xmlns:WL5G3N0="http://schemas.xmlsoap.org/wsdl/"
xmlns:WL5G3N1="http://www.w3.org/2001/XMLSchema"
>
<WL5G3N0:types>
<xsd:schema attributeFormDefault="unqualified" elementFormDefault="qualified" targetNamespace="java:com.rogers.service"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:s="java:com.rogers.service"
xmlns:s0="http://schemas.xmlsoap.org/wsdl/" xmlns:s1="http://www.w3.org/2001/XMLSchema"
xmlns:s2="java:com.rogers.service" xmlns:s3="http://www.example.org/NewWSDLFile/"
xmlns:s4="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:s5="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://www.example.org/NewWSDLFile/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:complexType name="GetAttachmentPDF">
<xsd:sequence>
<xsd:element minOccurs="0" name="Pdf" nillable="false" type="xs:base64Binary"/>
</xsd:sequence>
</xsd:complexType>
<xsd:complexType name="GetAttachmentResult">
<xsd:sequence>
<xsd:element minOccurs="1" name="Message" nillable="true" type="xs:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:schema>
</WL5G3N0:types>
<WL5G3N0:message name="NewOperationRequest">
<WL5G3N0:part name="GetAttachment" type="WL5G3N1:string"/>
</WL5G3N0:message>
<WL5G3N0:message name="NewOperationResponse">
<WL5G3N0:part name="NewOperationResponse" type="WL5G3N2:GetAttachmentResult"/>
<WL5G3N0:part name="attachment" type="WL5G3N2:GetAttachmentPDF"/>
</WL5G3N0:message>
<WL5G3N0:portType name="NewWSDLFile">
<WL5G3N0:operation name="NewOperation">
<WL5G3N0:input message="WL5G3N3:NewOperationRequest"/>
<WL5G3N0:output message="WL5G3N3:NewOperationResponse"/>
</WL5G3N0:operation>
</WL5G3N0:portType>
<WL5G3N0:binding name="NewWSDLFileSOAP" type="WL5G3N3:NewWSDLFile">
<WL5G3N4:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<WL5G3N0:operation name="NewOperation">
<WL5G3N4:operation soapAction="http://www.example.org/NewWSDLFile/NewOperation"/>
<WL5G3N0:input>
<WL5G3N4:body use="literal" namespace="http://www.example.org/NewWSDLFile/"/>
</WL5G3N0:input>
<WL5G3N0:output>
<WL5G3N5:multipartRelated>
<WL5G3N5:part>
<WL5G3N4:body use="literal" namespace="http://www.example.org/NewWSDLFile/"/>
</WL5G3N5:part>
<WL5G3N5:part>
<WL5G3N5:content part="attachment" type="application/pdf"/>
</WL5G3N5:part>
</WL5G3N5:multipartRelated>
</WL5G3N0:output>
</WL5G3N0:operation>
</WL5G3N0:binding>
<WL5G3N0:service name="NewWSDLFile">
<WL5G3N0:port name="NewWSDLFileSOAP" binding="WL5G3N3:NewWSDLFileSOAP">
<WL5G3N4:address location="http://localhost:7001/something/NewWSDLFileImpl"/>
</WL5G3N0:port>
</WL5G3N0:service>
</WL5G3N0:definitions>
I refered the below link:
http://docs.oracle.com/cd/B14099_19/integrate.1012/b14448/manipdoc.htm.
4.16.1.1 WSDL File Contents
They are using ra:writeBinaryToFile() and ora:ReadBinaryFromFile(). I couldnt get a proper sample to understand the use of these functions.
Please advise.
Regards
Ipsita -
Oracle ESB 10g : Blank namespace in the SOAP Response from DB adapter
Hi All,
I am currently working on a ESB project to route input XML file as a parameter to a DB Function.
This Function has a input parameter of type XMLTYPE and returns VARCHAR2 values.
I have configured the DB Adapter to invoke this function and return the result as a SOAP response.
The WSDL of DB adapter contains XML_DATA as input and XMLMAIN as the output result.
The ESB project works fine as expected. But in the result from DB adapter contains a blank namespace [xmlns=""] for the XMLMAIN element .
I hereby attach the output XML.
Please help how to remove this blank namespace from the output.
We are using SOA Suite 10g 10.1.3.5
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header/>
<env:Body xmlns="http://xmlns.oracle.com/pcbpel/adapter/db/XXWEB/XMLMISCRCPTINSERTPKG/XMLMAIN/">
<OutputParameters xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<XMLMAIN xmlns="">100</XMLMAIN>
</OutputParameters>
</env:Body>
</env:Envelope>
Thanks and Regards,
Justin Michael Rajwell..the problem is..the db adapter has it's own transaction..so the transactions fails or not.
you're just not capable of checking if the transaction went ok...and return 'process completed ok' or when the transaction failed for some reason return 'the process aborted'.
So you just need some extra steps for it to be able to return some response-message -
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 -
HI Experts,
Here my scenario is RFC PI SOAP synchronous interface. While sending the message from PI receiver system is expeting SAOP envelop I added this envelop with xslt mapping. Even response message is coming with SOAP envelop I removed with Xslt.. now I am getting below error message in response:
*Here i am not using any authoentication. it is not required..*
In SXMB_moni:
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
- <!--
Inbound Message
-->
- <SAP:Error SOAP:mustUnderstand="1" xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns:SOAP="http://schemas.xmlsoap.org/soap/envelope/">
<SAP:Category>XIAdapterFramework</SAP:Category>
<SAP:Code area="MESSAGE">GENERAL</SAP:Code>
<SAP:P1 />
<SAP:P2 />
<SAP:P3 />
<SAP:P4 />
<SAP:AdditionalText>com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized</SAP:AdditionalText>
<SAP:Stack />
<SAP:Retry>M</SAP:Retry>
</SAP:Error>
In communication channel:
Description
23.11.2011 14:45:11.557 Information The message was successfully received by the messaging system. Protocol: XI URL: http://r3vidci.got.volvo.net:52000/MessagingSystem/receive/AFW/XI Credential (User): PIISUSER
23.11.2011 14:45:11.564 Information Using connection SOAP_http://sap.com/xi/XI/System. Trying to put the message into the request queue.
23.11.2011 14:45:11.568 Information Message successfully put into the queue.
23.11.2011 14:45:11.572 Information The message was successfully retrieved from the request queue.
23.11.2011 14:45:11.573 Information The message status was set to DLNG.
23.11.2011 14:45:11.577 Information Delivering to channel: SOAP_Receiver_BOSS_VID
23.11.2011 14:45:11.577 Information MP: entering1
23.11.2011 14:45:11.579 Information MP: processing local module localejbs/AF_Modules/MessageTransformBean
23.11.2011 14:45:11.599 Information Transform: using Transform.Class: $identity
23.11.2011 14:45:11.634 Information Transform: transforming the payload ...
23.11.2011 14:45:11.637 Information Transform: successfully transformed
23.11.2011 14:45:11.638 Information MP: processing local module localejbs/sap.com/com.sap.aii.af.soapadapter/XISOAPAdapterBean
23.11.2011 14:45:11.676 Information SOAP: request message entering the adapter with user J2EE_GUEST
23.11.2011 14:45:11.695 Information SOAP: completed the processing
23.11.2011 14:45:11.696 Information SOAP: continuing to response message bf2ba0ac-15e1-11e1-cc01-00000c601d4e
23.11.2011 14:45:11.696 Error SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized
23.11.2011 14:45:11.698 Error MP: exception caught with cause com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized
23.11.2011 14:45:11.699 Error Adapter Framework caught exception: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized
23.11.2011 14:45:11.700 Error Delivering the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized. Setting message to status failed.23.11.2011 14:45:11.704 Error The message status was set to FAIL.Hi Rajesh,
I tried with XMLSPY.. i am able to send and get the responce witout any authentication.. I gone through vijay's blog... but i din't find any solution in that..
one more thing.. here inteface is sending from SAP portal system > SAP ECC> SAPI--> webservice(Microsoft system). whenever Portal team sending the message to SAP they are getting below error"
call to messaging system failed: com.sap.engine.interfaces.messaging.api.exception.MessagingException: XIAdapterFramework:GENER
In PI I am getting below error:
.sap.engine.interfaces.messaging.api.exception.MessagingException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 401 Unauthorized -
Idoc to soap scenario - soap response error
hi
i am using pi 731 single stack.
the scenario is idoc to soap. the message mapping is working fine and output is generated successfully.
the message is failing in mesage monitor and communication channel monitor. error is -
Exception caught by adapter framework: SOAP: Response message contains an errorXIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: VEN-OMI-1007:
This scenario is async scenario. How to soap remove this response message error.
rgdsDear,
IDoc to Soap scenario we have to import wsdl at receiver end and map the field from the mapping document but some times receiver end some changes may happen. if it is correct only your mapping we have to conclude from the below points.
1. Check the mapping in Message Mapping and Operation Mapping Test and conclude.
2. you should check url from receiver that is correct or wrong.
3. ask the wsdl from receiver end.
the given ED and receiver side application is same this type of error will not come.
Please check at receiver application or else what ever new fields are added in reciver may be miss mach of ED.
Regards,
Kiran Polani -
Data from SOAP response not getting into Flex object
I'm trying to get data from an ALM application we use(Collabnet TeamForge) using a SOAP webservice, and am running into a problem. I should mention that I am new to both Flex, and webservices.
I used the "Import Web Services" option in Flex Builder 3, and had it generate code for all operations in the WSDL. Some of them work just fine. However, there are several where the data from the SOAP response does not get into the Flex object. The senario that doesn't work is when the response contains a data type that extends another datatype. In TeamForge, they have a type called TrackerSoapRow. It extends FolderSoapRow, adding 3 fields. The problem seems to be that in the response from TeamForge, the 3 fields defined in TrackerSoapRow are in the middle of the fields defined in FolderSoapRow. I've debugged into it, and the problem occures in mx.rpc.xml.XMLDecoder.getApplicableValues( starting at line 2204 of XMLDecoded.as). As I read the code, the only way a match can be found is if the fields in the response are in the exact same order as in the definintion. When its processing the extended data type( by a call to XMLDecoder.decodeComplexExtension ) at some point, one of the derived type's fields is encountered, and the process stops.
I have called the service using soapui and verified that all the data I expect is in the response.
As I mentioned, I'm new to web services. So, I suppose its possible that the format of the data being returned from TeamForge is incorrect. That they are not supposed to intermingle base and derived fields. If thats the case, then I need to report this as a bug to Collabnet.
All help is appreciated.
Marc RobertsonNot knowing any of the details about how you call a web service from OAF myself - I'd suggest you post on the proper forum for OA Framework questions: {forum:id=210}
John -
Hello,
I am fairly new to CF and am trying to parse and then query a soap response from a third-party api. I have been able to get a response in xml format, but that is where I am stuck. Below the xml response I am getting an error that reads Element.LOGINRESPONSE.LOGINRESULT.XMLTEXT is undefined in LOGINXML.
I realize my code is a mess, but I am just trying out various things. Does anyone have any insight how to get at the Login Response variable in my soap response so that I can query it?
Thanks for any insight!!
<!--- WSDL --->
<cfset wsdl_url="http://somewebsite/sirewebsvc/sire.asmx?wsdl">
<cftry>
<!--- Compose SOAP message to send to Web Service--->
<cfsavecontent variable="soap"><?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Login xmlns="http://www.siretechnologies.com/">
<LicenseKey>LicenseKey</LicenseKey>
<Username>username</Username>
<Password>password</Password>
<LicenseType>2</LicenseType>
<APIKey>APIKey</APIKey>
<SiteKey></SiteKey>
<CryptKey></CryptKey>
<WebOnly>false</WebOnly>
</Login>
</soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>
<!--- Invoke web service to send message--->
<cfhttp url="#wsdl_url#" method="post" >
<cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="http://www.siretechnologies.com/Login">
<cfhttpparam type="header" name="content-length" value="#len(soap)#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="xml" name="message" value="#trim(soap)#">
</cfhttp>
<p><cfoutput>#xmlFormat(cfhttp.fileContent)#</cfoutput> </p>
<cfset MyXML = XmlParse(CFHTTP.FileContent)>
XmlSearch(MyXML, "/LoginResponse/LoginResult/")
<cfcatch type="any">
<cfdump var="#cfcatch#">
</cfcatch>
</cftry>
<cfsavecontent variable="XMLFile"><?xml version="1.0"?>
<LoginResponse>
<LoginResult>
???How do I get this from above, or make it a variable???
</LoginResult>
</LoginResponse>
</cfsavecontent>
<!--- Parse the XML --->
<cfset MyXMLDoc = xmlParse(XMLFile) />
<!--- Dump the XML --->
<h2>Dump</h2>
<cfdump var="#MyXMLDoc#">
<cfset MyNodes = xmlSearch(MyXMLDoc,'/LoginResponse/LoginResult')>
<cfoutput>
<h2>Nodes</h2>
<cfloop from="1" to="#arraylen(MyNodes)#" index="i">
<!--- The array contents need to parsed so you can easily get at the child nodes children and attributes. --->
<cfset LoginXML = xmlparse(MyNodes[i]) />
<b>SessionKey:</b> #LoginXML.LoginResponse.LoginResult.xmltext#<br>
</cfloop>
</cfoutput>
--->I think I figured it out. Thanks to all who helped!! If anyone is interested, this is how I retrieved the session key from my Soap response.
<!--- WSDL --->
<cfset wsdl_url="http://SOMEURL/sire.asmx?wsdl">
<!--- Compose SOAP message to send to Web Service--->
<cfsavecontent variable="soap"><?xml version="1.0" encoding="UTF-8" ?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<Login xmlns="http://www.siretechnologies.com/">
<LicenseKey>LicKey</LicenseKey>
<Username>user</Username>
<Password>pass</Password>
<LicenseType>2</LicenseType>
<APIKey>API</APIKey>
<SiteKey></SiteKey>
<CryptKey></CryptKey>
<WebOnly>false</WebOnly>
</Login>
</soapenv:Body>
</soapenv:Envelope>
</cfsavecontent>
<!--- Invoke web service to send message--->
<cfhttp url="#wsdl_url#" method="post" >
<cfhttpparam type="header" name="content-type" value="text/xml">
<cfhttpparam type="header" name="SOAPAction" value="http://www.siretechnologies.com/Login">
<cfhttpparam type="header" name="content-length" value="#len(soap)#">
<cfhttpparam type="header" name="charset" value="utf-8">
<cfhttpparam type="xml" name="message" value="#trim(soap)#">
</cfhttp>
<p><cfoutput>#xmlFormat(cfhttp.fileContent)#</cfoutput> </p>
<cfset MyXml = XmlParse(cfhttp.fileContent)>
<cfdump var="#MyXml#">
<cfset responseNodes = xmlSearch(MyXml,"//*[ local-name() = 'LoginResponse' ]")>
<cfdump var="#responseNodes#">
<cfoutput>
<cfloop from="1" to="#arraylen(responseNodes)#" index="i">
<cfset TheXML = xmlparse(responseNodes[i])>
<cfset SesKey = "#TheXML.LoginResponse.LoginResult.XmlText#">
<b>SessionKey:</b> #TheXML.LoginResponse.LoginResult.XmlText#<br>
<b>Session Key:#SesKey#
</cfloop>
</cfoutput> -
Raised warnings in SOAP response - where are they?
I am calling a rulebase deployed on a determinations-server using the generic SOAP web services.
Using Java and JAX-WS I can build a valid request, call the service, and receive a response which I can interpret - and I can handle the SOAPFaultException thrown when an error is raised by the rulebase.
So far so good - however, when my rulebase raises a warning - how is that supposed to be reflected in the SOAP response?
As far as I can see - there is no trace of any raised warnings in the response - and I have tried calling with both "value-only" and "decision-report" outcome style.
Any pointers to documentation or examples will be greatly appreciated.
Thanks in advance,
- TomI found the answer myself: Adding a <show-events>true</show-events> to the config-part of the request did the trick.
The response now contains an <events> section listing the raised warning from the rulebase.
I guess sometimes the answer is right in front of you - I hope somebody else can benefit from this information.
- Tom -
Hi,
I have created the sample "Stateless Java Web Service Tutorial" HelloImpl.java
My SOAP response contains the follwoing tag
<ns1:sayHelloReponse xmlns="..." SOAP-ENV="...">
<return xsi:type="string">Hello Test! The ... </return>
</ns1:sayHelloResponse>
I want the soap message not to print the return tag as string but my custom tag which is an xml file, i want my class to return an xml formatted string and the xml will be my reponse
please advicewell..the problem is..the db adapter has it's own transaction..so the transactions fails or not.
you're just not capable of checking if the transaction went ok...and return 'process completed ok' or when the transaction failed for some reason return 'the process aborted'.
So you just need some extra steps for it to be able to return some response-message -
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). -
EncodingStyle attr not properly ns qualified in SOAP response (7.0 beta)
It appears that BEA does not properly qualify the
encodingStyle attribute in its SOAP response message.
Although the document does specify an encodingStyle, the
attribute does not come from the SOAP envelope namespace.
In the captured response message below, encodingStyle
should be env:encodingStyle to be correct.
HTTP/1.0 200 OK
Date: Thu, 28 Mar 2002 21:13:25 GMT
Server: WebLogic WebLogic Server 7.0 beta Fri Feb 22 10:33:57 PST 2002 166852
Content-Length: 387
Content-Type: text/xml
Connection: Close
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
</env:Header>
<env:Body>
<m:buyResponse xmlns:m="http://www.bea.com/examples/Trader"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<result>
<stockSymbol>BEAS</stockSymbol>
<numberTraded>10</numberTraded>
</result>
</m:buyResponse>
</env:Body>
</env:Envelope>Hi M,
First, I see your point (and agree), from a "pristine" point of view ;-)
But the SOAP spec (or Note, or Comment, or whatever) actually allows this :-)
Here's the exact paragraph:
"A SOAP application SHOULD include the proper SOAP namespace on all elements and
attributes defined by SOAP in messages that it generates. A SOAP application MUST
be able to process SOAP namespaces in messages that it receives. It MUST discard
messages that have incorrect namespaces (see section 4.4) and it MAY process SOAP
messages without SOAP namespaces as though they had the correct SOAP namespaces."
Kind of "Clintonian", if you know what I mean, but it is there. If your SOAP processor
were to discard this message, one would have to assume that MAY is synonymous with
MAY NOT :-)
Is the glass HALF-FULL, or HALF-EMPTY?
Anyway, I agree that the env namespace prefix OUGHT TO BE (like that, lol) added
to the encodingStyle attribute here :-)
Regards,
Mike Wooten
"M Shue" <[email protected]> wrote:
>
It appears that BEA does not properly qualify the
encodingStyle attribute in its SOAP response message.
Although the document does specify an encodingStyle, the
attribute does not come from the SOAP envelope namespace.
In the captured response message below, encodingStyle
should be env:encodingStyle to be correct.
HTTP/1.0 200 OK
Date: Thu, 28 Mar 2002 21:13:25 GMT
Server: WebLogic WebLogic Server 7.0 beta Fri Feb 22 10:33:57 PST 2002 166852
Content-Length: 387
Connection: Close
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
<env:Header>
</env:Header>
<env:Body>
<m:buyResponse xmlns:m="http://www.bea.com/examples/Trader"
encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<result>
<stockSymbol>BEAS</stockSymbol>
<numberTraded>10</numberTraded>
</result>
</m:buyResponse>
</env:Body>
</env:Envelope> -
Helo
I have a problem when receiving SOAP Message response and I hope you can help.
The code has been working fine until two days ago, when I could NOT receive the SOAP Messages anymore and I do not know what to do.
Anyway my piece of code is like below:
public static void main(String[] args) {
// Create the connection
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
SOAPConnection conn = scf.createConnection();
// Create message
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
// Object for message parts
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope env = sp.getEnvelope();
// STUFFS SKIPPED MANY ADDING HEADER AND BODY AND DIFFERENT PARTS
// Save message
msg.saveChanges();
// View input
System.out.println("\n Soap request:\n");
msg.writeTo(System.out);
System.out.println();
// Send
String urlval = "http://someURL/files.jws";
SOAPMessage rp = conn.call(msg, urlval);
// Get reply content
Source sc = rp.getSOAPPart().getContent();
// Close connection
conn.close();
} catch (Exception e) {
System.out.println(e.getMessage());
}My question is how can i wait for the respose from the URL?
Because it looks like the response is being delayed and for some reason, when it is coming back I have already finished the execution of my program...
Is threads the only answer?
Any other possibilities into getting the response?
thanks for the response
pipsuHi Reyaz,
This is actually an RFC-->SOAP scenario where the message structure of the source and target systems are different. We don't actually need a reponse back from the SOAP system. I was wondering if you perhaps know how we can cancel the Response response back to the requestor or at leaset map the SOAP response back?
The interface runs perfectly in asynchronous mode when executing it from the Runtime Workbench in the test section, but it runs in synchronous mode for some reason when executing the RFC function call in SAP.
Thank you,
Brendon -
Hi All,
We have a scenario of FTP-->PI---> Webservice. While triggering the data in the FTP, it is failing in the PI with the below error
SOAP: response message contains an error XIAdapter/PARSING/ADAPTER.SOAP_EXCEPTION - soap fault: Server was unable to read request. ---> There is an error in XML document (1, 447). ---> Input string was not in a correct format.
Can you please help?Hi Raja- It seems to be a data quality issue.
Check for the value @ 1447 position in the xml message that you are trying to send to web service..
may be a date filed/decimal value which is not in expected format. -
Hi there,
I am trying to publish a file from SAP as web service using XI and SOAP Adapter.
I am using ABAP proxy to get the data into XI.
Designing and Configuration in XI has no problems because when i use File adapter the data is trasmitted to FTP server.
But when I used SOAP Reciever adapter I am getting following error in RWB
Delivery of the message to the application using connection SOAP_http://sap.com/xi/XI/System failed, due to: com.sap.aii.af.ra.ms.api.RecoverableException: SOAP: response message contains an error XIAdapter/HTTP/ADAPTER.HTTP_EXCEPTION - HTTP 500 Error during parsing of SOAP header.
<b>Scenario</b>: SAP ABAP Proxy -> XI -> WebService. Asynchronous.
<b>SOAP</b> Receiver adaptor.
<b>Target URL</b> http://<host>:<port number >/sap/xi/engine?type=entry&version=3.0&Sender.Service=SAPDC2653&Interface=urn:bzttest:00:hsa:test%5EOB_MI_BZT_TEST&QualityOfService=ExactlyOnce
Do not use SOAP Envelop is checked.
<b>SOAP Action</b> http://sap.com/xi/WebService/soap1.1
What i am missing here? How should I solve this problem?
Any help is appreciated,
Thx,
YogiSay there's a bapi/rfc that you want to call on an R/3 backend (e.g. 4.6c). On it's own, the R/3 system cannot expose the rfc/bapi as a web service, but XI can. So in this case, the scenario would be:
WS client -> XI -> R/3
When XI "exposes" a web service, it is exposing a service for a receiving system (in the above example, the R/3 system). XI itself does not provide or contain the service implementation. When XI exposes a web service, it is always done via the <b>sender</b> soap adapter (i.e. if soap adapter is used). Receiver soap adapter is used to call or consume an actual web service from an external application.
Regards,
Jin
Maybe you are looking for
-
How do I restore an Apple Mail account to a previous date?
I have three accounts in Apple Mail: my Exchange server account, and two IMAP accounts. I need to restore ONLY the Exchange server mailbox to where it was on April 1st and can't do so the normal way of having the Exchange mail stores restored. Is the
-
View only 1 or more results on a form
I did "List Manager" (view only) using this SQL query select "DBSID_NAME" from "DBSIDS","DBSID_LOOKUP","SERVERS" where instr(upper("ID"),upper(nvl(:P3_ID,"ID"))) > 0 and "DBSID_ID" = "SIDLOOKUP_ID" and "ID" = "SERVERLOOKUP_ID" it only returns the fir
-
Forms 10g Installation issue on windows 7 Professional service pack 1
hi I am trying to install oracle forms 10g 64 bit windows 7 Professional service pack 1 .. Below are 2 files that i am using .. ds_windows_x86_101202_disk1.zip (626,122,752 bytes) ds_windows_x86_101202_disk2.zip (236,880,881 bytes) But it failed but
-
What is the default for the "Display PDF in Browser" setting?
What is the default for the "Display PDF in Browser" setting in Adobe Reader 9 and X? Also, are any statistics available on what proportion of users have this setting set to on?
-
Hi, I'd like to fill a pdf form with atril. Unfortunatelly it uses so huge fonts, that some of the letters are actually lolling out of the box. Do you have any idea how to change the fontsize? Or any alternatives? Acrobat Reader works fine, but I'd r