Skip to Content
0
Feb 26, 2009 at 01:30 PM

Connect a simple WebService fails

1467 Views

Hello Experts,

System:

ECC6.0 with

-SAP_ABA 700 SP 16

-SAP_BASIS 700 SP 16

I created a very simple functionmodule with one import parameter and 3 export parameters. The import parameter doesn't have any further function and the export par. are set with constant values.

FUNCTION zmm_ws_materialklass_mermale .
*"----------------------------------------------------------------------
*"  IMPORTING
*"     VALUE(FANUMMER) TYPE  BAPI_ORDER_KEY-ORDER_NUMBER
*"  EXPORTING
*"     VALUE(ZEICHNDATENBLNR) TYPE  DZEINR
*"     VALUE(ZEICHNIDX) TYPE  DZEIVR
*"     VALUE(DATENBLIDX) TYPE  AESZN
*"----------------------------------------------------------------------

    zeichndatenblnr = '613582'.
    zeichnidx       = '00'.
    datenblidx      = '01'.

ENDFUNCTION.

Then I created the Webservice via transaction SOAMANAGER, exactly like it is demonstrated [here|http://enterprisegeeks.com/blog/2009/02/18/abap-freak-show-february-18-2009/].

The WSDL open up correctly:

<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" xmlns:n1="urn:sap-com:document:sap:rfc:functions">
   <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_ZWS_MAT_CLASS_CHARACT">
      <wsp:ExactlyOne 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: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>
      <saptrnbnd:OptimizedXMLTransfer uri="http://xml.sap.com/2006/11/esi/esp/binxml" wsp:Optional="true" xmlns:saptrnbnd="http://www.sap.com/webas/710/soap/features/transportbinding/"/>
   </wsp:Policy>
   <wsp:Policy wsu:Id="IF_ZWS_MAT_CLASS_CHARACT">
      <sapsession:Session xmlns:sapsession="http://www.sap.com/webas/630/soap/features/session/">
         <sapsession:enableSession>false</sapsession:enableSession>
      </sapsession:Session>
      <wsp:ExactlyOne 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_ZmmWsMaterialklassMermale">
      <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:rfc:functions">
         <xsd:simpleType name="char12">
            <xsd:restriction base="xsd:string">
               <xsd:maxLength value="12"/>
            </xsd:restriction>
         </xsd:simpleType>
         <xsd:simpleType name="char2">
            <xsd:restriction base="xsd:string">
               <xsd:maxLength value="2"/>
            </xsd:restriction>
         </xsd:simpleType>
         <xsd:simpleType name="char22">
            <xsd:restriction base="xsd:string">
               <xsd:maxLength value="22"/>
            </xsd:restriction>
         </xsd:simpleType>
         <xsd:simpleType name="char6">
            <xsd:restriction base="xsd:string">
               <xsd:maxLength value="6"/>
            </xsd:restriction>
         </xsd:simpleType>
      </xsd:schema>
      <xsd:schema attributeFormDefault="qualified" targetNamespace="urn:sap-com:document:sap:soap:functions:mc-style" xmlns:n0="urn:sap-com:document:sap:rfc:functions">
         <xsd:import namespace="urn:sap-com:document:sap:rfc:functions"/>
         <xsd:element name="ZmmWsMaterialklassMermale">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="Fanummer" type="n0:char12"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
         <xsd:element name="ZmmWsMaterialklassMermaleResponse">
            <xsd:complexType>
               <xsd:sequence>
                  <xsd:element name="Datenblidx" type="n0:char6"/>
                  <xsd:element name="Zeichndatenblnr" type="n0:char22"/>
                  <xsd:element name="Zeichnidx" type="n0:char2"/>
               </xsd:sequence>
            </xsd:complexType>
         </xsd:element>
      </xsd:schema>
   </wsdl:types>
   <wsdl:message name="ZmmWsMaterialklassMermale">
      <wsdl:part name="parameters" element="tns:ZmmWsMaterialklassMermale"/>
   </wsdl:message>
   <wsdl:message name="ZmmWsMaterialklassMermaleResponse">
      <wsdl:part name="parameter" element="tns:ZmmWsMaterialklassMermaleResponse"/>
   </wsdl:message>
   <wsdl:portType name="ZWS_MAT_CLASS_CHARACT">
      <wsp:Policy>
         <wsp:PolicyReference URI="#IF_ZWS_MAT_CLASS_CHARACT"/>
      </wsp:Policy>
      <wsdl:operation name="ZmmWsMaterialklassMermale">
         <wsp:Policy>
            <wsp:PolicyReference URI="#OP_ZmmWsMaterialklassMermale"/>
         </wsp:Policy>
         <wsdl:input message="tns:ZmmWsMaterialklassMermale"/>
         <wsdl:output message="tns:ZmmWsMaterialklassMermaleResponse"/>
      </wsdl:operation>
   </wsdl:portType>
   <wsdl:binding name="ZWS_MAT_CLASS_CHARACT" type="tns:ZWS_MAT_CLASS_CHARACT">
      <wsp:Policy>
         <wsp:PolicyReference URI="#BN_ZWS_MAT_CLASS_CHARACT"/>
      </wsp:Policy>
      <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="document"/>
      <wsdl:operation name="ZmmWsMaterialklassMermale">
         <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="service">
      <wsdl:port name="ZWS_MAT_CLASS_CHARACT" binding="tns:ZWS_MAT_CLASS_CHARACT">
         <soap:address location="http://myserver:8080/sap/bc/srt/rfc/sap/zws_mat_class_charact/100/zws_mat_class_charact/zws_mat_class_charact"/>
      </wsdl:port>
   </wsdl:service>
</wsdl:definitions>

So I could think it should works well. But when I would test it with [soapUI|http://www.soapui.org] the WSDL is parsed well:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sap-com:document:sap:soap:functions:mc-style">
   <soapenv:Header/>
   <soapenv:Body>
      <urn:ZmmWsMaterialklassMermale>
         <Fanummer>?</Fanummer>
      </urn:ZmmWsMaterialklassMermale>
   </soapenv:Body>
</soapenv:Envelope>

but finally by submit this request to the endpoint it gives me errors back:

400 Bad HTTP request
Error: -21
Version: 7000
Component: HTTP_PLG
Date/Time: Thu Feb 26 13:25:20 2009

Module: http_plg_mt.c
Line:4893
Server: hg21288_ETT_00
Error Tag: {0002b381
Detail: illegal request version

Even simple test cases with soapui like this [example|http://www.soapui.org/userguide/functional/getting_started.html] didn't work. But the user login works for this Webservice...

SchemaComplianceAssertion
line -1: error: Unexpected character encountered: 'w'
line 6: Unexpected character encountered: 'w'

SoapFaultAssertion
Response is not a SOAP Fault

What does it mean?

When I enter the location address which is showed up in the WSDL document directly in the browser it gives me the following response:

<soap-env:Envelope>
	<soap-env:Header/>
	<soap-env:Body>
		<soap-env:Fault>
			<faultcode>soap-env:Server</faultcode>
			<faultstring xml:lang="en">
			SRT: Wrong Content-Type and empty HTTP-Body received
			</faultstring>
			<detail>
			  <ns:SystemFault>
			  <Host>undefined</Host>
			  <Component>COREMSG</Component>
			  <ChainedException>
			    <Exception_Name>CX_SOAP_CORE</Exception_Name>
			    <Exception_Text>
			    SRT: Wrong Content-Type and empty HTTP-Body received
			    </Exception_Text>
			  </ChainedException>
			  </ns:SystemFault>
			</detail>
		</soap-env:Fault>
	</soap-env:Body>
</soap-env:Envelope>

The user who connects to the webservice has SAP_ALL profile and all the SAP_BC_WEBSERVICE* roles.

So maybe I have to test one step before, without the soapui tool, but what does the [documentation|http://help.sap.com/saphelp_nw70/helpdata/en/47/39b5df39591a53e10000000a1553f7/frameset.htm] for SOAMANAGER mean with point 7? Where do I have to specify the parameters?

regards,

Steffen