Microsoft
Software
Hardware
Network
Question : How to move XML namespaces to SOAP header in Webservice proxy (From WSDL file)
I'm having a major problem connecting with SAP WebServices since it has been decided to use PI/XI as the SAP frontend for accessing the WebService.
Why? Because PI/XI demands that all namespaces used has to be defined in the SOAP:envelope and because Visual Studio creates a proxy which attached the namespaces as attribute to the xml tag. There is no problem using the Visual Studio style calling the SAP WebServices directly
The scenario:
- Visual Studio 2008
- .NET Framework 3.5
- VB.NET
1. We get a WSDL file from the SAP team
2. We add a Web Reference in Visual Studio using the WSDL file.
3. We fill out the parameters
4. We call the WebService
5. We expect a well formed SOAP reponse with SAP data
This is an example of the SOAP envelope while calling the WebService from Visual Studio:
http://schemas
.xmlsoap.o
rg/soap/en
velope/" xmlns:xsi="
http://www.w3.o
rg/2001/XM
LSchema-in
stance
" xmlns:xsd="
http://www.w3.o
rg/2001/XM
LSchema
">
aByElement
sQuery_syn
c xmlns="
http://sap.com/xi/A
PPL/SE/Glo
bal
">
aSelection
ByElements
xmlns="">
I<
/Inclusion
ExclusionC
ode>
1lBoundaryT
ypeCode>
99999999<
/LowerBoun
daryID>
0000
999999yerPartyIn
ternalID>
0001<
/SalesOrga
nisationID
>
edIndicato
r>falseifeCycleSt
atusNotCom
pletedIndi
cator>
taSelectio
nByElement
s>
derList_He
ader xmlns="urn:solar-eu:docume
nt:enhance
ment_esa:m
essages">
1stIndicato
r>
rderList_H
eader>
taByElemen
tsQuery_sy
nc>
The important thing to notice here is the xlmns attributes for
aByElement
sQuery_syn
c> and
derList_He
ader>
This is Visual Studio style, and this generates a java exception in the PI/XI
When using the freeware tool SoapUI it creates the following soap enveloper:
http://schemas
.xmlsoap.o
rg/soap/en
velope/" xmlns:xsi="
http://www.w3.o
rg/2001/XM
LSchema-in
stance
" xmlns:xsd="
http://www.w3.o
rg/2001/XM
LSchema
" xmlns:glob="
http://sap.com
/xi/APPL/S
E/Global
" xmlns:urn="urn:solar-eu:do
cument:enh
ancement_e
sa:message
s">
icDataByEl
ementsQuer
y_sync>
aSelection
ByElements
>
P<
/Inclusion
ExclusionC
ode>
1lBoundaryT
ypeCode>
99999999<
/LowerBoun
daryID>
0000
999999yerPartyIn
ternalID>
0001<
/SalesOrga
nisationID
>
edIndicato
r>falseifeCycleSt
atusNotCom
pletedIndi
cator>
taSelectio
nByElement
s>
s_OrderLis
t_Header>
1stIndicato
r>
es_OrderLi
st_Header>
sicDataByE
lementsQue
ry_sync>
The important thing to notice here is that the xmlns's has been moved to the
and it use prefixes (glob., urn:) to attach the namespace to the xml tags.
THIS WORKS WITH XI/PI and it returns data !!!
So my qustions is:
1. Is it possible to somehow change the way Visual Studio attach namespaces in the soap request while autogenerating the code from the WSDL file, so that it reflects the wau SoapUI does it?
2. Is it possible to manually change the autogenerated code, to do the same as SoapUI?
3. Is it possoble to change the the was to soap request is build in runtime?
I really really hope that there is someone out there who can point me in the right direction or even provide me with the solution.
if not I have to handcode a LOT of SAP webservice calls, from scratch !!!
Answer : How to move XML namespaces to SOAP header in Webservice proxy (From WSDL file)
I have already created my own generic solution using SoapExtension in .NET.
Random Solutions
Please increase performance of this extremely slow sql statement
ESSENTIAL BUSINESS SERVER 2008 INSTALLATION ERRORS
ASP.NET Modal popup window
Forms closing ??
Exchange 2003 with 2 certificates
How do I remove the email header in Excel 2007
LAN Based Desktop Sharing Solution?
Exchange 2010 tools on Win2003 x32
Error printing report
using Access to create email message bounces back if user changes message body