SAP の関数から RFC を作成したいと考えています。この関数から SAP データ ソースを生成しました。私がこのアドレスに行くとき: http://xxx.xxx.com:8000/sap/bc/soap/wsdl11?sap-client=200&services=ZTEST私はこのページを持っています:
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:s0="urn:sap-com:document:sap:rfc:functions" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" targetNamespace="urn:sap-com:document:sap:rfc:functions">
<types>
<xsd:schema targetNamespace="urn:sap-com:document:sap:rfc:functions">
<xsd:element name="ZTEST">
<xsd:complexType>
<xsd:all>
<xsd:element name="RESULT">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:PA0105">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:element name="ZTEST.Response">
<xsd:complexType>
<xsd:all>
<xsd:element name="RESULT">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="item" minOccurs="0" maxOccurs="unbounded" type="s0:PA0105">
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:all>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="PA0105">
<xsd:sequence>
<xsd:element name="MANDT" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PERNR" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="8">
</xsd:maxLength>
<xsd:pattern value="\d*">
</xsd:pattern>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="SUBTY" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="OBJPS" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="SPRPS" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ENDDA" minOccurs="0" type="s0:date">
</xsd:element>
<xsd:element name="BEGDA" minOccurs="0" type="s0:date">
</xsd:element>
<xsd:element name="SEQNR" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="3">
</xsd:maxLength>
<xsd:pattern value="\d*">
</xsd:pattern>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="AEDTM" minOccurs="0" type="s0:date">
</xsd:element>
<xsd:element name="UNAME" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="12">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="HISTO" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ITXEX" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="REFEX" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ORDEX" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="ITBLD" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="PREAS" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FLAG1" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FLAG2" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FLAG3" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="FLAG4" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="1">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RESE1" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="RESE2" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="2">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="GRPVL" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USRTY" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="4">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USRID" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="30">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
<xsd:element name="USRID_LONG" minOccurs="0">
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="241">
</xsd:maxLength>
</xsd:restriction>
</xsd:simpleType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
<xsd:simpleType name="date">
<xsd:restriction base="xsd:string">
<xsd:maxLength value="10">
</xsd:maxLength>
<xsd:pattern value="....-..-..">
</xsd:pattern>
</xsd:restriction>
</xsd:simpleType>
</xsd:schema>
</types>
<message name="ZTESTInput">
<part name="parameters" element="s0:ZTEST">
</part>
</message>
<message name="ZTESTOutput">
<part name="parameters" element="s0:ZTEST.Response">
</part>
</message>
<portType name="ZTESTPortType">
<operation name="ZTEST">
<input message="s0:ZTESTInput">
</input>
<output message="s0:ZTESTOutput">
</output>
</operation>
</portType>
<binding name="ZTESTBinding" type="s0:ZTESTPortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http">
</soap:binding>
<operation name="ZTEST">
<soap:operation soapAction="http://www.sap.com/ZTEST">
</soap:operation>
<input>
<soap:body use="literal">
</soap:body>
</input>
<output>
<soap:body use="literal">
</soap:body>
</output>
</operation>
</binding>
<service name="ZTESTService">
<documentation>
SAP Service ZTEST via SOAP</documentation>
<port name="ZTESTPortType" binding="s0:ZTESTBinding">
<soap:address location="http://***.***.com:8000/sap/bc/soap/rfc">
</soap:address>
</port>
</service>
</definitions>
次のような投稿リクエストを送信する Javascript 関数を作成しました。
var webServiceURL = 'http://xxx.xxx.com:8000/sap/bc/soap/wsdl11?sap-client=200&services=ZTEST';
function createSoapEnvelope(contents) {
return '<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" ' +
'SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">' +
'<SOAP-ENV:Body>' + contents + '</SOAP-ENV:Body></SOAP-ENV:Envelope>';
}
function HelloWorld() {
var message = createSoapEnvelope("<ZTEST/>");
$.ajax({
url: webServiceURL,
type: "POST",
dataType: "xml",
data: message,
async: false,
contentType: "text/xml; charset=\"utf-8\"",
success: OnSuccess,
processData: false,
error: OnError
});
return false;
}
function OnSuccess(data, status) {
alert(data.d);
}
function OnError(request, status, error) {
alert('error');
}
HelloWorld();
コードを実行すると、説明にとどまります。ユーザーのリストが必要です。
解決策はありますか?
ありがとう!
編集 1
http://xxx.xxx.com:8000/sap/bc/srt/wsdl/srvc_%5Bguid%5D/wsdl11/allinone/ws_policy/document?sap-client=200にアクセスすると
私はこれを持っています:
<soap:Envelope>
<soap:Body>
<soap:Fault>
<faultcode>
soap:Server</faultcode>
<faultstring>
No service definition, interface name, or binding specified</faultstring>
<detail>
<slibfault:timestamp>
Tue, 23 Oct 2012 12:06:02 GMT</slibfault:timestamp>
<slibfault:exception>
<slibfault:text>
No service definition, interface name, or binding specified</slibfault:text>
<slibfault:position program="CL_SRT_WSP_WSDL_HANDLER_HTTP==CP" include="CL_SRT_WSP_WSDL_HANDLER_HTTP==CM002" line="353 "/>
</slibfault:exception>
</detail>
</soap:Fault>
</soap:Body>
</soap:Envelope>
ここに行くと: http://xxx.xxx.com:8000/sap/bc/srt/rfc/sap/ZTEST/200/ztest/binding空白のページがあります。
soamanager で、Web サービスを選択すると、次のような構成の行があります。
- サービス : ZTEST
- エンドポイント: ZTEST
- 状態 : アクティブ
- 作成タイプ : 手動作成