on 10-29-2015 9:30 AM
Hi!
I'm having trouble with namespaces and this is not the first time.
I'm developing a scenario step that has inbound BusinessPartner event and void output. The BP information is sent to a salesforce webservice in 5 http call atoms inside the step.
Last week this worked very well.
But now, after adding more atoms and logic, I get the exception "Prefix not mapped: soapenv".
xmlns:b1ie="urn:com.sap.b1i.sim:b1ievent"
xmlns:b1im="urn:com.sap.b1i.sim:b1imessage"
xmlns:bfa="urn:com.sap.b1i.bizprocessor:bizatoms"
xmlns:jdbc="urn:com.sap.b1i.adapter:jdbcadapter"
xmlns:rfc="urn:sap-com:document:sap:rfc:functions"
xmlns:sim="urn:com.sap.b1i.sim:entity"
xmlns:utils2="com.sap.b1i.bpc_tools.Utilities"
xmlns:vpf="urn:com.sap.b1i.vplatform:entity"
xmlns:xci="urn:com.sap.b1i.xcellerator:intdoc"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:xup="urn:com.sap.b1i.xcellerator:upltdoc"
xmlns:urn="urn:enterprise.soap.sforce.com"
xmlns:urn1="urn:sobject.enterprise.soap.sforce.com"
But this results in an exception in an atom that uses the document function: "Exception while sending warning. in 'document' - function"
The code for the document is:
<xsl:variable name="vpSF_SYSTEM" select="/vpf:Msg/vpf:Header/vpf:Properties/vpf:prop[./@id='SF_SYSTEM']/@value"></xsl:variable>
<xsl:variable name="sysIdDocPath" select="concat('/com.sap.b1i.system.sld.directory/SysId.xml/',$vpSF_SYSTEM,'(Id)')"/>
<xsl:variable name="sysIdDoc" select="document($sysIdDocPath)"/>
<xsl:variable name="sysIdHTTA" select="$sysIdDoc/sim:SysId/sim:ConnectivityList/sim:Connectivity[./@ConnectivityTypeId='HTTA']"/>
Both sim and vpf is in the namespace list. Why is this happening?
This code works if I don't add the namespaces in the Inbound channel.
Any help appreciated!
Regards
Lars
Hi Lars,
most of the namespaces are already part of the B1i namespace list, you don't need to define them explicitly at the inbound again.
The already embedded namespaces are automatically created. E.g. after creation of an new xform you can see them directly added into the xsl file as attributes of xsl:stylesheet.
=> In your step inbound definition you only need to add those which are not explicitly listed in xsl:stylesheet.
In the inbound step definition, please be aware that the namespaces must not be defined twice using different prefixes (for all scenario steps):
E.g. the following namespace is used in the sap.B1Mobile scenario: xmlns:b1mb="http://tempuri.org/"
Best regards
Bastian
P.S.: In a xslt mapping you can also avoid explicit namepace usage by applying the following construct:
/*[local-name()='<name_of_your_element>'],
e.g. select="/*[local-name()='Msg']/..." instead of select="/vpf:Msg/..."
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Bastian!
Thanks for your answer. And for the explantion of how B1i uses the namespaces. It seems a bit sensitive to have the two restrictions that you are writing. That can explain some strange behaviours that I have been faced.
I now deleted the namespacelist in inbound channel, deleted all soapenv namespace declarations in all xsl files. Then I used local-name() in the atoms that made this error to occur.
Now it works.
I have used local-name before and yes, it's a convenient way to get rid of namespace problems. The drawback is that the code is harder to read (and write).
Wish you a nice weekend!
Regards
Lars
User | Count |
---|---|
103 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.