cancel
Showing results for 
Search instead for 
Did you mean: 

Use SAP Webservice in .NET (C#) - problem with creating the service

Former Member
0 Kudos

Hi,

I am trying to consume a small & simple SAP Webservice in a C# console program. As a basis I found this tutorial:

[http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/004975cc-2a7f-2a10-f8a8-82b90ff07396?quicklink=index&overridelayout=true|http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/004975cc-2a7f-2a10-f8a8-82b90ff07396?quicklink=index&overridelayout=true]

But it is not working for me. This is my first webservice and I am sure that I do something wrong with the classes.

I do not have exactly the same names as within the tutorial. I created the Webservice in SE80 and then configures a new service + binding in SOAMANAGER.

This is my WSDL file (copy'n'paste from Inter Explorer:


  <?xml version="1.0" encoding="utf-8" ?> 
- <wsdl:definitions targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:tns="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
- <wsdl:documentation>
  <sidl:sidl xmlns:sidl="http://www.sap.com/2007/03/sidl" /> 
  </wsdl:documentation>
  <wsp:UsingPolicy wsdl:required="true" /> 
- <wsp:Policy wsu:Id="BN_Z_SRT_TESTS_FB_SUM_BINDING">
  <wsaw:UsingAddressing xmlns:wsaw="http://schemas.xmlsoap.org/ws/2004/08/addressing" /> 
  <saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/" wsp:Optional="true" /> 
  <sapattahnd:Enabled xmlns:sapattahnd="http://www.sap.com/710/features/attachment/">false</sapattahnd:Enabled> 
- <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility">
- <wsp:All>
- <sp:TransportBinding>
- <wsp:Policy>
- <sp:TransportToken>
- <wsp:Policy>
- <sp:HttpsToken>
- <wsp:Policy>
  <sp:HttpBasicAuthentication /> 
  </wsp:Policy>
  </sp:HttpsToken>
  </wsp:Policy>
  </sp:TransportToken>
- <sp:AlgorithmSuite>
- <wsp:Policy>
  <sp:TripleDesRsa15 /> 
  </wsp:Policy>
  </sp:AlgorithmSuite>
- <sp:Layout>
- <wsp:Policy>
  <sp:Strict /> 
  </wsp:Policy>
  </sp:Layout>
  </wsp:Policy>
  </sp:TransportBinding>
  </wsp:All>
  </wsp:ExactlyOne>
  </wsp:Policy>
- <wsp:Policy wsu:Id="IF_Z_SRT_TESTS_FB_SUM">
- <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
  <sapsession:enableSession>false</sapsession:enableSession> 
  </sapsession:Session>
  <wsp:ExactlyOne xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:sapsp="http://www.sap.com/webas/630/soap/features/security/policy" xmlns:sp="http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702" xmlns:wsa="http://www.w3.org/2005/08/addressing" xmlns:wsu="http://schemas.xmlsoap.org/ws/2002/07/utility" /> 
  </wsp:Policy>
- <wsp:Policy wsu:Id="OP_SrtTestsFbSum">
  <sapcomhnd:enableCommit xmlns:sapcomhnd="http://www.sap.com/NW05/soap/features/commit/">false</sapcomhnd:enableCommit> 
  <sapblock:enableBlocking xmlns:sapblock="http://www.sap.com/NW05/soap/features/blocking/">true</sapblock:enableBlocking> 
  <saptrhnw05:required xmlns:saptrhnw05="http://www.sap.com/NW05/soap/features/transaction/">no</saptrhnw05:required> 
  <saprmnw05:enableWSRM xmlns:saprmnw05="http://www.sap.com/NW05/soap/features/wsrm/">false</saprmnw05:enableWSRM> 
  </wsp:Policy>
- <wsdl:types>
- <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style">
- <xsd:simpleType name="RfcException.Message.Number">
- <xsd:restriction base="xsd:string">
  <xsd:maxLength value="3" /> 
  <xsd:pattern value="d*" /> 
  </xsd:restriction>
  </xsd:simpleType>
- <xsd:complexType name="RfcException.Message">
- <xsd:sequence>
  <xsd:element name="ID" type="xsd:string" /> 
  <xsd:element name="Number" type="tns:RfcException.Message.Number" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:complexType name="SrtTestsFbSum.RfcException">
- <xsd:sequence>
  <xsd:element name="Name" type="tns:SrtTestsFbSum.RfcExceptions" /> 
  <xsd:element name="Text" type="xsd:string" minOccurs="0" /> 
  <xsd:element name="Message" type="tns:RfcException.Message" minOccurs="0" /> 
  </xsd:sequence>
  </xsd:complexType>
- <xsd:simpleType name="SrtTestsFbSum.RfcExceptions">
- <xsd:restriction base="xsd:string">
  <xsd:enumeration value="ResultIsNegative" /> 
  </xsd:restriction>
  </xsd:simpleType>
  <xsd:element name="SrtTestsFbSum.Exception" type="tns:SrtTestsFbSum.RfcException" /> 
- <xsd:element name="SrtTestsFbSum">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="P1" type="xsd:int" minOccurs="0" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
- <xsd:element name="SrtTestsFbSumResponse">
- <xsd:complexType>
- <xsd:sequence>
  <xsd:element name="Result" type="xsd:int" /> 
  </xsd:sequence>
  </xsd:complexType>
  </xsd:element>
  </xsd:schema>
  </wsdl:types>
- <wsdl:message name="SrtTestsFbSum">
  <wsdl:part name="parameters" element="tns:SrtTestsFbSum" /> 
  </wsdl:message>
- <wsdl:message name="SrtTestsFbSumResponse">
  <wsdl:part name="parameter" element="tns:SrtTestsFbSumResponse" /> 
  </wsdl:message>
- <wsdl:portType name="Z_SRT_TESTS_FB_SUM">
- <wsp:Policy>
  <wsp:PolicyReference URI="#IF_Z_SRT_TESTS_FB_SUM" /> 
  </wsp:Policy>
- <wsdl:operation name="SrtTestsFbSum">
- <wsp:Policy>
  <wsp:PolicyReference URI="#OP_SrtTestsFbSum" /> 
  </wsp:Policy>
  <wsdl:input message="tns:SrtTestsFbSum" /> 
  <wsdl:output message="tns:SrtTestsFbSumResponse" /> 
  </wsdl:operation>
  </wsdl:portType>
- <wsdl:binding name="Z_SRT_TESTS_FB_SUM_BINDING" type="tns:Z_SRT_TESTS_FB_SUM">
- <wsp:Policy>
  <wsp:PolicyReference URI="#BN_Z_SRT_TESTS_FB_SUM_BINDING" /> 
  </wsp:Policy>
- <wsa:EndpointReference xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing">
  <wsa:ReferenceParameters /> 
  </wsa:EndpointReference>
  <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document" /> 
- <wsdl:operation name="SrtTestsFbSum">
  <soap:operation soapAction="" style="document" /> 
- <wsdl:input>
  <soap:body use="literal" /> 
  </wsdl:input>
- <wsdl:output>
  <soap:body use="literal" /> 
  </wsdl:output>
  </wsdl:operation>
  </wsdl:binding>
- <wsdl:service name="Z_SRT_TESTS_FB_SUM_WD">
- <wsdl:port name="Z_SRT_TESTS_FB_SUM_BINDING" binding="tns:Z_SRT_TESTS_FB_SUM_BINDING">
  <soap:address location="http://mucr3psd.opentext.net:8001/sap/bc/srt/rfc/sap/z_srt_tests_fb_sum/800/z_srt_tests_fb_sum_wd/z_srt_tests_fb_sum_binding" /> 
  </wsdl:port>
  </wsdl:service>
  </wsdl:definitions>

Within the tutorial the service is created with this coding:

[code]

zwsd_srt_tests_fb_sum.zwsd_srt_tests_fb_sumService proxy1 = new Callzwsd_srt_tests_fb_sum.zwsd_srt_tests_fb_sum.zwsd_srt_tests_

fb_sumService();

[code]

Ok I have different namespaces but the main problem is that can not find any class like zwsd_srt_tests_fb_sumService

I have only classes without this "Service" and now nothing works.

I appreciate any help.

Thanks a lot.

Regards

Tom

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

what is wrong with my format? I used tags and started new lines but the whole post looks completely strange.