Generating SOAP 1.2 envelope
Hi folks,
can anyone point me in the right direction?
I need to create a routing service that accepts a SOAP 1.2 envelope. What I'm finding is that the SOAP endpoint service that gets created by ESB is SOAP 1.1.
I'm on 10.1.3.3.
Any help appreciated.
Hi,
I have a similar problem, see Can ESB handle SOAP 1.2? It seems that esb can not handle soap 1.2 messages yet.
Kind Regards,
Andre Jochems
Similar Messages
-
Generating SOAP Envelope when DO NOT USE ENVELOPE option is marked
My scenario: SPROXY => XI => 3rdParty WebService. Communication is synchronous. I've a problem with soap envelope. It is required by webservice, but when I use standard soap envelope generated by SAP I've a problem with receiving response from webservice.
So I want to create my own envelope. For this reason I've used DO NOT USE SOAP ENVELOPE option. Now the challenge comes. How can I create my own soap envelope?
Do you have any working example? Soap envelope should be added to message send from XI to 3rdParty WebService.
Helping answers => a lot of pointsI'm talking about HTTP header.
When I'm sending SOAP request from SAP my whole message looks like when I use soap envelope
POST / HTTP/1.0
Accept: */*
Host: 192.168.132.179:54000
User-Agent: SAP-Messaging-com.sap.aii.messaging/1.0505
Content-ID: <soap-02cce7702b1a11dd9902000c29ee261e[at]sap.com>
Content-Type: text/xml; charset=utf-8
Content-Disposition: attachment;filename="soap-02cce7702b1a11dd9902000c29ee261e[at]sap.com.xml"
Content-Description: SOAP
Content-Length: 259
SOAPACTION:
<SOAP:Envelope xmlns:SOAP='http://schemas.xmlsoap.org/soap/envelope/'><SOAP:Header/><SOAP:Body><ns0:Sd2Ids_SzfExport xmlns:ns0='http://www.dat.de/sdii/ids/Sd2SOAP.wsdl'><arg1>1234567899-0</arg1><arg2>1</arg2></ns0:Sd2Ids_SzfExport></SOAP:Body></SOAP:Envelope>
Always after such request I got and HTTP 411 error.
In opposite, when I'm sending request from e.g. Altova or SoapUI, my message looks:
POST / HTTP/1.1
Content-Type: text/xml; Charset=UTF-8
User-Agent: XML Spy
Host: 192.168.132.179:54000
Content-Length: 489
Connection: Keep-Alive
Cache-Control: no-cache
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<SOAP-ENV:Body>
<m:Sd2Ids_SzfExport xmlns:m="http://www.dat.de/sdii/ids/Sd2SOAP.wsdl">
<arg1 xsi:type="xsd:string">1234567899-0</arg1>
<arg2 xsi:type="xsd:string">1</arg2>
</m:Sd2Ids_SzfExport>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
After that request WebService response is correct.
You can find such differences (except Content-length which is a result of XML message formatting) in those two headers:
- for first is used HTTP 1.0 protocol for later 1.1
- in SAP header an info about attachment is added
After a lot of test I thing that those attachment info in header of HTTP is causing a problem. So I want to use DO NOT USE SOAP ENVELOPE option to generate HTTP header without Content-Disposition and generate SOAP Envelope manually. -
The SOAP Message functionality show in error at the time of SOAP Response Message.
can u plz guide me ...
SOAP Response Message
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Component Interface API.</faultstring>
<detail>
<CIFault xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/M116479.V1">
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>91</MessageSetID>
<MessageID>2</MessageID>
<DefaultMessage>Cannot find Component Interface {CI_FPMSALSTEP_PNLResponse} (91,2)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>90</MessageSetID>
<MessageID>7</MessageID>
<DefaultMessage>Initialization Failed (90,7)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>90</MessageSetID>
<MessageID>6</MessageID>
<DefaultMessage>Not Authorized (90,6)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>91</MessageSetID>
<MessageID>20</MessageID>
<DefaultMessage>Error initializing Component Interface {CI_FPMSALSTEP_PNLResponse}</DefaultMessage>
<MessageParameters/>
</IBResponse>
</CIFault>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>Please provide how you call the webservice?
Answer :- I am calling webservices through SOAP UI or Generate SOAP Templates.
What tools/applciation do you use to call the webservice.
PT 8.52/ HRMS 9.1
How does your wsdl look like?
http://184.73.174.36:9080/PSIGW/PeopleSoftServiceListeningConnector/CI_MI_PERSONAL_CI.1.wsdl
=================================================================================================================
SOAP Response message for CI_MI_PERSONAL_CI through Generate SOAP Templates for find operation.
SOAP Response Message
<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>null</faultstring>
<detail>
<IBResponse type="error" xmlns="">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageID>45</MessageID>
<DefaultMessage>
<![CDATA*User password failed. (158,45)*]>
</DefaultMessage>
<MessageParameters>
<Parameter>
<![CDATA*ANONYMOUS*]>
</Parameter>
</MessageParameters>
</IBResponse>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
=================================================================================================================
SOPA UI
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:m29="http://xmlns.oracle.com/Enterprise/Tools/schemas/M292846.V1">
<soapenv:Header/>
<soapenv:Body>
<m29:Update__CompIntfc__CI_FPMSALSTEP_PNLResponse>
<m29:notification>?</m29:notification>
<m29:detail>?</m29:detail>
</m29:Update__CompIntfc__CI_FPMSALSTEP_PNLResponse>
</soapenv:Body>
</soapenv:Envelope>
================================================================================================================
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body>
<SOAP-ENV:Fault>
<faultcode>SOAP-ENV:Server</faultcode>
<faultstring>Component Interface API.</faultstring>
<detail>
<CIFault xmlns="http://xmlns.oracle.com/Enterprise/Tools/schemas/M116479.V1">
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>91</MessageSetID>
<MessageID>2</MessageID>
<DefaultMessage>Cannot find Component Interface {CI_FPMSALSTEP_PNLResponse} (91,2)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>90</MessageSetID>
<MessageID>7</MessageID>
<DefaultMessage>Initialization Failed (90,7)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>90</MessageSetID>
<MessageID>6</MessageID>
<DefaultMessage>Not Authorized (90,6)</DefaultMessage>
<MessageParameters/>
</IBResponse>
<IBResponse type="Error">
<DefaultTitle>Integration Broker Response</DefaultTitle>
<StatusCode>20</StatusCode>
<MessageSetID>91</MessageSetID>
<MessageID>20</MessageID>
<DefaultMessage>Error initializing Component Interface {CI_FPMSALSTEP_PNLResponse}</DefaultMessage>
<MessageParameters/>
</IBResponse>
</CIFault>
</detail>
</SOAP-ENV:Fault>
</SOAP-ENV:Body>
</SOAP-ENV: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 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 -
Error Message when Generating SOAP in JDeveloper
I have been looking into this for a while now and have no idea where else to go. When creating and sending a SOAP message in JDeveloper 10g (OC4J) I continue to get this error message. Any ideas/suggestions would be much appreciated.
XSL-1101: (Fatal Error) DOMSource node as this type not supported.
javax.xml.transform.TransformerException: XSL-1101: (Fatal Error) DOMSource node as this type not supported.
at oracle.xml.jaxp.JXTransformer.reportException(JXTransformer.java:732)
at oracle.xml.jaxp.JXTransformer.transform(JXTransformer.java:198)
at com.sun.xml.messaging.saaj.soap.impl.EnvelopeImpl.output(EnvelopeImpl.java:237)
at com.sun.xml.messaging.saaj.soap.SOAPPartImpl.getContentAsStream(SOAPPartImpl.java:202)
at com.sun.xml.messaging.saaj.soap.MessageImpl.getHeaderBytes(MessageImpl.java:461)
at com.sun.xml.messaging.saaj.soap.MessageImpl.saveChanges(MessageImpl.java:538)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.post(HttpSOAPConnection.java:223)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection$PriviledgedPost.run(HttpSOAPConnection.java:151)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.xml.messaging.saaj.client.p2p.HttpSOAPConnection.call(HttpSOAPConnection.java:121)
at mypackage1.SoapTest.doGet(SoapTest.java:49)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind.server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(JAZNFilter.java:356)
at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:614)
at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:317)
at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:784)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)
at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:536)Thanks in advance.Hi,
under "project properties -> Libraries" add a new J2SE version (I use 1.4.1.2) by choosing the java.exe file.
I provide you my code sample.
Note: I use this just for test purposes, so be carefully, I haven't removed rubbish. I use a XML file attachment that is stored in local file.
import java.net.*;
import java.io.*;
import java.util.*;
import javax.servlet.http.*;
import javax.servlet.*;
import javax.xml.soap.*;
import javax.activation.*;
import javax.xml.parsers.*;
import org.w3c.dom.*;
import org.apache.log4j.*;
import org.apache.log4j.xml.*;
import org.apache.commons.logging.*;
import javax.xml.parsers.DocumentBuilder;
public class TripplanSender extends HttpServlet
static Logger logger = Logger.getLogger(TripplanSender.class);
String toURL;
String data;
ServletContext servletContext;
private SOAPConnection con;
public TripplanSender()
data = null;
public void init(ServletConfig servletConfig)
throws ServletException
super.init(servletConfig);
servletContext = servletConfig.getServletContext();
try
String resource = "/WEB-INF/xml/loggingConfig.xml";
URL configFileResource = servletConfig.getServletContext().getResource(resource);
DOMConfigurator.configure(configFileResource.getFile());
logger.debug("Logger initialisiert. Initialisiere Config Manager");
SOAPConnectionFactory scf = SOAPConnectionFactory.newInstance();
con = scf.createConnection();
toURL = servletConfig.getInitParameter("SendToURL");
catch(Exception e)
//logger.error("Unable to open a SOAPConnection", e);
java.io.InputStream in = servletContext.getResourceAsStream("/WEB-INF/address.properties");
if(in != null)
Properties props = new Properties();
try
props.load(in);
//toURL = props.getProperty("to");
data = props.getProperty("data");
catch(IOException ex) { }
public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws ServletException
String retval = "<html> <H4>";
try
MessageFactory mf = MessageFactory.newInstance();
SOAPMessage msg = mf.createMessage();
SOAPPart sp = msg.getSOAPPart();
SOAPEnvelope envelope = sp.getEnvelope();
SOAPHeader header = msg.getSOAPHeader();
javax.xml.soap.Name tripplan = envelope.createName("Tripplan", "b", "http://de.tui.aergo.sample/Tripplan");
SOAPHeaderElement tripplanHeaderElem = header.addHeaderElement(tripplan);
tripplanHeaderElem.setActor("http://de.tui.aergo.sample/receiver");
tripplanHeaderElem.setMustUnderstand(true);
javax.xml.soap.Name tripplan_action = envelope.createName("tripplan_action", "b", "http://de.tui.aergo.sample/Tripplan");
SOAPElement tripplan_actionElem = tripplanHeaderElem.addChildElement(tripplan_action);
tripplan_actionElem.addTextNode("CREATE");
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPBody body = msg.getSOAPBody();
StringBuffer urlSB = new StringBuffer("http://");
urlSB.append(req.getServerName());
urlSB.append(":").append(req.getServerPort());
urlSB.append(req.getContextPath());
String reqBase = urlSB.toString();
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
dbf.setNamespaceAware(true);
String msgFilename = req.getParameter("ACTION");
data = reqBase + "/" +msgFilename;
//data = reqBase + "/191_create_requisitn_001.xml";
URL url = new URL(data);
AttachmentPart ap = msg.createAttachmentPart(new DataHandler(url));
ap.setContentType("text/xml");
msg.addAttachmentPart(ap);
URL urlEndpoint = new URL(toURL);
SOAPMessage reply = con.call(msg, urlEndpoint);
if(reply != null)
System.err.println("Reply logged in \"reply.msg\"");
retval = retval + " received reply (check \"reply.msg\").</H4> </html>";
} else
System.err.println("No reply");
retval = retval + " no reply was received. </H4> </html>";
catch(Throwable e)
e.printStackTrace();
//logger.error("Error in constructing or sending message " + e.getMessage());
retval = retval + " There was an error in constructing or sending message. </H4> </html>";
try
OutputStream os = resp.getOutputStream();
os.write(retval.getBytes());
os.flush();
os.close();
catch(IOException e)
e.printStackTrace();
//logger.error("Error in outputting servlet response " + e.getMessage());
} -
Couldnot generate MIME header when generating SOAP packet with SAAJ
I am trying to generate a soap packet using SAAJ.
I have a generated SOAP.xml and an attachment file (which is a zip file).
I am able to generated a packet in following format
------=_Part_0_20920201.1207569691421
Content-Type: text/xml; charset=utf-8
Content-Transfer-Encoding: 8bit
Content-Location: Envelope2290
<< And here is my SOAP.xml file>>
------=_Part_0_20920201.1207569691421
Content-Type: application/octet-stream
Content-Transfer-Encoding: Binary
Content-Location: MeFAttachment.zip
<< And here is my attachment zip file>>
------=_Part_0_20920201.1207569691421�
But the format I want to generate is :
MIME-Version: 1.0
Content-Type: Multipart/Related; boundary=MIMEBoundary; type="text/xml"
Content-Description: Transmission file for IRS MeF
X-eFileRoutingCode: MEF
--MIMEBoundary
Content-Type: "text/xml"; charset=UTF-8
Content-Transfer-Encoding: 8bit
Content-Location: Envelope2290
<< And here is my SOAP.xml file>>
--MIMEBoundary
Content-Type: application/octet-stream
Content-Transfer-Encoding: Binary
Content-Location: MeFAttachment
<< And here is my attachment zip file>>
--MIMEBoundary�
I am not able to generate the upper 4 lines and the MIMEBoundary. Can anyone plz help me�? Its really Urgent����.did u get any solution for that!!! i also hav the same problem
-
Generating soap message from given WSDL dynamically.
Hi,
I want to write code which can generate SOAP request message from given WSDL.
Any Libraries which is already doing this work so that i can extend them and implement my work on top of it.
I saw one similar thing called SOAPUI. But it is a desktop application. I want the similar thing as a library so that i can extend it
Thanks
mchepuriI think that you can use the soapui libraries (a .jar file) and you can generate a soap message for a given wsdl....
but you cannot know the types of the "parameters" ... the library puts "?" where you have to put a value to send.... -
EncodingStyle error in JWSDP 1.1 generated SOAP XML?
Hi,
I ran wscompile to generate some stubs for a simple "fortune cookie" web service. I know this service works fine because I have tested it with clients using other toolkits. So the stubs are generated, I use them to call the service and it fails. I trapped the XML being sent to the service, it is included below. An "encodingStyle" is being inserted into one of my parameter elements, but it is not being given a value so it is invalid. Can anyone tell me whether this is a bug in JWSDP or how to fix it so that this value is set correctly or is not set at all and defaults to the parent's encodingStyle?
<?xml version="1.0" encoding="UTF-8"?>..
<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:enc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:ns0="tallan.com/FortuneCookieRequest"
env:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<env:Body>
<ns0:fortuneRequest env:encodingStyle="">
<ns0:minLines>1</ns0:minLines>
<ns0:maxLines>1</ns0:maxLines>
</ns0:fortuneRequest>
</env:Body>
</env:Envelope>..For a SOAP response to be deserialize, com.sun.xml.rpc.encoding.SOAPDeserializationContext.verifyEncodingStyle() will be called, but SOAPDeserializationContext only pushed an empty string in the encodingStyleContext stack. It assumes the SOAP response received will tell it about encoding styles in the response; but for some SOAP implementations (such as Delphi, and maybe .NET?), this is not true.
A workaround is to open your SOAP client stub source file (generated by wscompile, you have to keep it), finding the below text:
protected void _readFirstBodyElement
Insert the following statement below it:
deserializationContext.pushEncodingStyle(SOAPConstants.NS_SOAP_ENCODING);
Then Delphi/.NET web services work happily with JWSDP generated clients. -
JAXB 1.3 can't parse W3 SOAP 2003-05 envelope XML schema
Hello,
I was trying to use JAXB to parse the MMAP schema from the SMS Forum
(http://www.smsforum.net/schemas/mmap/v1.0/mmap.xsd). I finally
tracked it down to XJC choking on the included SOAP envelope schema's
use of the xml:lang attribute for a tag called reasontext. Here's the
pared-down test case:
C:\java\src\baz>%JWSDP_HOME%\jaxb\bin\xjc.bat http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
%JWSDP_HOME%\jaxb\bin\xjc.bat http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
parsing a schema...
[ERROR] src-resolve: Cannot resolve the name 'xml:lang' to a(n) attribute declaration component.
line 97 of soap-envelope.xsd
[ERROR] src-ct.0.1: Complex Type Definition Representation Error for type 'reasontext'. Element 'attribute' is invalid, misplaced, or occurs too often.
line 97 of soap-envelope.xsd
Failed to parse a schema.
C:\java\src\baz>I believe that the relevant portions of the schemas and namespaces in
question are:
http://www.w3.org/2003/05/soap-envelope/soap-envelope.xsd
<xs:complexType name="reasontext">
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute ref="xml:lang" use="required" />
</xs:extension>
</xs:simpleContent>
</xs:complexType>http://www.w3.org/2001/XMLSchema.xsd
<xs:complexType name="attribute" mixed="false">
<xs:complexContent>
<xs:extension base="xs:annotated">
<xs:sequence>
<xs:element name="simpleType" minOccurs="0" type="xs:localSimpleType" />
</xs:sequence>
<xs:attributeGroup ref="xs:defRef" />
<xs:attribute name="type" type="xs:QName" />
<xs:attribute name="use" use="optional" default="optional">
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="prohibited" />
<xs:enumeration value="optional" />
<xs:enumeration value="required" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="default" type="xs:string" />
<xs:attribute name="fixed" type="xs:string" />
<xs:attribute name="form" type="xs:formChoice" />
</xs:extension>
</xs:complexContent>
</xs:complexType>http://www.w3.org/2001/XMLSchema.xsd
<xs:attributeGroup name="defRef">
<xs:annotation>
<xs:documentation>for element, group and attributeGroup, which both define and reference</xs:documentation>
</xs:annotation>
<xs:attribute name="name" type="xs:NCName" />
<xs:attribute name="ref" type="xs:QName" />
</xs:attributeGroup>http://www.w3.org/XML/1998/namespace
The namespace whose name is http://www.w3.org/XML/1998/namespace is
bound by definition to the prefix xml: according to Namespaces in XML,
W3C Recommendation 14 Jan 1999. Note that unlike all other XML
namespaces, both the name and the prefix are specified; i.e., if you
want XML 1.0 processors to recognize this namespace, you must use the
reserved prefix xml:.
xml:lang and xml:space
As of the last update of this document, the XML 1.0 Specification
defines two attribute names in this namespace:
xml:lang
Designed for identifying the human language used in the scope of the
element to which it's attached.
.I'm no XML schema expert, but it looks to me like "name" and "ref"
are both valid attributes for an <xs:attribute> tag and that the XML
namespace standard requires XML processors to recognize the xml:lang
attribute. Hence, this appears to me to be a bug in JAXB.
A secondary bug is that the original error message left the name of
the offending included schema blank:
C:\java\src\foo>d:\java\jwsdp\jwsdp-1.3\jaxb\bin\xjc.bat http://www.smsforum.net/schemas/mmap/v1.0/mmap.xsd
parsing a schema...
[ERROR] src-resolve: Cannot resolve the name 'xml:lang' to a(n) attribute declaration component.
line 97 of
[ERROR] src-ct.0.1: Complex Type Definition Representation Error for type 'reasontext'. Element 'attribute' is invalid, misplaced, or occurs too often.
line 97 of
Failed to parse a schema.
C:\java\src\foo>In case it helps with problem diagnosis, I'm running with J2SDK 1.4.2
and have copied the endorsed jar files into the JRE lib as instructured
with JAXB:
C:\java\src\baz>java -version
java -version
java version "1.4.2"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2-b28)
Java HotSpot(TM) Client VM (build 1.4.2-b28, mixed mode)
C:\java\src\baz>dir %JAVA_HOME%\jre\lib\endorsed
dir %JAVA_HOME%\jre\lib\endorsed
Volume in drive D has no label.
Volume Serial Number is 70AE-6E52
Directory of D:\java\j2se\j2sdk1.4.2\jre\lib\endorsed
03/31/2004 09:41 AM <DIR> .
03/31/2004 09:41 AM <DIR> ..
03/29/2004 01:28 PM 56,619 dom.jar
03/29/2004 01:28 PM 60,963 sax.jar
03/29/2004 01:28 PM 2,823,241 xalan.jar
03/29/2004 01:28 PM 2,667,618 xercesImpl.jar
10/10/2003 06:36 PM 1,379,810 xsltc.jar
6 File(s) 6,989,573 bytes
2 Dir(s) 7,889,731,584 bytes free
C:\java\src\baz>I'm quite interested in the resolution of this issue as I'm stopped in
my tracks on progress here. Help with resolution, whether in JAXB or
my usage of it, will be much appreciated. I did a search of existing
issues but didn't notice a duplicate. Thanks in advance.I have also come across a similar problem with validating an xml file with an xml:lang attribute. It seems to be common across the schema validation and dtd validation. I get the following error with both schema and dtd validation:
Validation Error Msg (0): unexpected attribute "xml:lang"
Validation Error Location (0): FreeFormText
The test file extract looks like this:
<FreeFormText xml:lang="EN">Pelle</FreeFormText>
The schema defines the node as:
<xs:complexType name="FreeFormText">
<xs:simpleContent>
<xs:extension base="FreeFormTextType">
<xs:attribute name="lang" type="xs:language"/>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
and the dtd defines the node as:
<!ELEMENT FreeFormText
(#PCDATA)>
<!ATTLIST FreeFormText xml:lang CDATA #IMPLIED >
This looks like a bug in JAXB to me aswell. Any help on it would be much appreciated as i am also stuck. -
Can I generate a SOAP fault and set the details (faultcode etc.) from a
JWS file created from with WLW?
Thanks,
Kevin JonesTracy,
Thanks for your response.
However, the SOAP 1.2 standard (as well as 1.1) state that
when using HTTP transports, a SOAP fault will result in the
server's response being set to 500 (Internal Server Error). So,
what gives?
Thanks,
-krish -
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 adviceI 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? -
How to generate soap header using java code
Hi,
I need to generate the following soap header using java DOM.
Can you send me some java code snippet to do so?
<soapenv:Header>
<api:RequesterCredentials soapenv:mustUnderstand="0" xmlns:api="urn:ThinkPod:api:ThinkPodAPI" xmlns:ebl="urn:ThinkPod:apis:eBLBaseComponents">
<ebl:ThinkPodAuthToken>YourToken</ebl:ThinkPodAuthToken>
<ebl:Credentials>
<ebl:DevId>YourDevId</ebl:DevId>
<ebl:AppId>YourAppId</ebl:AppId>
<ebl:AuthCert>YourAuthCert</ebl:AuthCert>
</ebl:Credentials>
</api:RequesterCredentials>
</soapenv:Header>You want to generate that on a mobile device or how is that related to CLDC and MIDP?
-
How to generate soap header elemtn ds:X509Certificate in SAOP message?
Hello all,
could you please help me to solve the following issue?
I need to generate a following security header on weblogic 10.3:
<ds:KeyInfo>
<ds:X509Data>
<ds:X509Certificate>MIICtTC.....</X509Certificate>
</X509Data>
</ds:KeyInfo>
</ds:Signature>
If I use a standard Weblogic WS-Policy file (e.g., Wssp1.2-2007-Wss1.0-X509-Basic256.xml), the following header is created (please ignore changes in namespaces):
<dsig:KeyInfo>
<wsse:SecurityTokenReference
xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
xmlns:wsse11="http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd"
xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"
wsse11:TokenType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3"
wsu:Id="str_vUsIPkGU5I26BGcy">
<wsse:KeyIdentifier
EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary"
ValueType="http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1">zgXqyWX5atWpNj5EhRsF7viA3uU=</wsse:KeyIdentifier>
</wsse:SecurityTokenReference>
</dsig:KeyInfo>
The header in this case point to <wsse:BinarySecurityToken... which contains the certificate but it is not what I need. I need the certificate to be included directly in Keyinfo element.
Do you know how to achieve it, if I should modify a ws-policy file (and how in this case) or if I can somehow tell Weblogic how the result SOAP message should look like? Or will I have to implement this by myself using some existing java libraries and bypass Weblogic security?
Thanks in advance
JaroslavEric,
Could you please recommand a good document on how to work with routing, stage, action ...?http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html#wp1265888
http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/consolehelp/proxyactions.html#wp1319158
http://www.orafmwschool.com/oracle-service-bus-routing-and-transformation/
It is considered good etiquette to reward answerers with points (as "helpful" - 5 pts - or "correct" - 10pts).
Hope it helps !!
Regards,
Abhinav Gupta -
Generated SOAP request parameters wrong?
hello everybody,
when you generate a WSDL out of the integration directory.
Do you SOAP request parameters work correct or do you have to modify them.
We have to modify them and have to insert strings like >&<
Do we anything wrong?
Regards MarioHi,
I had to modify the order of tags (when used with webdynpro)
but I don't remember the SP, path...
but never >&<
Regards,
michal
<a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a> -
BPEL - not generating correct SOAP packet for complex types
Hi,
Below is a snippet from wsdl, correct SOAP request and reply packet (generated using a SOAP test tool) and finally BPEL generated SOAP request and error response (captured using TCP packet monitor)
The problem is with element 'XActivationPackageArray', which is getting enclosed
by itself again from Oracle BPEL PM.
------------------------W S D L S T A R T----------------------------------------------------
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" .......>
<types>
<schema>
<complexType name="XActivationPackageArray">
<sequence>
<element name="XActivationPackage" type="tns2:XActivationPackage" maxOccurs="unbounded"/>
</sequence>
</complexType>
<element name="XActivationPackageArray" type="tns2:XActivationPackageArray"/>
<complexType name="XActivationPackage">
<sequence>
<element name="activationPackage" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="XActivationResponse">
<sequence>
<element name="unitId" nillable="true" type="xsd:string"/>
<element name="serviceId" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<element name="XActivationResponse" type="tns2:XActivationResponse"/>
</schema>
</types>
<message name="activateServiceRequest">
<part name="userId" type="xsd:string"/>
<part name="companyCd" type="xsd:string"/>
<part name="customerCd" type="xsd:string"/>
<part name="stockAccountId" type="xsd:string"/>
<part name="orderNumber" type="xsd:string"/>
<part name="serviceType" type="xsd:string"/>
<part name="location" type="xsd:string"/>
<part name="unitId" type="xsd:string"/>
<part name="serviceIdPool" type="xsd:string"/>
<part name="serviceId" type="xsd:string"/>
<part name="XActivationPackageArray" element="tns2:XActivationPackageArray"/>
</message>
<message name="activateServiceResponse">
<part name="XActivationResponse" element="tns2:XActivationResponse"/>
</message>
</definitions>
------------------------W S D L E N D----------------------------------------------------
------------------------Correct SOAP packet ----------------------------------------------------
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sf2pwrapper.ws.sf2.p1.com">
<soapenv:Body>
<urn:activateService>
<userId>XYZ</userId>
<companyCd>999</companyCd>
<customerCd>ABCDE</customerCd>
<stockAccountId>FGHIJ</stockAccountId>
<orderNumber>888999</orderNumber>
<serviceType>AA</serviceType>
<location>A</location>
<unitId/>
<serviceIdPool>XXX</serviceIdPool>
<serviceId/>
<XActivationPackageArray>
<XActivationPackage>
<activationPackage>MMGG</activationPackage>
</XActivationPackage>
</XActivationPackageArray>
</urn:activateService>
</soapenv:Body>
</soapenv:Envelope>
------------------------Correct reply ----------------------------------------------------
<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>
<activateServiceResponse xmlns="urn:sf2pwrapper.ws.sf2.p1.com">
<ns1:XActivationResponse xmlns:ns1="urn:model.sf2pwrapper.ws.sf2.p1.com">
<unitId xmlns="">0642342</unitId>
<serviceId xmlns="">83753710</serviceId>
</ns1:XActivationResponse>
</activateServiceResponse>
</soapenv:Body>
</soapenv:Envelope>
------------------------BPEL generated SOAP packet--------------------------------------------------
<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:activateService soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="urn:sf2pwrapper.ws.sf2.p1.com">
<userId xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">XYZ</userId>
<companyCd xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">999</companyCd>
<customerCd xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">ABCDE</customerCd>
<stockAccountId xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">FGHIJ</stockAccountId>
<orderNumber xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">888999</orderNumber>
<serviceType xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">AA</serviceType>
<location xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">A</location>
<unitId xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string"></unitId>
<serviceIdPool xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string">XXX</serviceIdPool>
<serviceId xmlns:def="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="def:string"></serviceId>
<XActivationPackageArray>
<XActivationPackageArray xmlns="urn:model.sf2pwrapper.ws.sf2.p1.com">
<XActivationPackage xmlns="">
<activationPackage>MMGG</activationPackage>
</XActivationPackage>
</XActivationPackageArray>
</XActivationPackageArray>
</ns1:activateService>
</soapenv:Body>
</soapenv:Envelope>
------------------------BPEL error--------------------------------------------------
<?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>
<soapenv:Fault>
<faultcode>soapenv:Server.userException</faultcode>
<faultstring>org.xml.sax.SAXException: Invalid element in com.p1.sf2.ws.sf2pwrapper.model.XActivationPackage - XActivationPackage</faultstring>
<detail>
<ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">c7g7mrs</ns1:hostname>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>t
Maybe you are looking for
-
Unable to connect offcard terminal with jcop simulator
Hi all, I have made a JavaCard applet, called DisplayApplet. I am using Eclipse with the JCOP tools plugin. But now I want to make use of an own Terminal that connects to the applet and communicates to it using APDUs. I don't have a smart card reader
-
How to make Windows Update work properly after a fresh XP Home Installation
1. Set up Boot Camp 60 gig partition. 2. Install full copy of Windows XP SP2 on the Boot Camp partition. 3. Using the OSX Disk, Install the Boot Camp 2.0 Drivers for Windows. 4. Download the Boot Camp 2.1 Update from apple.com and install it. 5. In W
-
When away/offline status will be solved
Hello! I would like to appeal on Microsoft seriousness and ask for serious answers! When this problem will be solved? There are hundreds posts in different forums here and no body from Microsoft answering. Problems with statuses persists about one ye
-
Hi All, There is on security group eg:-New Profile,if any new profile check-in ucm automatically the folder structure will create on that perticular profile. The folder structure should be ---root folder EMPID_EMPNAME(Emp001_ABC) Inside root folder 5
-
How to edit song via garageband from my macbook
already drag the song at garageband. but don't know how to cut out two second from the midde of the song.