cancel
Showing results for 
Search instead for 
Did you mean: 

SAP Web Services from .NET problems

Former Member
0 Kudos

I am trying to execute a SAP web service from the ES workplace via Visual Studio. I incorporate the web service into my .NET project by doing an Add Reference in Visual Studio. The following WSDL is generated with Visual studio flagging the highlighted lines below as undeclared. Does anyone know why this is occurring? When I try to execute the project I get reflection errors which I am sure is a byproduct of the undeclared issue. Any Help would be much appreciated. Here is a partial view of the generated WSDL:

<?xml version="1.0" encoding="utf-8"?>

<wsdl:definitions xmlns:tns="http://sap.com/xi/APPL/SE/Global" xmlns:n0="http://sap.com/xi/SAPGlobal20/Global" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" targetNamespace="http://sap.com/xi/APPL/SE/Global" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">

<wsdl:types>

<xsd:schema xmlns:xi0="http://sap.com/xi/SAPGlobal20/Global" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:xi1="http://sap.com/xi/APPL/SE/Global" xmlns="http://sap.com/xi/SAPGlobal20/Global" targetNamespace="http://sap.com/xi/SAPGlobal20/Global">

<xsd:import namespace="http://sap.com/xi/APPL/SE/Global" />

<b><xsd:element name="SalesOrderByIDQuery_sync" type="xi1:SalesOrderByIDQueryMessage_sync" />

<xsd:element name="SalesOrderByIDResponse_sync" type="xi1:SalesOrderByIDResponseMessage_sync" /></b>

<xsd:element name="StandardMessageFault">

<xsd:complexType>

<xsd:sequence>

<b> <xsd:element name="standard" type="xi1:ExchangeFaultData" /></b>

</xsd:sequence>

</xsd:complexType>

</xsd:element>

</xsd:schema>

<xsd:schema xmlns:xi0="http://sap.com/xi/SAPGlobal20/Global" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl" xmlns:xi1="http://sap.com/xi/APPL/SE/Global" xmlns="http://sap.com/xi/APPL/SE/Global" targetNamespace="http://sap.com/xi/APPL/SE/Global">

<xsd:complexType name="Amount">

<xsd:simpleContent>

<xsd:extension base="xi1:AmountContent">

<xsd:attribute name="currencyCode" use="required">

<xsd:simpleType>

Accepted Solutions (0)

Answers (3)

Answers (3)

sbhutani1
Contributor
0 Kudos

Hi Edwards,

Please refer to the below How to document for calling a webservice in Microsoft .NET 2.0 or visual studio .NET 2005. One of my friend was also getting the errors while calling webservice and he just followed this document which leads him to successfully calling the webservice exposed by XI.

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/3057b5a7-99d0-2910-8f8f-f357dc4b...

Regards

Sumit Bhutani

Former Member
0 Kudos

Hi Edward,

probably the following link to the cook book for consuming ES with .NET could of some help to you.

<a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/905c28e4-38a9-2910-4db5-d39e4fcbf78b">https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/905c28e4-38a9-2910-4db5-d39e4fcbf78b</a>

Best Regards,

Maran

Former Member
0 Kudos

hi edward,

as far as I understand the problem, Visual Studio tries to create client classes from the WSDL description.

One of your elements is typed like xi1:SalesOrderByIDQueryMessage_sync, which means a type SalesOrderByIDQueryMessage_sync defined in the (correctly imported) namespace http://sap.com/xi/APPL/SE/Global, abbreviated as xi1.

To create local datatypes your VisStudio needs to know what this datatype looks like, i.e. it needs a schema. But no schema can't be found in the default place (i.e. the namespace; try for instance the well known namespaces like http://schemas.xmlsoap.org/wsdl/), in fact they redirect you to a promotion page.

So to support your creation tool the WSDL should

- either use the schemaLocation attribute in the import directive

- or you insert the schema manually in your WSDLand adjust namespaces accordingly

Unfortunately I don't know a schemaLocation for http://sap.com/xi/APPL/SE/Global.

regards, anton